Give Coding Agents the Right Context (Not More of It)

·3 min read

A single sentence asking for a login endpoint is not enough. The agent still needs to know your error format, folder layout, auth library, validation pattern, and what “done” looks like. Legare Kerrison’s short IBM Technology video Context-Aware Coding: Give AI Agents the Right Context (published 2 November 2026) makes the point concrete and practical for teams already using coding agents.

This is not another high-level bottleneck essay. It is a short list of inputs that actually change the output.

The inputs that matter

  1. Files and structure. Strong agents can search and open files themselves. Your job is to point them in the right direction (“follow the pattern in the README”) and, ideally, give them a compact repo map of files and symbols so they see the shape without reading every line.

  2. Exact dependency versions. Knowing you use a library is not enough. The lockfile records the resolved versions (including transitive ones) and therefore which APIs actually exist. Many “hallucinated” functions are simply version mismatches.

  3. A test the agent can pass. A failing test turns the session into a write–run–fix loop. Agentic coding works better when the agent knows what good looks like.

  4. Conventions and constraints. Put build commands, coding standards, and hard rules (“don’t touch this directory”) in a checked-in AGENTS.md (or the equivalent your tool already reads). This is becoming a shared team interface.

  5. Intent. Only a human knows what done means, what the constraints are, and what the agent must not do. The agent cannot discover this by reading the repo.

Three moves before any code is written

  • Ask the agent to interview you and keep asking questions until it understands the task.
  • Tell it to explore the repo and explain the structure back to you in plain language. Now you both share a map.
  • Have it write a plan and list its assumptions. Review those assumptions before implementation. When the session ends, write the useful discoveries back into the instructions file so the next person (or agent) starts further ahead.

Do not dump the whole repo

Models do not pay equal attention to everything in a long context. Information at the beginning and end tends to be used better than material buried in the middle (“lost in the middle”). Every irrelevant file competes with a relevant one. For a login-flow change the agent needs the auth module, its tests, and the conventions—not the billing service or three-week-old build logs.

Practical consequences:

  • Start a fresh session for each new task.
  • Point at specific files and clear noise when a session grows long.
  • Prefer an orchestrator that spins up focused sub-tasks with clean context over one overloaded conversation.

The goal is not more context. It is the right context, with a human still making the decisions.

Related discussion on Hacker News continues to note that agents generate more code than they generate finished, maintainable software; review and verification remain the scarce steps. Better context does not remove those steps, but it reduces the amount of slop that reaches them.

Sources: the IBM Technology video linked above. The same themes appear in recent Agentic AI Foundation and AI Engineer talks on agent readiness and shared interfaces, but the short, concrete checklist is what makes this video useful on Monday morning.

Share