context-pack is a first-pass repository briefing generator for coding agents.
Point it at a repo, get a compact brief with the files, entrypoints, guidance docs, and active changes that matter first. It is built for the first minutes in an unfamiliar codebase, when agents usually waste time reading the wrong files or hauling too much low-signal context into the prompt.
Use it when tree, rg, and git diff are technically available but still leave too much orientation work to the model or the human driving it.
context-pack is currently an alpha CLI. The current release line is 0.5.x.
Coding agents often fail in the same predictable ways on a fresh repository:
- they start with a blind tree walk
- they miss
AGENTS.md,README.md, or repo-specific instructions - they burn prompt budget on low-signal files
- they edit near a symptom instead of at the actual entrypoint
context-pack turns that messy first pass into one small, deliberate briefing so the next question starts from the right files and the right constraints.
In many agent workflows, a fresh thread means paying the repo-orientation cost again.
That is especially visible in tools like Codex, ChatGPT, or Claude when a new session starts on the same project and the model re-reads repo structure, manifests, and random source files before it becomes useful.
context-pack helps reduce that repeated orientation spend by turning the first pass into a compact, reusable briefing instead of a full repo dump.
The generated notes also include an approximate token count so you can quickly judge prompt weight before handing the bundle to a model.
The point is not to maximize context size. The point is to maximize context density.
Too little context and the agent misses the entrypoint, ignores repo rules, or edits the wrong file. Too much context and the signal gets diluted by logs, boilerplate, and low-signal files.
context-pack is designed around that tradeoff:
- keep stable repo guidance visible
- surface active work separately from long-lived project rules
- point at the next files worth retrieving instead of dumping the whole repo
- keep fresh-thread handoff cheap enough to reuse
Those tools are necessary, but they are not a briefing.
treeshows structure, not priorityrgfinds strings, not the best starting pointsgit diffshows changes, not repo guidance or architectural entrypoints- raw CLI output is usually too noisy to paste into a prompt unchanged
context-pack ranks and compresses the useful parts into a small bundle meant for immediate handoff to ChatGPT, Codex, Claude, or another agent.
RAG and indexers are useful when you need broad semantic recall across a large codebase. context-pack solves a different problem:
- no indexing or embedding pipeline
- works directly from the local repository state
- captures current git context, guidance docs, and active changes
- keeps the first-pass output small enough for tight prompt budgets
Use RAG when you need deep retrieval. Use context-pack when you need a fast, deterministic repo brief before deeper work starts.
Files like AGENTS.md, CLAUDE.md, and README.md are high-signal, but they are only part of the picture.
context-pack combines those docs with:
- tool-specific instructions such as
.clio/instructions.md - AI-facing summaries such as
llms.txt - learned repo memory files such as
REPO_MEMORY.mdor.context-pack/memory.md - likely entrypoints
- current branch and changed-file context
- dependency and build signals
- selected excerpts from the files most worth reading next
- language-aware ranking that boosts source and entrypoint signals for the top detected repository languages
- transparent
whyreasons per selected file in both markdown and JSON output
For specialized repositories (formal methods, cryptography, consensus-critical runtimes), see docs/AI_AGENT_GUIDE.md for a stricter agent workflow.
That makes repo instructions more useful because they arrive together with the code context needed to act on them.
Without context-pack:
- the agent scans the tree
- opens a few large files at random
- misses
AGENTS.md - reads local IDE noise or low-signal config
- proposes a change in the wrong module
With context-pack:
- the agent sees
AGENTS.md,README.md, manifests, and entrypoints first - active work is summarized before the model starts exploring
- shared repo config is surfaced while local workspace noise stays out
- the next prompt can ask about the right module, test, or diff immediately
Typical result: less orientation drift, fewer wrong-file edits, and a much smaller first prompt.
- coding agents that need a fast repo briefing
- engineers who want a clean first-pass summary before asking an AI for help
- automation workflows that need compact markdown or JSON context
- fresh-thread workflows where repeated repo orientation burns too many tokens
- full-text semantic search across a large codebase
- long-lived indexing pipelines
- tools meant to replace
rg,git, or your editor
Download a prebuilt binary from GitHub Releases without installing Rust:
curl -LO https://github.com/Rothschildiuk/context-pack/releases/download/v<latest>/context-pack-v<latest>-<target>.tar.gz
tar -xzf context-pack-v<latest>-<target>.tar.gz
./context-pack --versionInstall with Homebrew directly from this repository:
brew tap Rothschildiuk/context-pack https://github.com/Rothschildiuk/context-pack.git
brew install Rothschildiuk/context-pack/context-packInstall directly from GitHub with Cargo:
cargo install --git https://github.com/Rothschildiuk/context-pack.gitOr run it from a local clone:
git clone https://github.com/Rothschildiuk/context-pack.git
cd context-pack
cargo run -- --helpThe simplest way to use context-pack is to think in workflow commands first and flags second.
Quick commands:
context-pack briefcontext-pack changedcontext-pack reviewcontext-pack incidentcontext-pack memory-initcontext-pack memory-refreshcontext-pack json
Generate a full repository brief:
context-pack brief --cwd .Focus only on active work:
context-pack changed --cwd .Use a preset profile:
context-pack review --cwd .Available profiles:
onboarding: default first-pass behaviorreview: changed-only focus with compact output (--no-tree) and a larger file shortlistincident: review-style focus plus a larger output budget for urgent triage
Disable language-aware ranking boosts (deterministic baseline behavior):
context-pack --cwd . --no-language-awareCreate a learned repo memory template:
context-pack --cwd . --init-memoryRegenerate the learned repo memory draft from the current repository state:
context-pack --cwd . --refresh-memoryGenerated .context-pack/memory.md files now record created_at_* and refreshed_at_* metadata. When repo memory is older than 7 days and git activity continued, context-pack warns that the memory may be stale.
Generate machine-friendly JSON:
context-pack --cwd . --format jsonGenerate hierarchical Viking JSON (L0/L1/L2) for OpenViking-style integrations:
context-pack --cwd . --format vikingSchema details and tier descriptions live in docs/schema/Viking.md.
Future layered-output direction is documented in docs/schema/LayeredContext.md.
Generate a tighter bundle and check the approximate token weight in Notes:
context-pack --cwd . --changed-only --no-treeCheck the installed program version:
context-pack --versionunknown flag '--profile' or unknown flag '--diff-from':
- you are likely running an older installed binary
- verify with
context-pack --version - update from releases/Homebrew, or run the local source build with:
cargo run -- --cwd .Output does not match expected repository shape:
- try
--no-language-awarefor a deterministic baseline - try
--max-files 20 --max-depth 6for broader context in large/specialized repositories
This repository now includes a root-level Codex plugin scaffold:
The current plugin packages the context-pack skill and a local MCP server surface so Codex can learn and call a consistent repository-briefing workflow:
- run
context-packbefore a manual tree walk - choose
--changed-only,--format json, or tighter budgets based on the task - use
.context-pack/memory.mdwhen repo knowledge needs to persist - call
get_context,get_changed_context,get_file_excerpt,init_memory, andrefresh_memoryover MCP when the plugin is installed
The MCP server runs from the same binary:
context-pack --mcp-serverThis gives the plugin a real tool surface today, while still leaving room for future hook packaging once there is a concrete trigger design to ship.
To validate the plugin locally:
make plugin-checkThat check verifies the plugin metadata, confirms referenced files exist, and smoke-tests the MCP server with initialize, tools/list, and get_context.
Marketplace note: the public plugin format is visible, but a public third-party submission flow was not documented in the official sources I checked. This repository is therefore prepared as a clean plugin source with local validation and publication-ready metadata, even if final catalog submission rules are still evolving.
- a compact first-pass brief instead of a raw file dump
- a context-dense working set instead of maximum raw context
- prioritized files and excerpts instead of an unranked tree walk
- repo instructions, manifests, and entrypoints surfaced together
- learned repo memory surfaced alongside repository-authored docs
- current git context included when it matters
- git changes labeled with compact status codes and short diff hints
- markdown for copy/paste workflows and JSON for automation
- explicit
whyarrays in JSON to explain each selected file score schema_versionin JSON output for stable downstream parsing- MCP tools return versioned
structuredContent(schemaVersion) for stable agent parsing - an approximate token estimate for the generated bundle
context-pack can also surface learned repo knowledge that does not naturally live in the codebase itself yet.
Useful patterns:
AGENTS.mdfor repo instructions.clio/instructions.mdfor tool-specific agent instructionsllms.txtfor AI-facing repo summariesREPO_MEMORY.mdfor accumulated operational knowledge.context-pack/memory.mdfor tool-specific learned notes
To bootstrap the tool-specific file:
context-pack --cwd /path/to/repo --init-memoryOr from the project root:
make init-memoryTo overwrite the generated draft later:
make refresh-memoryTo generate the full local context-artifact set used by agents in this repository:
context-pack context refresh --cwd .
context-pack context check --cwd .The generated file includes explicit creation and refresh timestamps so humans and agents can tell when the memory was last consolidated.
This is especially useful on older repositories where test coverage, logging, or repo docs are too weak to carry the full context on their own.
Longer term, .context-pack/memory.md is best thought of as one layer in a broader memory architecture:
- stable project rules and repo-level facts
- active working-set hints for the current task
- retrieval pointers for the next files worth opening
- short handoff notes that survive fresh threads without replaying the whole chat
The current repository workflow for this direction is documented in docs/PROJECT_CONTEXT_WORKFLOW.md.
- repo type and primary languages
- current git changes and branch context
- compact git change labels such as
A,M, andD, plus short diff hints when available - high-signal files with excerpts
- likely entry points
- Docker and Compose signals
- dependency summaries from common manifests
- shared editor and IDE configs such as
.editorconfig, VS Code tasks, and IntelliJ run configs - a compact tree snapshot
Repository onboarding:
context-pack --cwd /path/to/repoReview the current branch before asking an AI for help:
context-pack --cwd /path/to/repo --changed-onlyStart a fresh Codex or ChatGPT thread on an existing project without paying the full repo-orientation cost again:
context-pack --cwd /path/to/repo --no-treeSave JSON for editor or automation workflows:
context-pack --cwd /path/to/repo --format json --output repo-context.jsonCompare two previously saved brief artifacts:
context-pack --diff-from brief-old.md --diff-to brief-new.mdEstimate whether a compact brief will fit comfortably into a fresh agent thread:
context-pack --cwd /path/to/repo --changed-only --no-tree- Run
context-pack --cwd /path/to/repo --changed-only. - Paste the output into your AI tool.
- Ask a concrete question such as:
Review the active work, explain the likely entry point, and tell me where to change X.
For fresh-thread workflows on the same repo, use the briefing as a compact orientation layer instead of asking the model to rediscover the codebase from scratch.
context-pack is best thought of as the repo briefing layer for coding agents:
- lighter than RAG
- more directed than
tree - more reusable than ad hoc copy/paste from
rgandgit diff - better aligned with prompt budgets than dumping raw repo state
- optimized for context density rather than maximum token usage
make help
make check
make run
make changedcontext-pack now ships with a small promptfoo regression suite for briefing quality.
It runs the CLI against repository fixtures and asserts on the rendered output, so it is useful for catching ranking regressions, missing docs, and low-signal excerpts without calling a model API.
Run it with npx:
PROMPTFOO_CONFIG_DIR=.promptfoo npx promptfoo@latest eval -c promptfooconfig.yamlOr use the Make target:
make eval-promptfooIf you already built the binary and want to skip cargo run inside the eval harness:
PROMPTFOO_CONFIG_DIR=.promptfoo CONTEXT_PACK_BIN=./target/debug/context-pack npx promptfoo@latest eval -c promptfooconfig.yamlThis repository also uses GitHub-native tooling to keep feedback and releases structured:
CHANGELOG.mdfor concise release tracking- issue forms for bugs and feature requests
- GitHub release note categories via
.github/release.yml GITHUB_PLAYBOOK.mdfor suggested Discussions, labels, and release habits
Push a semantic version tag to build release archives automatically:
git push origin v0.4.3The release workflow builds:
- macOS Apple Silicon:
aarch64-apple-darwin - macOS Intel:
x86_64-apple-darwin - Linux Intel:
x86_64-unknown-linux-gnu
Each tagged release publishes:
- compressed binary archives
- per-asset
sha256files - a combined
SHA256SUMS - a generated
context-pack.rbHomebrew formula - release notes tracked in
CHANGELOG.md
After the release is published, GitHub Actions also updates Formula/context-pack.rb on the default branch so Homebrew can install from this same repository without a separate tap repo.
Cargo.tomlis enough for IntelliJ IDEA / RustRover to open this as a Cargo project..idea/andtarget/are ignored by git.- Program version comes from
Cargo.tomland is available viacontext-pack --version. - generated bundles report an approximate token count in
Notes. - Rust is required to build from source, but not required for end users who install from GitHub Releases or Homebrew.