Context Compression
Value engineering, not size reduction
I designed a structured format for agent-facing context: nine sections, explicit token budgets, and a six-pass compression pipeline from stripping known explanations down to safe truncation order, each pass logged for reproducibility. I exercised it through an MCP server, a CLI prototype, and dozens of hand-converted documents.
decisions, interfaces, and constraints are never trimmed to hit a token budget
Project brief
ShippedProblem
Shorter context is not useful if compression removes the decisions, interfaces, and constraints an agent needs.
Outcome
Converts long-form documentation into a compact, structured format that preserves decisions, interfaces, and constraints for language-model agents. Optimizes for value delivered per token, rather than raw size reduction.
Evidence
- Dual channels and rule layers (July 2025) is the earlier architecture note behind offline distill → attach.
- A protocol-based validation service checks structure and fact presence locally without a model call; a small command-line prototype handles conversion, merging, and section extraction.
- Five additional capabilities and an automated orchestration layer are specified but not implemented; none are presented as shipped.
Key decisions
- Specification: A structural format with required sections, token budgets, and an ordered compression pipeline that never trims decisions, interfaces, or constraints.
- Tooling: A protocol-based validation service checks structure and fact presence locally without a model call; a small command-line prototype handles conversion, merging, and section extraction.
- Applied & research: The format was applied by hand across dozens of internal documents and checked against a survey of twenty external papers on compression and context management.
- Forward roadmap: Five additional capabilities and an automated orchestration layer are specified but not implemented; none are presented as shipped.
The rule
Teams that adopted it anecdotally reported fewer clarification rounds; that is an impression, not a benchmark.
System map
The figures show the methodology's ecosystem of spec, tooling, and research radiating from one core approach.
Four-part structure
Five additional capabilities and an automated orchestration layer are specified but not implemented.
Six ordered passes
Compress for agents, not humans is the methodology write-up.
The step-by-step loop a document moves through from profiling to validation, with failures routed back rather than shipped.
The five stages below are the validation loop a document travels end to end; the six passes described above run inside stage 03, Compress & render.
Applied & research
Dual channels and rule layers is the earlier architecture note.
The format was applied by hand across dozens of internal documents and checked against a survey of twenty external papers on compression and context management.
A protocol-based validation service checks structure and fact presence locally without a model call; a small command-line prototype handles conversion, merging, and section extraction.
Specified, not built
Five additional capabilities and an automated orchestration layer are specified but not implemented; none are presented as shipped.
Ecosystem map label: “specified only, not yet built”
An impression, not a benchmark
The same context-shaping habit shows up next to Modular Orchestration System and Connect Layer Plugin.
Skills
Portfolio graph
Maps how the work here connects. Open the Portfolio graph →
- Professional
- Personal
- Skill
- Writing