UPDATED IN SEPTEMBER 2026

Code written to be read by agents

Code is written to be read by agents: explicit over implicit, obvious over clever, with the conventions that govern it stated precisely rather than absorbed by osmosis.

L3 · SYSTEMATICWhat this level takes
MUSTNot met, not at this level
  • Coding conventions are written as explicit, agent-parseable rules (not implicit tribal knowledge)
  • Per-team or per-repo rules files exist and are maintained with code review
  • CLI agents (Claude Code, Codex) are the primary coding interface for 50%+ of feature work
SHOULDExpected in practice, not required
  • Agent usage is tracked per developer and per repository
  • Agent instruction files follow a standardized template across the organization
EVIDENCEHow you would check
  • CLI agent session logs or telemetry showing primary usage
  • Rules files in repository with commit history showing regular updates
  • Coding conventions document cross-referenced from agent instruction files
DEPENDS ON
  • Development L2 (Context Engineering) - agent instruction files must exist before rules-per-team layering is meaningful

What It Is

Code is written to be read by agents: explicit over implicit, obvious over clever. This is a claim about the code first and the documentation second. An agent arriving at a function has whatever it can read plus whatever it was told, and nothing else. It did not sit in the design review, it does not know that the third parameter is always a user id by convention, and it cannot ask the person who wrote the decorator what the decorator does. Everything it needs must be either visible at the point of use or written down.

The consequence is that the properties that make code agent-legible are mostly ordinary good practice, applied more strictly than a human-only codebase requires. Explicit types rather than inferred ones at module boundaries. Names that say what the thing is rather than names that are short. Behaviour that follows from the code in front of you rather than from a registration that happened at import time in another file. Dependencies passed in rather than resolved from ambient state. Clever code is not wrong, but it costs an agent more than it costs a human, because a human can afford to be curious and an agent will simply proceed on its best guess.

The same asymmetry applies to the conventions themselves. AI agents do not pick up implicit conventions through osmosis. They do not learn by sitting in code reviews or absorb culture through Slack. They follow instructions, and if the instructions are vague or assumed, the agent will make confident guesses that violate your team's actual intentions.

At L3 (Systematic), teams recognise this asymmetry and respond on both fronts: they write code that reads plainly, and they write down the rules that govern it. "Explicit over implicit" is not a general principle about documentation - it is a specific claim about what agents require. A human reading "use consistent naming" can infer what it means from examples in the codebase. An agent reading it has no idea and will apply generic patterns from its training data.

The transformation is practical: take each implicit convention - things everyone "just knows" - and rewrite it as a precise, example-driven rule. "Use camelCase for variables" becomes "Use camelCase for all variable and function names. Use PascalCase for class names and React component names. Use SCREAMING_SNAKE_CASE for module-level constants. Examples: getUserById, UserProfile, MAX_RETRY_COUNT." The second version is actionable for an AI agent; the first is not.

This work is also valuable independent of AI. Code obvious enough for an agent to modify safely is code a new joiner can modify safely, and conventions precise enough for a model to follow are precise enough for a person to follow. Writing for agents is mostly writing for the least-contexted reader, which every codebase acquires eventually.

Why It Matters

The quality of AI agent output is directly bounded by the quality of explicit conventions. This is the core L3 insight:

  • Eliminates the largest source of agent errors - most agent mistakes at L2 are not model failures; they are ambiguity failures that plainer code and stated conventions solve
  • Cleverness is charged to every future edit - implicit magic, dynamic dispatch and behaviour registered at a distance are read once by their author and re-derived by every agent that touches the file afterwards, at full cost each time
  • Scales tribal knowledge - implicit conventions locked in senior engineers' heads are finally captured in a form that benefits every developer and every AI agent
  • Reduces review friction - when conventions are explicit and the AI follows them, reviewers stop finding style violations and focus on logic and design
  • Makes conventions enforceable - explicit conventions can be referenced in automated checks and lint rules; implicit conventions cannot
  • Directly measures context quality - the rate of agent misfires (convention violations in AI-generated code) is a direct measure of how explicit your conventions are; improving explicitness decreases misfire rate

The counterintuitive insight is that writing for agents benefits humans more than it benefits the agents. It forces teams to surface tacit knowledge that experienced developers accumulated and never wrote down, and it puts a visible price on the clever construct that only its author fully understood - the "everyone knows you don't do it that way" patterns that confuse new joiners and confound agents alike.

TIP

Run an "implicit convention audit" by asking a new team member (or an agent with no instruction file) to implement a small feature from scratch. Every place their implementation differs from what you would have done is an implicit convention to make explicit - and every place they had to read three files to understand one is a piece of code to make plainer.

Getting Started

  1. Find where the code hides its behaviour - Before touching the documentation, list the constructs in your codebase whose effect is not visible where it happens: metaprogramming, import-time registration, implicit dependency resolution, dynamic dispatch on strings, inherited behaviour several levels up. These are the places agents get things confidently wrong, and each is a decision about whether the cleverness is still earning its keep.
  2. Categorise your existing conventions - Separate them into naming, file structure, patterns (how to implement common things), anti-patterns (what not to do), and architectural decisions (why things are structured the way they are). Each category needs a different kind of explicit documentation.
  3. Rewrite for precision - For each convention, add: the rule statement, the rationale (why), a positive example (do this), and a negative example (not this). Four-part structure. The negative example is particularly valuable for AI agents.
  4. Add example-driven rules - AI agents respond especially well to concrete code examples. Replace abstract statements with code snippets: instead of "handle errors consistently," write the pattern with try/catch structure, error type hierarchy, and logging call.
  5. Test against an agent - After rewriting a set of conventions, ask an AI agent to implement a small task that exercises those conventions without showing it the CLAUDE.md first. Then show it the CLAUDE.md and ask again. Compare the two outputs. The difference measures the convention's explicitness value.
  6. Prioritise by misfire frequency - Not all conventions are equally important to make explicit. Start with the ones where AI agents most frequently go wrong. Use code review comments from the last quarter as a source: every "the AI generated X instead of Y" comment is a convention to make explicit.
  7. Review with both humans and agents - Have a senior engineer review the conventions for accuracy and have an AI agent attempt to follow them on a test task. Both perspectives surface different gaps.
TIP

Write your conventions in the imperative voice: "Use X, not Y." Avoid hedged language like "generally prefer" or "typically should." Agents interpret hedging as permission to deviate. If a convention has genuine exceptions, enumerate the exceptions explicitly rather than using hedged language.

Common Pitfalls

Writing conventions for human readers, not agent consumers. Human-oriented documentation tells a story: historical context, tradeoffs, the road not taken. Agent-oriented conventions give rules: do this, not that, here's an example. Both are valuable, but they're different artifacts. Keep them separate. Your engineering handbook is for humans; your CLAUDE.md conventions are for agents.

Assuming the AI will infer from code examples. Some teams write "follow the pattern in src/components/Button.tsx" instead of stating the pattern explicitly. This works for humans who can read the component and extract the pattern. AI agents often fail to extract the correct pattern or apply it incorrectly to different contexts. State the pattern; then reference the example as confirmation.

Documenting the cleverness instead of removing it. When a construct is hard for an agent to follow, the reflex is to write a paragraph explaining it. Sometimes that is right. Often the honest accounting is that the construct saves its author a few lines once and costs every subsequent reader, human or machine, a re-derivation. Prefer the plainer implementation, and keep the explanation for the cases where the cleverness genuinely pays.

Making conventions so prescriptive they become brittle. Explicit doesn't mean exhaustive. A convention that covers every edge case becomes unreadable and unmaintainable. Write the core rule explicitly; acknowledge that edge cases exist and require judgment. The goal is to eliminate the common misfire, not to eliminate all human judgment.

Treating this as a one-time cleanup. Conventions evolve with the codebase. A convention that was correct for your React class component era is wrong now that you've migrated to hooks. Convention maintenance must be an ongoing process tied to significant architectural decisions. Add "update CLAUDE.md conventions" to your definition of done for any PR that changes a major pattern.

How Different Roles See It

BobHEAD OF ENGINEERING

Bob is frustrated that AI-generated code consistently fails code review on the same issues. Reviewers keep leaving comments like "we don't use this pattern," "this library is deprecated," and "this should use the centralized error handler." The same AI mistakes repeat across developers and across weeks.

What Bob should do: These repeating review comments are a diagnostic: they are exactly the implicit conventions that need stating. Bob should create a "convention backlog" - every repeating misfire observed in the last month of code review - and task one developer per team with converting the list into explicit rules in the team's instruction file. That is a two to three day effort per team and should eliminate the repeat comments within a fortnight. Bob should also watch for the subset of the backlog that documentation cannot fix: misfires where the agent read the code correctly and the code was misleading. Those are a signal to change the code rather than to write another rule, and a team that only ever adds rules will accumulate an instruction file that grows faster than its usefulness.

SarahPRODUCTIVITY LEAD

Sarah has been tracking code review cycle time and has noticed that PRs with significant AI involvement take longer to merge than expected - not because the code is functionally wrong, but because it consistently violates style and pattern conventions. Reviewers spend time on style corrections that feel avoidable.

What Sarah should do: This is the explicitness gap in measurable form. Sarah should track "AI convention violation rate" - the percentage of AI-involved PRs that receive at least one convention-related review comment. This metric directly measures how explicit your CLAUDE.md is. Set a target: reduce AI convention violation rate from current baseline to under 10% within 90 days by systematically making conventions explicit. Sarah can show this to stakeholders as "context engineering quality improvement" - a leading indicator that predicts faster review cycles and lower rework cost. The financial story: every convention violation caught in review represents time that could be eliminated by better CLAUDE.md documentation.

VictorSTAFF ENGINEER - AI CHAMPION

Victor has been doing this informally for months. When he notices the AI making the same mistake twice, he immediately adds an explicit rule to CLAUDE.md. His team's AI misfire rate is dramatically lower than other teams, and his code reviews are mostly about logic rather than style.

What Victor should do: Victor should systematize his informal practice into a team process. His proposal: when any developer on the team gets an AI convention misfire in code review, they are responsible for adding an explicit rule to the team's CLAUDE.md before the PR merges. This creates a direct feedback loop: code review surfaces implicit conventions, convention violations trigger explicit documentation, explicit documentation prevents future misfires. Victor should also write a guide for the team on "how to write a good convention rule" - the four-part structure (rule, rationale, positive example, negative example) with examples from the team's actual CLAUDE.md. This institutionalizes his practice without depending on his individual effort.

How This Guide Changed

What each edition changed in this guide, newest first.

  1. V1.6September 2026LATEST

    The claim moved from the documentation to the code. Writing conventions down precisely is context work; what this rung asks is whether the code itself is legible to a reader who did not attend the design review - explicit types at boundaries, behaviour that follows from what is on screen rather than from a registration that happened at import time elsewhere, dependencies passed in rather than resolved from ambient state. Clever code is not wrong, it is charged to every future edit, and an agent pays that charge by guessing.

  2. V1.3June 2026

    A quiet edition here. Anthropic's context engineering write-up had moved to a new address under a longer title and the reference was repointed; the argument that agents follow written instructions rather than absorbing team habits stood untouched.

  3. V1.0March 2026

    The guide opened on an asymmetry the first edition treated as the core L3 insight: humans pick conventions up by osmosis and agents do not, so "use consistent naming" is guidance for one and noise for the other. Its remedy, rewriting every implicit rule as a precise example-bearing one, was pitched as work that pays off twice, since anything specific enough for a model is specific enough for a new joiner.

Where does your team actually sit on this?

This guide describes one level of one area. Run the assessment to place your team across all 16 areas, see which gates you have passed, and get a report you can take to your stakeholders.

Start the assessment