[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EZSMC0HT1MHHGWCS78PRH0":3,"skill-same:01M7EZSMC0HT1MHHGWCS78PRH0":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":14,"repositoryHtmlUrl":29,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7EZSMC0HT1MHHGWCS78PRH0","cost-tracking",null,"Track and report Claude Code token usage, spending, and budgets from the local ECC cost-tracker metrics log. Use when the user asks about costs, spending, usage, tokens, budgets, or cost breakdowns by model, session, or date.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fecc\u002Fcost-tracking\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: cost-tracking\ndescription: Track and report Claude Code token usage, spending, and budgets from the local ECC cost-tracker metrics log. Use when the user asks about costs, spending, usage, tokens, budgets, or cost breakdowns by model, session, or date.\nmetadata:\n  origin: community\n---\n\n# Cost Tracking\n\nUse this skill to analyze Claude Code cost and usage history from the metrics log\nthat ECC's `stop:cost-tracker` hook writes.\n\n## Where the data lives\n\nThe tracker appends one JSON object per session-stop to\n`~\u002F.claude\u002Fmetrics\u002Fcosts.jsonl`. Each row is a **cumulative snapshot for that\nsession**, so to total spend you take the **latest row per `session_id`** and\nsum across sessions — summing every row multiply-counts.\n\nECC also maintains internal per-session files under\n`~\u002F.claude\u002Fmetrics\u002Fcost-snapshots\u002F` so runtime hooks can read the current\nsession total without rescanning all history. Treat those files as a\nrebuildable cache; each snapshot stores a byte cursor so only newly appended\nrows are scanned. Stable reads are O(1), while updates are O(new bytes). Stale\nentries are pruned after 30 days or when the directory exceeds 512 sessions.\nCold catch-up work is limited to 16 MiB per hook invocation, and malformed\nunterminated rows larger than 1 MiB are discarded with a resumable cursor.\nReports and exports should continue to use `costs.jsonl`.\n\nRow schema:\n\n| Field | Meaning |\n| --- | --- |\n| `timestamp` | ISO timestamp of the snapshot |\n| `session_id` | Claude Code session identifier |\n| `transcript_path` | Path to the session transcript |\n| `model` | Model used |\n| `input_tokens` \u002F `output_tokens` | Token counts |\n| `cache_write_tokens` \u002F `cache_read_tokens` | Prompt-cache token counts |\n| `estimated_cost_usd` | Precomputed cumulative cost in USD for the session |\n\nPrefer `estimated_cost_usd` over hand-calculating pricing — model and cache\nprices change, and the tracker is the source of truth.\n\n## When to Use\n\n- The user asks \"how much have I spent?\", \"what did this session cost?\", or\n  \"what is my token usage?\"\n- The user mentions budgets, spending limits, overruns, or cost controls.\n- The user wants a cost breakdown by model, session, or date, or a CSV export.\n\n## How It Works\n\nFirst verify the log exists (use `node`, not `sqlite3` — the tracker writes\nJSONL, and `node` is cross-platform):\n\n```bash\nnode -e 'const fs=require(\"fs\"),os=require(\"os\"),p=require(\"path\");const f=p.join(os.homedir(),\".claude\",\"metrics\",\"costs.jsonl\");console.log(fs.existsSync(f)?\"cost log found\":\"cost log not found: \"+f)'\n```\n\nIf the log is missing, do not fabricate usage data. Tell the user that cost\ntracking populates after the first session ends with the `stop:cost-tracker`\nhook enabled.\n\n## Example — summary, by model, last 7 days\n\n```bash\nnode -e '\nconst fs=require(\"fs\"),os=require(\"os\"),path=require(\"path\");\nconst f=path.join(os.homedir(),\".claude\",\"metrics\",\"costs.jsonl\");\nif(!fs.existsSync(f)){console.log(\"cost log not found: \"+f);process.exit(0);}\nconst rows=fs.readFileSync(f,\"utf8\").split(\u002F\\r?\\n\u002F).filter(Boolean).map(l=>{try{return JSON.parse(l)}catch{return null}}).filter(Boolean);\nconst bySession=new Map();\nfor(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);}\nconst latest=[...bySession.values()];\nconst cost=r=>Number(r.estimated_cost_usd)||0, day=r=>String(r.timestamp||\"\").slice(0,10), sum=a=>a.reduce((s,r)=>s+cost(r),0), f4=n=>\"$\"+n.toFixed(4);\nconst today=new Date().toISOString().slice(0,10), yest=new Date(Date.now()-864e5).toISOString().slice(0,10);\nconsole.log(\"today: \"+f4(sum(latest.filter(r=>day(r)===today)))+\" | yesterday: \"+f4(sum(latest.filter(r=>day(r)===yest)))+\" | total: \"+f4(sum(latest))+\" (\"+latest.length+\" sessions)\");\nconst m=new Map();for(const r of latest){const k=r.model||\"(unknown)\";m.set(k,(m.get(k)||0)+cost(r));}\nconsole.log(\"by model:\");[...m.entries()].sort((a,b)=>b[1]-a[1]).forEach(([k,v])=>console.log(\"  \"+f4(v)+\"  \"+k));\n'\n```\n\nFor a session drilldown or CSV export, iterate the same `latest` set (or the raw\nrows for CSV) and print the fields you need.\n\n## Reporting Guidance\n\nWhen presenting cost data, include today's spend vs yesterday, total across all\nsessions, a by-model breakdown, and session count. Format sub-dollar amounts\nwith four decimals, larger amounts with two.\n\n## Anti-Patterns\n\n- Do not sum every row — they are cumulative per session; reduce to the latest\n  row per `session_id` first.\n- Do not estimate costs from raw token counts when `estimated_cost_usd` is present.\n- Do not assume the log exists without checking.\n- Do not hard-code current model pricing in user-facing answers.\n- Do not recommend installing unreviewed hooks or plugins that execute arbitrary code.\n\n## Related\n\n- `\u002Fcost-report` - Command-form report over the same metrics log.\n- `cost-aware-llm-pipeline` - Model-routing and budget-design patterns.\n- `token-budget-advisor` - Context and token-budget planning.\n- `strategic-compact` - Context compaction to reduce repeated token spend.\n","# Cost Tracking\n\nUse this skill to analyze Claude Code cost and usage history from the metrics log\nthat ECC's `stop:cost-tracker` hook writes.\n\n## Where the data lives\n\nThe tracker appends one JSON object per session-stop to\n`~\u002F.claude\u002Fmetrics\u002Fcosts.jsonl`. Each row is a **cumulative snapshot for that\nsession**, so to total spend you take the **latest row per `session_id`** and\nsum across sessions — summing every row multiply-counts.\n\nECC also maintains internal per-session files under\n`~\u002F.claude\u002Fmetrics\u002Fcost-snapshots\u002F` so runtime hooks can read the current\nsession total without rescanning all history. Treat those files as a\nrebuildable cache; each snapshot stores a byte cursor so only newly appended\nrows are scanned. Stable reads are O(1), while updates are O(new bytes). Stale\nentries are pruned after 30 days or when the directory exceeds 512 sessions.\nCold catch-up work is limited to 16 MiB per hook invocation, and malformed\nunterminated rows larger than 1 MiB are discarded with a resumable cursor.\nReports and exports should continue to use `costs.jsonl`.\n\nRow schema:\n\n| Field | Meaning |\n| --- | --- |\n| `timestamp` | ISO timestamp of the snapshot |\n| `session_id` | Claude Code session identifier |\n| `transcript_path` | Path to the session transcript |\n| `model` | Model used |\n| `input_tokens` \u002F `output_tokens` | Token counts |\n| `cache_write_tokens` \u002F `cache_read_tokens` | Prompt-cache token counts |\n| `estimated_cost_usd` | Precomputed cumulative cost in USD for the session |\n\nPrefer `estimated_cost_usd` over hand-calculating pricing — model and cache\nprices change, and the tracker is the source of truth.\n\n## When to Use\n\n- The user asks \"how much have I spent?\", \"what did this session cost?\", or\n  \"what is my token usage?\"\n- The user mentions budgets, spending limits, overruns, or cost controls.\n- The user wants a cost breakdown by model, session, or date, or a CSV export.\n\n## How It Works\n\nFirst verify the log exists (use `node`, not `sqlite3` — the tracker writes\nJSONL, and `node` is cross-platform):\n\n```bash\nnode -e 'const fs=require(\"fs\"),os=require(\"os\"),p=require(\"path\");const f=p.join(os.homedir(),\".claude\",\"metrics\",\"costs.jsonl\");console.log(fs.existsSync(f)?\"cost log found\":\"cost log not found: \"+f)'\n```\n\nIf the log is missing, do not fabricate usage data. Tell the user that cost\ntracking populates after the first session ends with the `stop:cost-tracker`\nhook enabled.\n\n## Example — summary, by model, last 7 days\n\n```bash\nnode -e '\nconst fs=require(\"fs\"),os=require(\"os\"),path=require(\"path\");\nconst f=path.join(os.homedir(),\".claude\",\"metrics\",\"costs.jsonl\");\nif(!fs.existsSync(f)){console.log(\"cost log not found: \"+f);process.exit(0);}\nconst rows=fs.readFileSync(f,\"utf8\").split(\u002F\\r?\\n\u002F).filter(Boolean).map(l=>{try{return JSON.parse(l)}catch{return null}}).filter(Boolean);\nconst bySession=new Map();\nfor(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);}\nconst latest=[...bySession.values()];\nconst cost=r=>Number(r.estimated_cost_usd)||0, day=r=>String(r.timestamp||\"\").slice(0,10), sum=a=>a.reduce((s,r)=>s+cost(r),0), f4=n=>\"$\"+n.toFixed(4);\nconst today=new Date().toISOString().slice(0,10), yest=new Date(Date.now()-864e5).toISOString().slice(0,10);\nconsole.log(\"today: \"+f4(sum(latest.filter(r=>day(r)===today)))+\" | yesterday: \"+f4(sum(latest.filter(r=>day(r)===yest)))+\" | total: \"+f4(sum(latest))+\" (\"+latest.length+\" sessions)\");\nconst m=new Map();for(const r of latest){const k=r.model||\"(unknown)\";m.set(k,(m.get(k)||0)+cost(r));}\nconsole.log(\"by model:\");[...m.entries()].sort((a,b)=>b[1]-a[1]).forEach(([k,v])=>console.log(\"  \"+f4(v)+\"  \"+k));\n'\n```\n\nFor a session drilldown or CSV export, iterate the same `latest` set (or the raw\nrows for CSV) and print the fields you need.\n\n## Reporting Guidance\n\nWhen presenting cost data, include today's spend vs yesterday, total across all\nsessions, a by-model breakdown, and session count. Format sub-dollar amounts\nwith four decimals, larger amounts with two.\n\n## Anti-Patterns\n\n- Do not sum every row — they are cumulative per session; reduce to the latest\n  row per `session_id` first.\n- Do not estimate costs from raw token counts when `estimated_cost_usd` is present.\n- Do not assume the log exists without checking.\n- Do not hard-code current model pricing in user-facing answers.\n- Do not recommend installing unreviewed hooks or plugins that execute arbitrary code.\n\n## Related\n\n- `\u002Fcost-report` - Command-form report over the same metrics log.\n- `cost-aware-llm-pipeline` - Model-routing and budget-design patterns.\n- `token-budget-advisor` - Context and token-budget planning.\n- `strategic-compact` - Context compaction to reduce repeated token spend.\n",{"name":5,"metadata":24,"description":7},{"origin":25},"community","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fecc\u002Fcost-tracking","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill cost-tracking",{"tool":38,"command":39},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill cost-tracking",{"tool":41,"command":42},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill cost-tracking","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fecc\u002Fcost-tracking\u002FSKILL.md",true,[],[47,54,61,68,75,82],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]