token-efficiencylisted
Install: claude install-skill MohanTn/mohan-dotfiles
# token-efficiency: Audit and optimize token consumption in Copilot CLI configs
Apply evidence-based token-reduction techniques to Copilot CLI agent prompts, skill files, and hook injection scripts. Identify waste without sacrificing clarity or functionality.
## Scope
This skill targets:
- Agent prompt files (`copilot/agents/*.agent.md`)
- Skill files (`copilot/skills/<x>/SKILL.md`)
- Hook scripts that inject context into every turn or session (`copilot/hooks/scripts/*.sh`)
- Config JSON files loaded at startup (not injected into model context)
**Out of scope:** Code logic, test content, runtime behavior. Only text that enters the model's context window.
## Decision tree: Is this optimization safe?
### Safe to cut (high confidence)
1. **Redundant block repeats within a single file** — same prose/examples appearing twice in the same prompt.
- Example: "JSON Output Format" section followed by a worked example with the same schema block.
- Fix: keep one canonical version, point to it from the other location.
- Risk: none if the pointer is clear.
2. **Verbose preamble/explanation** — conversational narrative that restates requirements already stated more concisely elsewhere.
- Example: "This command generates feature-specific architecture... which merges into a pre-built HTML template. This two-stage approach..." (narrative) vs. "Generate feature architecture as structured JSON (injected into HTML template by a deterministic script)." (directive).
- Fix: st