Home / Articles

Why Coding Agents Like Claude Code Need a Governance Layer, Not Better Prompts

A prompt shapes one exchange, not a workflow. How a governance layer of rules, scoped context, authority limits and proof of done make Claude Code dependable.

Publisher: REACTAPP.TOP11 min read2500 words

This article is published in English.

Sources: Your AI Agent Needs a Governance Layer, Not Another Prompt

Sharper prompts do produce better answers. They cut down on misunderstandings, tighten instructions and give a single session a clear direction, and for a while that feels like improving the whole way you work with AI. The feeling fades once agents become part of daily work. You stop asking for one convincing reply to one isolated request. You expect the agent to know the project, respect decisions already made, pick the right procedure, stay within its authority, use the proper tools and leave behind evidence you can check.

A prompt shapes the exchange in front of you. It can't govern everything that surrounds that exchange.

Codex and Claude Code already ship a lot of the useful pieces. What's missing is a complete, portable system that decides which rules apply, which context matters, what a coding agent may do, how work gets routed and what counts as proof. Somebody has to build that layer around the runtime. One name for it is a kernel: a governance layer you own, which carries work from human intent all the way to proof. It has no model inside and executes nothing on its own.

Concretely, such a kernel can begin life as a set of portable, structured Markdown files: rules, protocols, indexes, accepted decisions, project state and memory policies. When written instructions aren't enough, skills, scripts, shortcuts and hooks fill the gap.

Context was only the symptom

The first visible problem is lost context. A fresh session often has no idea about the architecture, the recent changes or the reasoning behind a task, so another audit has to run before useful work resumes. That repetition burns time, tokens and patience.

More context helps, but it leaves the deeper problems untouched. An agent can still follow the wrong procedure, act with more authority than it should, pull in irrelevant material or announce success without evidence.

The obvious fix is to put the missing rules and background into AGENTS.md, CLAUDE.md or a similar bootstrap file. That's sensible and incomplete. Those files genuinely improve onboarding, but expecting them to govern an entire workflow is a mistake. A bootstrap can state stable rules and point toward reliable sources. It can't, on its own, keep project state fresh, pick the right context per task, decide what the agent is permitted to do or check the outcome.

One principle ends up at the center: define what "done" means before execution, then demand evidence at the end.

Removing repetition was never the full goal. AI had moved from an occasional experiment to a daily dependency, and the interesting question was how much value an environment built with ordinary software-design care could extract. AI had arrived through several doors at once, in editors, in Xcode and VS Code, and in agents such as Codex and Claude Code. Each made calling a capable model easier, but easier access did nothing to organize what happened around the call.

On a good day an agent can inspect code, explain an unfamiliar framework, propose an architecture or help ship a feature, and it can feel a lot like pairing with another developer. The more you lean on that, the more the surrounding questions matter. When two sources disagree, which one wins? Which rules apply to this task? May the agent decide, or only recommend? If it says the work is finished, what should you expect to see?

Context answers the first part of that, since it gives the agent relevant knowledge. The rest concerns how the knowledge is used. Governance is a fair word for the whole set: the practical link between intent, trusted knowledge, rules, authority, execution and proof. It stays practical when the consequential parts of a workflow are explicit enough to inspect, correct and reuse.

For an engineer who likes designing systems whose pieces cooperate efficiently, leaving the workflow around agents improvised feels wasteful. It becomes something to design, not a series of chats to babysit. Doing that well means observing your own habits for a long time: what you inspect before touching a project, which patterns you reuse, when you slow down and which checks actually convince you a job is done. The aim is to turn those tacit habits into behavior an agent can follow and a person can audit.

What a bootstrap can and can't do

A developer joining an established project needs more than talent. They have to learn how the code is organized, which decisions are settled, what changed lately and where the boundaries sit. Without that, even a great hire spends days rediscovering the environment.

Agent sessions suffer a compressed form of the same problem. You explain the architecture, goals, current state and constraints, the agent produces good work, and the next session needs much of that picture rebuilt.

Putting that material in an AGENTS.md or CLAUDE.md file makes onboarding far cheaper. The word bootstrap marks a boundary and isn't a complaint: a good one sets out the minimum operating contract and tells the agent where dependable information lives. Codex documents layered AGENTS.md files whose combined size is capped, and Claude Code suggests short project instructions, with rarely needed procedures pulled out into skills. Both are covered in the vendors' docs: Claude Code memory and Codex AGENTS.md guide. A skill packages a repeatable procedure so it travels between projects, and hooks can force certain behavior every time. Even so, some other piece must decide when each mechanism applies and how its output gets checked.

Problems start when one file is expected to be the entire workspace. It can't stay short and also hold each architectural decision, the current plan, past reports, protocols and task specifics. And if the context window could swallow everything, stuffing it all into every session would bring its own failure: the instructions that matter would compete with outdated or unrelated text. Fixing a bug needs different context than reviewing an architecture. Releasing follows a different path than an early product call, and a quick question shouldn't pay the coordination cost of a big feature.

So a bootstrap should offer a route into the system and shouldn't try to be the system.

From bootstrap to map

In this design the bootstrap holds a small operating contract and then points at separate sources as they become relevant. Accepted decisions stay with the project. Protocols describe recurring kinds of work, skills carry repeatable procedures, shortcuts compress frequent requests and current plans keep the state another session might need.

Nothing intelligent hides inside the kernel. Its value comes from how the files are separated, linked, selected and maintained across sessions and runtimes.

The separation protects meaning, too. An accepted decision governs how a project evolves, a status report describes one moment and a test result records evidence. Throw all three into one undifferentiated memory and an old observation starts to look like a current instruction.

As the setup matures it grows to cover memory policy, task complexity, how much thinking effort and which model to use, shortcuts, continuity between sessions, validation and coordination among several agents. A full inventory would hide the architecture. What matters is that the agent can discover them gradually, as the work demands. Behind the map stand four responsibilities, which don't describe every mechanism but do explain why they belong together.

Some knowledge must outlive the chat

Chat works while the task is moving, but it shouldn't be the official record of a project decision. Accepted architecture, constraints and coding choices belong in governed sources that any later session can read, and ongoing plans need their own resumable state. Keeping durable truth isn't the same as archiving every conversation, because most of it is throwaway scaffolding. Ask instead what should still count as authoritative after the session has ended.

Load what the task needs

An agent needs enough to understand its task, not everything the system has ever stored. A small code change may need the project rules and a few files. A complex feature may also need product intent, architectural decisions, specialist input and a validation plan. The target is minimum sufficient context rather than maximum available context. Continuity means being able to find the right material at the right moment, not hauling the whole history into each task.

Finding something isn't permission

Locating a file, a message or a recommendation doesn't authorize acting on it. The system has to separate information from authority, above all for destructive actions, final validation, publication and anything that touches the world outside the workspace. This layer is less visible than model intelligence, yet it matters whenever a confident mistake costs more than pausing for a decision.

Completion needs proof

Fluent doesn't mean correct, and plausible doesn't mean finished. The kernel therefore asks what must be verified, what evidence should be kept and where the confirmed state is written down. If an agent edits code and reports "done", you've received a claim and nothing more. Verification might mean green tests, a successful build, the behavior seen in the running app and the state recorded. Other fields need different proof, but the rule is the same: the conversation ending doesn't mean the work is over.

An organization as analogy

Picture a company with a building, computers and excellent equipment but no shared way of working. It has capacity, yet it isn't coherent. People still need common knowledge, procedures, decision rights, clear duties and quality checks. The comparison is loose, because an agent isn't an employee and a runtime does more than seat people at desks. It does show how the parts relate: agents take bounded roles, tools are the equipment and the runtime is the place where things get executed. The kernel is the shared layer of rules, knowledge, methods and checks that lets them cooperate. Better models don't automatically make a better system.

Where the layer sits

The kernel doesn't compete with Codex, Claude Code, Gemini or whatever runtime arrives next. Those provide the live environment: models, tools, sessions, reasoning settings and a growing set of their own subagents, hooks and skills. The governance layer works around that environment and settles three things, namely what should persist, what the agent is allowed to do and what evidence counts as done.

The split gets more valuable each time a runtime ships a feature resembling something already built by hand. Rebuilding every runtime capability would eat time better spent on the projects the agents serve. Letting runtimes handle execution while the governance layer stays portable is the more sustainable route. Providers do differ in models, tools, interfaces and output style, and portability keeps your rules independent of any one of them without pretending those differences have vanished.

Governance doesn't buy certainty

Writing a rule down doesn't guarantee that an agent reads it, understands it or applies it at the right time. A bootstrap can point to the right protocol and still be ignored. A canonical decision can be preserved perfectly while its content quietly goes stale. A hook can enforce a rule faithfully long after the rule stopped being useful.

Experience shows it fast. Rules added for worktrees and hooks begin to overlap, clash and block the tasks they were supposed to protect, so they have to be simplified and fixed. Governance needs upkeep, and the costs don't stop there: interfaces and indexes use time and tokens and can still miss the latest state, agents skip instructions as the system grows, and trust is hard to rebuild after a workflow claims success without the expected proof.

A system like this is never finished or universal. It's a personal setup that gets tested, broken and corrected over months. It improves your ability to watch and adjust agent behavior, yet no rule, protocol, shortcut or memory mechanism is followed perfectly. Governance can make behavior easier to inspect and fix, but it can't make a probabilistic agent deterministic.

Three questions to ask first

Context loss is what starts people down this road. What keeps them there is a bigger engineering question: how should the path around a capable model be designed, with the same attention given to any other important architecture?

So can you prove the work is finished? Only when "done" was defined ahead of execution and the result leaves evidence that fits the task. Without that, what you hold is a claim, and a claim isn't proof.

You don't need a system like this one to start thinking this way. Before adding another prompt or file, ask:

  1. Which sources are allowed to define what's true?
  2. Which decisions and actions need human authority?
  3. What evidence will show the work is finished?

Those questions turn separate AI features into parts of a dependable workflow instead of capabilities that merely coexist. Not every small request should drag the whole system along. Controls should scale with consequences: light when risk is low, stricter when a mistake would be expensive. Models supply the capability, and the governed path from intent to proof is what you build around them.