context-pack
v0.1.3
Published
Task-specific context bundle generator for Claude Code / Codex
Readme
context-pack
Prepare an optimal, task-specific context bundle from a repository for Claude Code and OpenAI Codex.
Install
npm install -g context-packQuickstart
Global install:
npm install -g context-pack
context-pack bundle --task "Add Reddit OAuth + ingest pipeline" --budget 14000npx:
npx -y context-pack bundle --task "Add Reddit OAuth + ingest pipeline" --budget 14000Output
Generates .context-pack/ in the repo:
bundle.md→ copy/paste friendly context for LLMsbundle.json→ structured representationexplain.md→ why each file was included
Why it exists
LLMs perform poorly when given too many files, irrelevant files, missing entrypoints, or noisy diffs.
context-pack deterministically selects, ranks, and packages the most relevant files within a strict token budget.
How it works (minimal)
Heuristics (v1):
- Git relevance: recently changed, co-changed files
- Semantic relevance: filename/path/symbol matches to task text
- Dependency proximity: import relationships
- Structural importance: entrypoints, config, manifests
- Noise elimination: .gitignore, build outputs, node_modules, tests excluded by default
Token budgeting:
- Estimate tokens per file
- Stop when budget is reached
- Degrade gracefully: full → trimmed → signature-only
Commands
context-pack bundle --task "<task>" [--budget N]context-pack scan --task "<task>"context-pack explain
Examples
context-pack bundle --task "Add Reddit OAuth + ingest pipeline" --budget 1000
context-pack scan --task "Refactor config loader" --limit 25
context-pack explainSee docs/examples/ for sample outputs.
Troubleshooting
- Ensure you ran
npm run buildbefore invoking the CLI fromdist/. - If the bundle is empty, try increasing
--budgetor refining the task description.
How to release
See RELEASE.md for the full checklist.
Docs
- Codex workflows:
docs/codex.md - Claude Code plugin wrapper:
docs/claude-plugin.md - Release checklist:
RELEASE.md
Integrations
- MCP server:
integrations/mcp/README.md - Claude Code:
integrations/claude-code/README.md - Codex workflows:
integrations/codex/README.md
