| name | pack-context |
| description | Packs and compresses the codebase into an AI-friendly context file. Best for new features, code reviews, or full codebase context with minimal tokens. |
Pack Context
Pack the current codebase into a compressed, AI-friendly format. Saves 60-90% tokens.
Usage
Full project pack (compressed)
codebase-pilot pack --compress
Only changed files (incremental — fastest)
codebase-pilot pack --compress --affected
Minimum context for a specific file
codebase-pilot pack --compress --prune <target-file>
Preview without writing output
codebase-pilot pack --compress --dry-run
Agent-scoped pack
codebase-pilot pack --compress --agent <agent-name>
Usage Scenarios
- Starting a new coding task — pack first to understand the codebase
- After making changes — use
--affected to see what changed
- Investigating a specific file — use
--prune for minimum context
- Before a code review — pack to see the full picture
Output
- XML format by default (best for AI parsing)
- Markdown format with
--format md
- Copy to clipboard with
--copy
Tips
--affected uses SHA-256 hashing — first run indexes everything, subsequent runs are incremental
--prune traverses the import graph bidirectionally (imports + dependents)
--dry-run shows top 10 files by token count