Context Engineering for Coding Agents
AI coding agents can read files, edit code, and run tests - but even capable models can produce the wrong solution if they lack the right information about your project.
This is where context engineering comes in.
More than prompt engineering
Prompt engineering focuses on what you ask. Context engineering focuses on what the agent knows when it acts.
For a coding agent, useful context includes:
- The goal: What should change, and what should stay untouched?
- The codebase: Which modules, APIs, and architecture decisions matter?
- The constraints: Coding conventions, security rules, and existing patterns.
- The feedback: Relevant errors, test results, and acceptance criteria. The objective isn't to stuff the entire repository into the context window. It's to provide the smallest useful set of facts, then let the agent inspect more when needed.
A practical example
Compare a vague task: "Add audit logging to invoice approvals."
With a context-rich one: "Add an audit event when an invoice is approved. Start in src/billing/approveInvoice.ts. Reuse the existing AuditService, never log personal data, and add tests for successful and rejected approvals. Run the billing test suite before finishing."
The second request doesn't dictate every line of code. It gives the agent boundaries and a way to verify success.
Give agents a map, not a manual
Repository instructions such as AGENTS.md can explain where to find architecture documentation, testing commands, and important conventions. Keep that entry point short and link to deeper material instead of duplicating everything.
This matters because extra context can become noise. A coding agent needs relevant evidence at the right moment, not a mountain of outdated instructions.
Our take
Better context beats bigger prompts. Reliable AI-assisted development comes from clear goals, discoverable project knowledge, sensible constraints, and tests that prove the change works.
We see this as an essential part of building useful, customised software with AI: the engineering around the model matters as much as the model itself.