ECC is a toolkit that organizes and improves how coding agents work through skills, memory, security checks, research practices, and related extensions. It is for developers using agents such as Claude Code, Codex, OpenCode, and Cursor.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/affaan-m/ecc/cost-reportgit clone --depth 1 https://github.com/affaan-m/ECCWrote 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/commands/affaan-m/ecc/cost-report)<a href="https://agentmods.dev/commands/affaan-m/ecc/cost-report"><img src="https://agentmods.dev/badge/commands/affaan-m/ecc/cost-report.svg" alt="Measured on agentmods" 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.00016 | $0.01095 |
| Opus 5 | $0.00008 | $0.00548 |
| Sonnet 5 | $0.00003 | $0.00219 |
| Haiku 4.5 | $0.00002 | $0.00110 |
Grade A, and why
cost-report 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 2d 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 — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Cost Report
Summarize local Claude Code spend by day, model, and session from the metrics
log that ECC's stop:cost-tracker hook writes.
Where the data lives
The tracker appends one JSON object per session-stop to
~/.claude/metrics/costs.jsonl. Each row is a cumulative snapshot for that
session, so the report takes the latest row per session_id and sums
across sessions (summing every row would multiply-count).
Row schema:
{ timestamp, session_id, transcript_path, model, input_tokens, output_tokens, cache_write_tokens, cache_read_tokens, estimated_cost_usd }
What this command does
- Check that
~/.claude/metrics/costs.jsonlexists. If it does not, tell the user the tracker is not set up yet (it populates after the first session ends with thestop:cost-trackerhook enabled). - Reduce rows to the latest snapshot per session and aggregate.
- Present a compact report, or export recent rows as CSV when the argument is
csv.
node is used instead of sqlite3/jq so this works identically on macOS,
Linux, and Windows.
Report
node -e '
const fs=require("fs"),os=require("os"),path=require("path");
const f=path.join(os.homedir(),".claude","metrics","costs.jsonl");
if(!fs.existsSync(f)){console.log("Cost tracker not set up: "+f+" not found. Enable the stop:cost-tracker hook and finish a session first.");process.exit(0);}
const rows=fs.readFileSync(f,"utf8").split(/\r?\n/).filter(Boolean).map(l=>{try{return JSON.parse(l)}catch{return null}}).filter(Boolean);
const bySession=new Map();
for(const r of rows){const k=r.session_id||r.transcript_path||r.timestamp;const p=bySession.get(k);if(!p||String(r.timestamp)>String(p.timestamp))bySession.set(k,r);}
const latest=[...bySession.values()];
const cost=r=>Number(r.estimated_cost_usd)||0;
const day=r=>String(r.timestamp||"").slice(0,10);
const today=new Date().toISOString().slice(0,10);
const d=new Date(Date.now()-864e5).toISOString().slice(0,10);
const sum=a=>a.reduce((s,r)=>s+cost(r),0);
const f4=n=>"$"+n.toFixed(4);
console.log("=== Cost summary ===");
console.log("today: "+f4(sum(latest.filter(r=>day(r)===today))));
console.log("yesterday: "+f4(sum(latest.filter(r=>day(r)===d))));
console.log("total: "+f4(sum(latest))+" ("+latest.length+" sessions)");
const by=(key)=>{const m=new Map();for(const r of latest){const k=key(r)||"(unknown)";m.set(k,(m.get(k)||0)+cost(r));}return [...m.entries()].sort((a,b)=>b[1]-a[1]);};
console.log("\n=== By model ===");for(const [k,v] of by(r=>r.model))console.log(f4(v).padStart(12)+" "+k);
console.log("\n=== Last 7 days ===");
const days=new Map();for(const r of latest){const k=day(r);days.set(k,(days.get(k)||0)+cost(r));}
[...days.entries()].sort((a,b)=>b[0]<a[0]?-1:1).slice(0,7).forEach(([k,v])=>console.log(k+" "+f4(v)));
'
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.
- 2d ago First seen · 82 lines · 16 tokens per session scan A 65ce57cef961
cost-report is a command published in the GitHub repository affaan-m/ECC (249,915 stars, last pushed today), licensed MIT. It adds 16 tokens to every session and 1,095 once invoked, about $0.0001 per session on Opus 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-09-03.
Other commands, from other repositories
llm-verify
Verify a change to Sema's LLM/agent layer (sema-llm) using the two-tier flow that's caught real bugs (see CHANGELOG 1.21.x). $ARGUMENTS names the feature(s) to focus on (e.g. "tool loop", "fallback", "caching", "reasoning-effort"); if empty, cover the agent loop, fallback, cache, and budget.
fill-event-triage
체결(fill) 이벤트, 특히 매도 체결 후 현금 재배치 판단을 read-only 트리아지로 자동 기동해 dry-run 제안을 남긴다. ROB-755.
interessi
Calcola interessi legali o di mora su un importo.
pm-burn
Cost burn-rate — LLM cost over the last N days vs a human-equivalent baseline (savingsx). Flags cost outliers and abnormal-burn agents.
token-report
7-day token cost analysis.
pn-audit-performance-fe
Surgical frontend performance audit — Core Web Vitals, bundle size, image optimization, render-blocking resources, and page-type budgets. Standalone or chained by pn-frontend-audit.