Civic Innovations

Technology, Government Innovation, and Open Data


Context is King

A lot of people I talk to that are new to AI-assisted coding make a similar mistake: they look at it as automation when in reality it’s delegation.

And this confusion is totally understandable, because automation is everywhere in modern software development, and it should be. Running test suites, provisioning environments from infrastructure-as-code, security scans, accessibility checks. These are deterministic processes by design. You want the exact same result every time, and when you don’t get it, something is probably very wrong. Automation in software development operates on sort of a vending-machine model: press the button, get the thing, every time. If you don’t something’s broken.

When people bring that same expectation to an AI coding tool and the output doesn’t match what they intended, they sometimes reach the same conclusion they’d reach about a failed CI test: Something is broken. The coding agent did not do its job properly.

But generating code from intent isn’t automation. It’s delegation. And this distinction is critically important.

When you hand a task to someone on your team (research this, draft that, summarize these findings, etc.) and the results comes back different from what you expected, you (hopefully) don’t automatically assume that person is bad at their job. You recognize another possible explanation: they didn’t have full context of what you were asking them to do, or your instructions left room for interpretation, or you hadn’t fully articulated what “done” was supposed to look like.

And here’s what you’d (again, hopefully) do about it with your teammate: you’d give them more to work with. An example of a similar deliverable you liked. A template or outline to follow. The documentation for the thing they are analyzing. We know intuitively that a well-briefed person produces work closer to what we envisioned, so we can front-load that context before they get started.

The same is true for an AI coding agent. When you provide example code, established patterns, templates, and comprehensive documentation for the interfaces it’s working with, the output moves much closer to your intent. When you don’t (when that context lives only in your head, exactly as it would with an under-briefed coworker) the result can end up a long way from what you imagined. If you don’t provide the agent with the appropriate skill and instruction files, access to example code, templates, and documentation, they will fill the gap the only way they are able to: by relying on what’s in their training data.

So when the output of an AI coding tool surprises you, think about the artifacts and information you would use to delegate a similar task to a coworker. What do they need in order to fulfill your request in the way that you imagine? How can you set the context for their work? How do you better ensure what you are asking them to do is completed successfully?

This is the important shift in agentic coding. We tend to think the hard part of AI-assisted coding as the setup (picking the right harness, choosing the most sophisticated models, etc.) But the tool is just the engine, raw horsepower. What determines the quality of the result the tool produces is everything you put around it: the examples, the patterns, the documentation, the constraints that turn an unclear request into a clear one that’s easier to execute.

Managing the context of AI coding tools is the real work. In agentic coding, context is king.

Header Image: “Charles II of England in Coronation robes” by John Michael Wright (c. 1671–1676), Royal Collection Trust. Public domain, via Wikimedia Commons.

Fediverse Reactions

Leave a comment

About Me

I am the former Chief Data Officer for the City of Philadelphia. I also served as Director of Government Relations at Code for America, and as Director of the State of Delaware’s Government Information Center. For about six years, I served in the General Services Administration’s Technology Transformation Services (TTS), and helped pioneer their work with state and local governments. I also led platform evangelism efforts for TTS’ cloud platform, which supports over 30 critical federal agency systems.