Ada → Context Engineering

Context engineering for Claude Code

CLAUDE.md is one layer. A governed context architecture has three. Ada produces all of them from structured intent.


What context engineering is

Context engineering is the systematic design of what goes into an LLM's context window — what information, in what form, at what time.

It is distinct from prompt engineering. Prompt engineering is about how you phrase a single request. Context engineering is about the information architecture that shapes every request — the persistent layer that governs how the model interprets everything.

A 2025 survey covering 1,400+ papers formally established context engineering as a distinct discipline. The finding: the quality and structure of context determines model behavior more reliably than prompt phrasing.

For Claude Code, context engineering is the discipline of deciding what goes in CLAUDE.md, what belongs in agent files, and what gets enforced by hooks — and ensuring each layer encodes the right information at the right granularity.


The three-layer architecture

Research on context architecture for multi-agent coding systems has independently converged on a three-tier structure. Ada implements this architecture:

01

Hot memory — CLAUDE.md

Always in context. Read on every turn.

The top layer. Present on every message turn, every decision, every tool call. Contains the structural facts that must always be true: what the project is, what it is not, architectural decisions, scope boundaries, naming conventions.

Because CLAUDE.md is in context on every turn, it must be dense with signal. It should not contain session notes, task lists, or anything that changes. It is a structural constraint, not a conversation.

02

Domain specialists — agents/

Loaded per bounded context. Domain-deep.

The middle layer. Agent files scoped to bounded contexts — one per domain area. An agent for the auth system knows auth entities, auth constraints, auth state machines. It doesn't need to know about billing.

This solves a core context engineering problem: you cannot put all domain knowledge in CLAUDE.md without diluting the signal. Agents provide depth without polluting the hot layer.

03

Structural enforcement — hooks/

Pre-tool guards. Constraints at every boundary.

The enforcement layer. Pre-tool hook files that run before Claude Code takes any tool action — read, write, bash. They enforce the constraints from your intent at the boundary where decisions are made.

This is the critical layer most developers miss. CLAUDE.md tells Claude Code what to do. Hooks enforce it. Without hooks, constraints are advisory. With hooks, constraints are structural — Claude Code cannot violate them without the hook blocking the action.


Why CLAUDE.md alone is not enough

The instinct when discovering CLAUDE.md is to put everything in it. Project definition, technical decisions, constraints, task list, history — all in one file.

This degrades context quality. Research on context length demonstrates that model performance degrades as context grows — not always linearly, but reliably. A bloated CLAUDE.md buries the signal under noise.

More critically: CLAUDE.md is advisory. It tells Claude Code what you want. It cannot prevent Claude Code from doing otherwise. If a constraint matters, it needs enforcement — not just instruction.

What you put in CLAUDE.md
The actual problem
Better layer
Auth system domain knowledge
Dilutes hot memory; not always relevant
agents/auth.md
"Never use external APIs in X"
Advisory only — not enforced
hooks/no-external-api.sh
Entity definitions for all domains
Too large; competes with constraints
Per-domain agent files
Architecture decisions (all)
Correct layer for this
CLAUDE.md ✓

How Ada implements this architecture

Ada's 7-stage compilation pipeline produces all three layers from structured intent:

The CTX and INT stages extract what goes in the hot layer. The ENT and PER stages extract what goes in domain agent files. The PRO and SYN stages determine what needs hook enforcement. The GOV stage verifies coherence across all three layers before writing to disk.

The result: 247 hook files, 8 agent files, and a CLAUDE.md — all produced from one elicitation session. Each layer dense with the right information for its purpose.

The context architecture Ada produces is not optimized by hand. It is compiled from intent — which means the right information is in the right layer because that's where it belongs structurally, not because you happened to put it there.

See the full Ada pipeline →

$ git clone https://github.com/alexrozex/ada

Three-layer context architecture. Compiled from intent.

Get started →