A workspace in which coding agents do good work
Key takeaway
Coding agents produce reliably useful code when the repository tells them how work is done: a context file with commands and rules, fast automated tests and clearly limited permissions. The choice of tool matters less than how well the project is prepared.
Lessons in this path
What is a coding agent and how does it differ from autocomplete?
A coding agent is a language model that does more than suggest code: it reads files, runs terminal commands, starts tests and makes changes across several files on its own. Examples include Claude Code, Cursor in agent mode, OpenAI Codex, GitHub Copilot in agent mode and tools such as Aider. Autocomplete fills in the next line; an agent works through an entire task, for example “add a CSV export for invoices and write tests for it”.
This calls for a different way of working. You write less code yourself and spend more time on instructions, context and review. An agent does not know your product. It sees only what is in the repository and what you tell it. Without that context it guesses, and guessed assumptions end up in the product as plausible-looking code.
Which files does a repository need so agents understand it?
The most important investment is a context file in the repository root. Depending on the tool it is called AGENTS.md or CLAUDE.md, or it lives as a rules file in the editor. It briefly describes what the product does, how to run and test it, and which rules apply. Good context files are short and concrete, closer to one page than ten.
- The product’s purpose in two sentences and the key domain terms.
- Exact commands for install, development, tests, linter and type checks.
- Folder structure: where business logic, APIs and UI live.
- Prohibitions: no new dependencies without asking, no changes to migrations or payment logic without approval.
- Definition of done: tests passing, type check clean, short summary of the change.
When an agent makes the same mistake twice, the correction belongs in the context file, not only in the chat.
How much freedom should an agent get?
Most tools offer graded permissions: read only, propose changes, write files, run commands, work without asking. A simple rule works well for a start-up: the harder an action is to undo, the more it needs confirmation from a person.
| Action | Recommendation | Reason |
|---|---|---|
| Read files, run tests and linters | Allow | No side effects outside the local environment |
| Change code on its own branch | Allow | Git makes every change reversible |
| Install packages | Ask first | Supply-chain risk and licensing questions |
| Database migrations, payment and auth code | Ask and review | Errors affect data and money |
| Access to production data or deployments | Not for agents | Hard to reverse, high cost of failure |
Why are fast tests the real prerequisite?
An agent works in loops: change, check, correct. Without automated checks it has no signal whether its change works. It then reports “done” because the code looks plausible. With tests, type checks and a linter it can find errors itself before you even look at the diff (the list of changes).
For teams without a testing culture this is a good reason to start small: a few tests for the business logic that costs the most money or trust when it breaks, such as pricing, permissions or data export. You can ask the agent to write these tests first and present them for your review.
Going deeper: steering context deliberately
Agents have a limited context window, an upper bound on how much text they can consider at once. Long sessions, large log outputs and needlessly read files push out important information; quality often degrades gradually. What works: short, self-contained sessions per task, a written plan before larger changes, and summarising long outputs instead of loading them in full.
For recurring work, saved commands or skills pay off, for example “create a new API route following project conventions”. Through the Model Context Protocol (MCP), an open standard for connecting tools, an agent can also access ticket systems, documentation or error reports. Every such connection also widens the attack surface: content from tickets or web pages can contain hidden instructions (prompt injection). Give agents only the access a task really needs. Eugen Giminger built ContextGuard, his own context-management tool for coding agents, for exactly this problem.
Example: a two-person team prepares its repository
A fictional start-up builds a web app for appointment booking in physiotherapy practices. So far the technical founder used agents ad hoc, with mixed results: sometimes new libraries were installed, sometimes tests were deleted to make them “pass”.
In one afternoon the team writes an AGENTS.md with commands, folder structure and five prohibitions, including “never delete or weaken tests; report the cause instead”. It adds eight tests for booking conflicts and time zones. From then on the agent gets its own branch per task. Over the following weeks the team notices fewer follow-up questions and faster reviews because diffs become smaller and more predictable. It tracks rework in a simple list to judge the effect for itself.
Common mistakes
- A twenty-page context file full of prose that nobody maintains and the agent only partly follows.
- Giving the agent every permission, including deployments and production databases.
- Working without tests and accepting the agent’s “it works” as proof.
- Using one endless session for every task of the day.
Frequently asked questions
Which coding agent is the best?
That changes with every model update. A well-prepared repository matters more than the tool; then you can compare tools on a real task and switch if needed.
Do non-technical founders need a context file at all?
Especially them. If you cannot read the code yourself, fixed rules and automated checks matter even more, because otherwise errors surface only with customers.
May the agent send our source code to the provider?
Yes, with cloud models this always happens technically. Check the contractual terms on training and retention, exclude secrets such as API keys via configuration, and use business plans with clear data-protection commitments.
Try it yourself
Write a context file of at most one page for your main repository with commands, structure, prohibitions and definition of done. Then let an agent complete a small, real task with it.
Check your result
The agent runs tests and type checks on its own, respects the prohibitions and delivers an understandable summary of its change.