About cco-templates
cco-templates is a skill for managing reusable context templates for common task types. It helps Claude users load selected files and patterns, with options to list, create, apply, and delete templates.
Key features
- 01List available templates
- 02Create templates with files and patterns
- 03Suggest files from tracking data
- 04Apply commands, files, and patterns
- 05Delete templates
Use cases
- 01Prepare context for a bug fix
- 02Set up files for a new feature
- 03Load relevant context for a refactor
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ egorfedorov/ claude-context-optimizer --skill cco-templatesAfter installing, type/cco-templatesin Claude Code to confirm it loaded.
Details
From the project READMEContext Templates
Context templates are pre-defined sets of files to read for common task types, saving time and tokens by loading only what's needed.
Templates are stored in ~/.claude-context-optimizer/templates/.
Parse $ARGUMENTS:
list (or no arguments)
Show all available templates: Glob ~/.claude-context-optimizer/templates/*.json.
For each template, show its name, description, and file list.
create <name>
Help the user create a new template. Ask them:
- What type of task is this for? (e.g., "bug-fix", "new-feature", "refactor", "review")
- Which files/patterns should be pre-loaded?
Also suggest files based on historical tracking data:
node ${CLAUDE_PLUGIN_ROOT}/src/tracker.js suggest
Save (the user approves the write) the template as ~/.claude-context-optimizer/templates/<name>.json with format:
{
"name": "template-name",
"description": "What this template is for",
"files": ["relative/path/to/file1", "relative/path/to/file2"],
"patterns": ["**/*.config.*", "src/core/**"],
"preCommands": ["git status", "git log --oneline -5"]
}
apply <name>
Read the template and execute:
- Run any
preCommands - Read the listed files
- Search for the listed patterns using Glob
This gives Claude exactly the right context for the task type.
delete <name>
Delete the template file and confirm.