Context is an
architecture decision
After a few turns
The real question arrives
inside old noise
Question got harder
Migration judgment now depends on what the context kept, lost and overemphasized.
Next move: measure
Before more analysis, ask what is already occupying the window.
/context moment
The budget is
already spent
Before the agent reads CatalogService, it may already carry thousands of tokens of unused capability.
Context sources
The prompt is only
the visible layer
System prompt
Role, permissions, policies, injected product behavior.
MCP tool contracts
Schemas and descriptions loaded before a tool is ever called.
Files and artifacts
Code, docs, tests, configs, generated reports, and diagrams.
Tool results
Search output, logs, compiler failures, and static-analysis findings.
Memory
Project facts, preferences, summaries, previous decisions.
Agent messages
Plans, assumptions, mistakes, corrections, and user feedback.
Tooling trap
MCP sprawl
becomes context debt
Unused tool contracts spend attention before the first dependency is inspected.
Token budget
Tool contracts have
a context price
Budget context like architecture.
Context Rot
Context Rot hurts
migration judgment
Noise competes with dependencies, invariants, and test signals.
Inspired by Chroma Context Rot research
Auto-compact trigger
The main context
fills up
Attention gets crowded
Useful evidence sits next to old plans, logs and unused tool schemas.
The model still answers
The risk is not silence. The risk is confident synthesis from blurred evidence.
Auto-compact trade-off
A summary is
not the evidence
What improves
The session gets space for fresh code, tests and owner input.
What can vanish
Uncertainty, minority findings and exact references may be compressed away.
Fresh windows
Give noisy work
a fresh window
Return contract
Back comes an
Evidence Contract
Finding
Boundaries, risks and test gaps in one short claim.
References
Files, commands and snippets that support the claim.
Confidence
How strong the evidence is, and what is missing.
Artifact
Architecture Map, Risk Table or Test-Gap Report.
Raw noise stays out. Reviewable evidence comes back.
Bridge
Before orchestration
evidence hygiene
Right evidence. Right time. Reviewable output.
Context hygiene
Clean context
improves decisions
Deduplicate evidence
One fact, one source.
Compact outputs
Findings, severity, references.
Return typed artifacts
Architecture Map, Risk Table, Test-Gap Report.
Operating loop
Context control
is a workflow
Measure
Check budget before long analysis.
Route
Load tools, files and skills only when needed.
Compress
Return artifacts, references and open questions.
The harness exists to make this loop repeatable.
From prompt
to agent harness
Pattern map
Analysis harness
components
Agent
Executes the inspect, reason, act, verify loop.
Harness
Defines permissions, context policy, logging, memory, and review gates.
MCP Gateway
Catalog, isolation and policy for tools; context efficiency depends on how the harness loads them.
Skills
Package reusable procedures for risk assessment, extraction, and verification.
Subagents
Run bounded tasks in fresh context windows.
Hooks
Trigger tests, scans, and owner-review checks around risky actions.
Orchestrator
Orchestrator protects
the main context
Decompose
Architecture, risk, tests, migration path.
Choose context
Select tools, skills, files, and subagents.
Merge artifacts
One recommendation with confidence and gaps.
Skill example
A Skill is
a migration checklist
name: legacy-risk-assessment when: analyzing migration candidates steps: 1. map dependencies 2. identify business invariants 3. score risk and confidence 4. produce review gates outputs: architecture-map.md, risk-table.md, test-gaps.md
The skill carries steps and expected outputs.
Subagent design
Collaboration beats
blind delegation
Delegation
- Good for independent scans
- Risky for planning decisions
- Can guess without user input
Collaboration
- Human-in-the-loop for key calls
- Validated architecture choices
- Main context keeps the decision story
Scaling pattern
Do not load it all
route the work
Legacy codebase
Chunk by decision
No full-codebase dump into the main Context Window.
Aggregation pattern
Parallel agents
keep main context clean
Specialists read deeply
Evidence comes back
Relevant snippets, citations and open questions.
The main context keeps the decision story, not every raw tool result.
CatalogService as
agent workflow
A/B result
Reading code
is not enough
Anti-patterns
Stop making
the prompt bigger
Everything up front
Repo dumps, tool dumps and “just in case” docs crowd the decision.
Instructions as controls
“Be careful” is weaker than tests, scans and owner review.
Summaries without sources
A clean paragraph is not evidence unless it points back to code.