Many teams, many instruction files, overloaded review. Three layers of supervision, and moving rules from files to hooks.
Research notes. Part 3 of 5. Series: from SDLC to ADLC.
Any company that's built software for long enough has a coding convention. Mine does too. A long document, with a review checklist, naming rules, folder structure, which libraries are allowed and which aren't.
For people, a convention lives on two things: onboarding and review. New joiners read it, seniors remind them, and over time it becomes habit.
When our teams started using agents, I watched both of those wobble at the same time.
Agents don't go through onboarding. Every session starts from zero, except for whatever's in context. And review is overloaded, as part 1 covered: more code coming in, review time growing even faster.
Then something else showed up once I looked across many teams. Each team writes its own instruction file for its agents. Team A writes it carefully, team B writes it in a hurry, team C copies A's and tweaks it. A few months later, the same convention has three interpretations in three repos.
I used to think the fix was writing more clearly. After more reading, I think we're putting rules in the wrong layer.
The paper that made me rethink this is from ESEM 2026, by a group at OST in Switzerland. The title is blunt: when review alone no longer scales.
They interviewed software engineers about how organizations supervise work once AI generates code faster than before. The sample is small, five in-depth interviews inside a broader survey. So I read it as a pointer and hold its conclusions loosely. But the way they split the layers matches what I see.
They describe supervision being spread across several guardrail layers, with no single layer carrying the load alone:
Preventive layer. Architecture and conventions written in advance in a machine-readable form. The agent reads them before working.
Enforcement layer. Linters, tests, CI/CD. Break a rule and you get blocked, whether or not the agent "remembered" it.
Human layer. Reviewers focus on architectural reasoning instead of reading every line.
Bain says the same thing with a different phrase: a "harness" that enforces quality deterministically. Deterministically is the key word. Agents are probabilistic. The fence can't be.
Looking at my own teams, most of the effort went into the preventive layer (writing instruction files), the enforcement layer was thin, and everything landed on the human layer. Meaning on the seniors, who were already overloaded.
In SDLC, engineers build from approved designs plus team knowledge. The team knowledge lives in everyone's heads.
ADLC pulls it out into a file. In Claude Code that's CLAUDE.md. Other tools use AGENTS.md or something similar.
What I'm trying for the many-teams problem: split it into two layers.
# CLAUDE.md (project layer)
Follow the shared conventions at: [path to the shared set]
## Stack
- [language, framework, versions]
## Run
- Test: [command]
- Lint: [command]
## Client specifics
- [constraints unique to this project]
## Don't
- Add a new dependency without asking
- Edit src/auth/ or src/payment/ (needs human approval)
Keep it short. A long CLAUDE.md gets read the way people read terms of service. (Skimmed.)
Some things a team does over and over, always the same way. Adding an API. Writing a migration. Adding a screen to the client's UI standard.
Instead of explaining it every time, package it as a skill: a folder with step-by-step instructions, template files, helper scripts. Across many teams, a skill is the neatest way for a standard procedure to travel from one team to another without someone going around teaching it.
But a skill is still the preventive layer. Still a reminder, just a structured one.
A hook is a script that runs automatically at a fixed moment: before the agent edits a file, before a commit. It doesn't need the agent's agreement. It runs, and if it says no, the work stops.
Hook 1: block edits to sensitive areas. In Claude Code, declare it in .claude/settings.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{ "type": "command", "command": "./scripts/guard-paths.sh" }
]
}
]
}
}
#!/bin/bash
# scripts/guard-paths.sh
f=$(jq -r '.tool_input.file_path // empty')
case "$f" in
*src/auth/*|*src/payment/*)
echo "Don't edit $f on your own. This area needs human approval. Stop and ask." >&2
exit 2 ;;
esac
exit 0
Exit code 2 blocks the action, and the message goes back to the agent. It knows why it was blocked.
Hook 2: block commits when lint or tests fail. Git has had this forever:
#!/bin/bash
# .git/hooks/pre-commit
npm run lint && npm test || {
echo "Lint or tests failing. Not committing." >&2
exit 1
}
Any team with decent CI already has this second one. What changed is who it stops. It used to stop a rushed developer. Now it stops an agent running when nobody's awake to watch.
The rule I'm trying: a rule broken twice moves from a file to a hook. The first time might be the agent misreading. The second time, the rule is sitting in the wrong layer.
At the organization level, I think hooks belong next to the shared CLAUDE.md layer: owned by a small group, pulled into every repo. I'm only just building this, so nothing to show yet.
Send this part to whoever owns CI/CD or the platform team at your company. Most of this work is theirs.
With solid preventive and enforcement layers, the human layer changes completely.
Seniors read fewer lines. They read the spec, how the agent split the tasks, why it chose approach A over B. Lint already caught the formatting. Tests already caught the behavior. People look at what machines can't see yet: does this direction fit how the system is going to grow?
To be complete: for areas like authentication and payments, I still want someone reading every line. Maybe one day that changes. Not now.
I think back to the company's thick coding convention.
It was written for people, and it did that job well for years. Agents need two things that document doesn't have: a version short enough to read every session, and a fence for when they read it and still get it wrong.
In your process, which rule lives in a document when it should live in a hook?
PS. If your company has solved the many-teams, many-instruction-files problem, I'd really like to hear how. Message me on LinkedIn.
1 to 2 emails a month. Easy to unsubscribe.
1 to 2 emails a month. Easy to unsubscribe.
Comments