Docs · Browse sections

Context Pack

Distilled context for lean prompts.

Context Pack is a distilled bundle of code, graph signals, and memory context tailored to a question. It keeps prompts lean while delivering high-signal context — including intelligent surfacing of lessons, intent detection, and compaction awareness.

What it includes

Three signal layers, one bundle.

01

Code + files

The most relevant files, snippets, and symbols for the question.

02

Graph signals

Dependency and impact context that explains what connects to what.

03

Memory + decisions

Prior decisions, lessons, and preferences related to the query.

Enhanced context

Beyond simple retrieval.

Context Pack understands what you're doing and proactively surfaces what matters.

Intent detection

Semantic classification understands your intent — whether you're debugging, refactoring, or implementing. Context is shaped accordingly.

Lessons surfacing

Past mistakes and critical lessons appear proactively before you repeat them. The system learns from corrections.

Context pressure tracking

Know when your conversation is getting long. Get warnings before context limits affect quality.

Compaction awareness

Pre-compaction snapshots preserve critical state. Session context automatically restores after summarization.

How to use it (MCP)

Ask for a pack when you need code or file context.

Ask your AI tool to call context_smart with mode="pack".

terminal · context_smart
context_smart(
  user_message="What does the auth refresh worker do?",
  format="minified",
  max_tokens=400,
  mode="pack",
  distill=true
)

If Context Pack is disabled, the API falls back to standard context_smart.

Token controls

Bound the payload.

max_tokens

Hard budget for the response payload.

format="minified"

Compact output for assistants.

distill=true

Returns a compact summary when available.

When to use Context Pack

The four scenarios that pay off.

Code explanation

Summarize what a function or module does without pulling the whole file.

Refactor planning

Quickly identify what might break and what depends on it.

Long sessions

Context pressure tracking warns you before hitting limits. Snapshots preserve state through compaction.

Avoiding past mistakes

Lessons from previous sessions surface automatically before you repeat them.

Next steps

Pair it with the rest of the toolkit.