Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/KevinZai/commandernpx agentmods add skills/kevinzai/commander/ccc-knowledgeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/kevinzai/commander/ccc-knowledge)<a href="https://agentmods.dev/skills/kevinzai/commander/ccc-knowledge"><img src="https://agentmods.dev/badge/skills/kevinzai/commander/ccc-knowledge/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/kevinzai/commander/ccc-knowledge"><img src="https://agentmods.dev/badge/skills/kevinzai/commander/ccc-knowledge.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00057 | $0.02544 |
| Opus 5.5 | $0.00023 | $0.01018 |
| Sonnet 5.5 | $0.00011 | $0.00509 |
| Haiku 4.5 | $0.00006 | $0.00254 |
Grade A, and why
ccc-knowledge scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 191 lines — stays where its author put it; the contents beside it link to each section on GitHub.
$ccc-knowledge — search what we learned
CC Commander · $ccc-knowledge · past lessons from ~/.claude/commander/knowledge/, searchable in one step.
Placeholders like ~~knowledge base refer to connected tools. See CONNECTORS.md.
When to use / when not to
- Use to recall lessons before a similar task, review outcomes by category, or record a lesson by hand.
- Use
$ccc-recallto search past session transcripts, and$ccc-memoryfor project memory inCLAUDE.mdandmemory/. This skill reads only the Commander knowledge directory.
What the directory holds
| File | Written by | Used here |
|---|---|---|
kl-<epoch-ms>.json |
the CC Commander CLI (commander/knowledge.js) after a dispatched task, or "Add a lesson" below |
lessons: timestamp, task, outcome, category, keywords, patterns.{techStack, successPatterns, errorPatterns} |
session-*.json |
the plugin SessionEnd hook | session stubs (sessionId, startedAt, endedAt); counted, not shown as lessons |
auto-captures.jsonl |
the knowledge-capture PostToolUse hook | one line per Write/Edit (timestamp, tool, file); counted in stats |
The directory can hold thousands of files, so never glob it with ls *.json (the shell fails with "argument list too long"). Every read goes through the query command in step 1.
What happens
1. Run the query command
All modes use this one command. Replace MODE with recent, search, category or stats, and ARG with the count, topic or category name (quote topics).
node -e '
const fs=require("fs"),path=require("path"),os=require("os");
const dir=path.join(os.homedir(),".claude","commander","knowledge");
const [mode="recent",arg=""]=process.argv.slice(1);
let names=[];try{names=fs.readdirSync(dir)}catch{console.log("EMPTY dir-missing");process.exit(0)}
const L=[];for(const f of names){if(!f.endsWith(".json")||f.startsWith("session-"))continue;
try{const l=JSON.parse(fs.readFileSync(path.join(dir,f),"utf8"));if(l&&l.timestamp)L.push(Object.assign({file:f},l))}catch{}}
L.sort((a,b)=>String(b.timestamp).localeCompare(String(a.timestamp)));
const sessions=names.filter(f=>f.startsWith("session-")).length;
let captures=0;try{captures=fs.readFileSync(path.join(dir,"auto-captures.jsonl"),"utf8").split("\n").filter(Boolean).length}catch{}
if(mode==="stats"){const by=k=>L.reduce((m,l)=>{const v=l[k]||"unknown";m[v]=(m[v]||0)+1;return m},{});
console.log(JSON.stringify({lessons:L.length,outcome:by("outcome"),category:by("category"),sessions,captures}));process.exit(0)}
if(!L.length){console.log("EMPTY lessons=0 sessions="+sessions+" captures="+captures);process.exit(0)}
const q=String(arg).toLowerCase();
const hits=mode==="search"?L.filter(l=>JSON.stringify(l).toLowerCase().includes(q))
:mode==="category"?L.filter(l=>(l.category||"general")===q):L;
const n=mode==="recent"?(Number(arg)||3):10;
const p=l=>l.patterns||{};
for(const l of hits.slice(0,n))console.log(JSON.stringify({date:String(l.timestamp).slice(0,10),category:l.category||"general",
outcome:l.outcome||"unknown",task:String(l.task||l.description||"").slice(0,120),worked:p(l).successPatterns||[],
failed:p(l).errorPatterns||[],stack:p(l).techStack||[],file:l.file}));
if(!hits.length)console.log("NO-MATCH "+mode+" "+q);
' MODE ARG
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago Changed · +46 lines · +17 tokens per session scan B → A b6abd761b9e2
- 1mo ago First seen · 145 lines · 40 tokens per session scan B e640aec4d929
ccc-knowledge is a skill published in the GitHub repository KevinZai/commander (6 stars, last pushed yesterday), licensed MIT. It adds 57 tokens to every session and 2,544 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
context-hygiene
Use when starting a project, reading project documentation or history, or resolving conflicts between documents. For current state, read only the latest documents designated by the project; do not proactively read archives; do not duplicate the spec; use long-term memory only for environment, people, and preferences…
agent-memory-mcp
A hybrid memory system that provides persistent, searchable knowledge management for AI agents (Architecture, Patterns, Decisions).
report
Writes the session final report to a file, then prints only the path and a one-line summary. Fires when the prompt contains "Report per memstack:report", and also when the prompt begins with a standing trigger configured through MEMSTACKREPORTONTASKPROMPTS or MEMSTACKREPORTTRIGGERS. Dormant otherwise.
token-optimization
Use when the user says 'token optimization', 'save tokens', 'context window', 'reduce tokens', 'token stack', or 'TokenStack', or asks about extending context window capacity. Covers TokenStack, the built-in compression proxy that shrinks Claude Code tool output before it reaches the Anthropic API. Do NOT use for…
state
Use when the user says 'update state', 'project state', 'where was I', or at session start to load current context.
magic-compact
Compact this Claude Code session.