/cco-pack
Build an optimal context pack for the user's task — ranked file list with offset/limit suggestions, based on git state, mentioned paths, and historical patterns
$ npx -y skills add egorfedorov/claude-context-optimizer --skill cco-pack --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/cco-pack
Context preview
The summary Claude sees to decide when to auto-load this skill.
Build an optimal context pack for the user's task — ranked file list with offset/limit suggestions, based on git state, mentioned paths, and historical patterns
SKILL.md
cco-pack.SKILL.mdname: cco-pack
description: Build an optimal context pack for the user's task — ranked file list with offset/limit suggestions, based on git state, mentioned paths, and historical patterns
license: MIT
allowed-tools: [Bash, Read]
Smart Context Pack
When the user runs `/cco-pack` or asks "what files do I need for X", build a curated, token-budget-aware list of files to load instead of guessing or reading the whole repo.
How to use
node ${CLAUDE_PLUGIN_ROOT}/src/smart-pack.js "the task description"Or for the current git state without a description:
node ${CLAUDE_PLUGIN_ROOT}/src/smart-pack.jsOr to feed it back into automation as JSON:
node ${CLAUDE_PLUGIN_ROOT}/src/smart-pack.js --json "..."How it ranks files
Priority order: 1. **Mentioned in prompt** — explicit file paths or recognisable names → relevance 100 2. **Modified in git working tree** → 85 3. **Historically useful** in this project (high confidence, edited often) → up to 70 4. **Keyword match** against the task → up to 70
For each file the pack also suggests `offset` / `limit` — pointing at the structurally relevant section based on file landmarks (function/class declarations near task keywords).
Token budget awareness
Pack stops adding files once it would exceed 25% of the user's effective context budget. The budget itself respects the configured model (e.g. the full 1M window for `opus-4.8` — 1M is standard on Opus, no premium tier).
Presentation
After running, present the list to the user and offer to:
- Read the top N files with the suggested offset/limit
- Save the set as a template (`/cco-templates create <name>`)
- Drop low-relevance items if they want a tighter pack
Read more
name: cco-pack description: Build an optimal context pack for the user's task — ranked file list with offset/limit suggestions, based on git state, mentioned paths, and historical patterns license: MIT allowed-tools: [Bash, Read]
Smart Context Pack
When the user runs `/cco-pack` or asks "what files do I need for X", build a curated, token-budget-aware list of files to load instead of guessing or reading the whole repo.
How to use
node ${CLAUDE_PLUGIN_ROOT}/src/smart-pack.js "the task description"Or for the current git state without a description:
node ${CLAUDE_PLUGIN_ROOT}/src/smart-pack.jsOr to feed it back into automation as JSON:
node ${CLAUDE_PLUGIN_ROOT}/src/smart-pack.js --json "..."How it ranks files
Priority order: 1. **Mentioned in prompt** — explicit file paths or recognisable names → relevance 100 2. **Modified in git working tree** → 85 3. **Historically useful** in this project (high confidence, edited often) → up to 70 4. **Keyword match** against the task → up to 70
For each file the pack also suggests `offset` / `limit` — pointing at the structurally relevant section based on file landmarks (function/class declarations near task keywords).
Token budget awareness
Pack stops adding files once it would exceed 25% of the user's effective context budget. The budget itself respects the configured model (e.g. the full 1M window for `opus-4.8` — 1M is standard on Opus, no premium tier).
Presentation
After running, present the list to the user and offer to:
- Read the top N files with the suggested offset/limit
- Save the set as a template (`/cco-templates create <name>`)
- Drop low-relevance items if they want a tighter pack
Claude Code plugin that tracks token usage, identifies wasted context, and saves 30-50% on API costs. Heatmaps, ROI reports, budget alerts, efficiency scores, git-aware suggestions — all local, zero config.
Repo: egorfedorov/claude-context-optimizer
Other skills on claude-context-optimizer.
- /cco-anatomy
Generate a compact project map so Claude understands the codebase without opening every file
Open skill - /cco-budget
Configure token budget limits, auto-compact settings, and view current budget status (model-aware — Opus 4.8 default, full 1M context at standard price)
Open skill - /cco-claudemd
Analyze CLAUDE.md files for token bloat and suggest optimizations
Open skill - /cco-clean
Clean up old tracking data and reset statistics
Open skill - /cco-coach
Analyze the user's last prompt for clarity, scope and specificity — give a quality score and concrete suggestions to make the next prompt produce better results
Open skill - /cco-digest
Show weekly/daily efficiency digest with score and trends
Open skill

