Context Compiler

Generating .ctx files — the structured summaries your AI reads.

What are .ctx files?

The Context Compiler generates one .ctx file per logical module. These files are structured Markdown documents that describe the module's purpose, public interface, dependencies, design patterns, and known risks.

The MCP server loads these files at query time. Your AI reads them instead of raw source — dramatically reducing token usage.

ctx Sections

bash
## Purpose          ← what the module does
## Public Interface  ← exported symbols with confidence scores
## Dependencies      ← upstream modules this one depends on
## Design Patterns   ← detected patterns (OBSERVER, FACTORY…)
## Known Risks       ← complexity warnings, missing tests, etc.

Recompiling

ctx files regenerate automatically during linear-canal watch. To force a full recompile:

bash
linear-canal watch --recompile
Context Compiler | Linear Canal Docs | Linear Canal