Agentic coding works best when the repo has rails

Agentic coding works best when the repo has rails

4 min read

Agentic coding is less about a model magically becoming a staff engineer and more about giving a capable loop tight boundaries, testable tasks, and enough repo context to recover when it goes wrong.

Agentic coding is moving from parlor trick to work habit, but the useful version is narrower than the pitch.

The Hacker News item here is thin, basically a pointer titled “Agentic coding notes,” so I would not treat it as evidence for any specific performance claim. Still, the phrase itself is a good marker for where builder behavior has shifted. We are no longer just asking a model for a function, a regex, or a code review comment. We are asking it to inspect a repo, make a plan, edit files, run commands, read failures, and try again.

That loop is the product now.

The agent is not a senior engineer

The mistake is treating agentic coding like delegation to a fully formed engineer. It is closer to giving a tireless junior developer a terminal, a short memory, and uneven judgment.

That can still be valuable. A lot of software work is not grand architecture. It is updating call sites after an API change. Adding tests around a bug. Moving a component from one pattern to another. Writing glue code. Chasing a failing type check. Agents are getting useful there because the feedback loop is concrete. Edit. Run. Observe. Patch.

Where they still get mushy is intent. Product constraints. Taste. The reason a weird piece of code exists. The implicit “do not touch this because billing depends on it” knowledge that lives in a Slack thread from 2022.

So the practical question is not “can the agent code?” It can, sometimes well. The question is “can the task be boxed tightly enough that wrong work is cheap to catch?”

a small robot moving through a fenced garden of branching paths toward code-shaped blocks, with some paths ending at wal

Context packaging beats prompt cleverness

Most agentic coding failures I see are not exotic model failures. They are context failures.

The agent does not know the repo’s local rules. It does not know which test command matters. It does not know whether generated files should be edited. It does not know that the frontend uses one validation pattern and the backend uses another. If those rules are only in people’s heads, the agent guesses.

The fix is boring and powerful: package context like infrastructure. Keep a short repo guide. Document build and test commands. Name the risky directories. Explain how to add a feature in the house style. Keep examples close to the code. Make the agent read the failing test before it writes the patch.

This is also where teams should stop obsessing over one perfect prompt. The better setup is a repeatable harness. Clean branch. Narrow task. Known checks. Diff review. Rollback path. The agent becomes part of the development workflow, not a mystical side channel.

Autonomy should scale with test coverage

I would not give the same freedom to every codebase.

In a small library with strong tests, let the agent take bigger swings. In a payments flow with weak coverage, make it propose a plan first and patch one file at a time. In a legacy repo where nobody trusts the tests, use it more like a code archaeologist: ask it to trace paths, summarize dependencies, find similar implementations, and suggest where a change would land.

The autonomy level should follow the quality of the safety net. Not the confidence of the demo.

That is the quiet lesson of agentic coding. The model matters, but the environment matters more. Agents look smart when the repo gives them clear signals. They look reckless when every mistake requires a human to discover it by vibes.

Practitioner’s Take: If you want to try this next week, pick one annoying but bounded task: add tests for a bug, update a deprecated API, or migrate one component pattern. Give the agent a branch, the relevant files, the exact test command, and a stop condition. Review the diff like you would review a junior engineer’s first PR. The catch most teams miss: before buying a bigger tool, write the repo instructions the agent should have had all along.