[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GXK42ETR5JA7QBJCK75GA9":3,"skill-same:01M6GXK42ETR5JA7QBJCK75GA9":71},{"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":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":54,"ownerHtmlUrl":55,"ownerBlogUrl":54,"ownerDescription":56,"updatedAt":57,"install":58,"resources":70},"01M6GXK42ETR5JA7QBJCK75GA9","cost",null,"Deep cost exploration and transparency. Shows real token usage, session costs, campaign spend, burn rates, and model breakdown. Reads Claude Code's native session data for exact numbers. Complements \u002Fdashboard with focused cost views.","SethGammon\u002FCitadel","SethGammon","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F5523585?v=4","01M6GXJ90FD2CE9QF5GQERWN06","Seth Gammon","01M6GXJ94VXYGK5KAW14EYE901",931,"MIT","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fcost\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],"token","true","usage","with","native","transparency","false","burn","burn rate","dashboard","deep","exploration","campaign","session","model","data","code","2026-11-10 10:12:30",false,"---\nname: cost\nlicense: MIT\ndescription: >-\n  Deep cost exploration and transparency. Shows real token usage, session costs,\n  campaign spend, burn rates, and model breakdown. Reads Claude Code's native\n  session data for exact numbers. Complements \u002Fdashboard with focused cost views.\nuser-invocable: true\nauto-trigger: false\ntrigger_keywords:\n  - cost\n  - costs\n  - cost breakdown\n  - campaign cost\n  - token usage\n  - burn rate\n  - model breakdown\nlast-updated: 2026-03-30\n---\n\n# \u002Fcost -- Session & Campaign Cost Explorer\n\n## When to Use\n\n- `\u002Fcost` -- current session cost and burn rate\n- `\u002Fcost today` -- today's total spend\n- `\u002Fcost week` -- this week's spend\n- `\u002Fcost campaign {slug}` -- total spend for a specific campaign\n- `\u002Fcost all` -- lifetime cost summary\n- When \u002Fdo routes \"how much\", \"what's the cost\", \"spending\", \"tokens\", \"burn rate\"\n\n## Inputs\n\nOptional arguments parsed from user message:\n- `today` -- filter to today's sessions\n- `week` -- filter to last 7 days\n- `campaign {slug}` -- filter to a specific campaign\n- `all` -- show all-time data\n- No argument -- show current session\n\n## Protocol\n\n### Step 1: READ REAL DATA\n\nRun the session-tokens.js script to get real token data:\n\n```bash\nnode scripts\u002Fsession-tokens.js              # current\u002Flatest session\nnode scripts\u002Fsession-tokens.js --today      # today's sessions\nnode scripts\u002Fsession-tokens.js --all        # all sessions (use for week\u002Fall\u002Fcampaign)\n```\n\nAlso read:\n- `.planning\u002Ftelemetry\u002Fcost-tracker-state.json` for live burn rate\n- `.planning\u002Ftelemetry\u002Fsession-costs.jsonl` for campaign attribution\n- `scripts\u002Fpricing.json` to show which pricing is being used\n\nIf `session-tokens.js` is not available or fails, fall back to session-costs.jsonl\ndata and clearly mark output as \"(estimated)\".\n\n### Step 2: RENDER BASED ON SCOPE\n\n**Current session (`\u002Fcost` with no args):**\n\n```\n=== Session Cost Report ===\nSession: {sessionId (first 8 chars)}\nStarted: {relative time} ({absolute time})\nDuration: {minutes} min\n\nTokens:\n  Input:          {N} tokens\n  Output:         {N} tokens\n  Cache creation: {N} tokens\n  Cache read:     {N} tokens\n  Total:          {N} tokens\n\nCost: ${total}\nBurn rate: ${rate}\u002Fmin\nMessages: {N} ({N} main + {N} across {N} subagents)\n\nModel breakdown:\n  claude-opus-4-6:         {N} messages (${cost}, {pct}% of spend)\n  claude-haiku-4-5:        {N} messages (${cost}, {pct}% of spend)\n\nCache efficiency: {pct}% of input tokens served from cache\n  (Higher = more cost-efficient. Cache reads cost 10x less than fresh input.)\n\nPricing source: scripts\u002Fpricing.json (version {version})\n```\n\n**Today \u002F Week \u002F All (`\u002Fcost today`, `\u002Fcost week`, `\u002Fcost all`):**\n\n```\n=== Cost Report: {Today \u002F This Week \u002F All Time} ===\n\nSummary:\n  Sessions: {N}\n  Total cost: ${total}\n  Subagents spawned: {N}\n  Total messages: {N}\n\nTop 5 sessions by cost:\n  ${cost}  {duration}min  {agents} agents  {msgs} msgs  {date}\n  ${cost}  {duration}min  {agents} agents  {msgs} msgs  {date}\n  ...\n\nBy campaign (from session-costs.jsonl):\n  {slug}: ${cost} across {N} sessions\n  _unattached: ${cost} across {N} sessions\n\nAverage session: ${avg_cost} | ${avg_rate}\u002Fmin | {avg_duration} min\n\nFor historical charts and billing-window views: npx ccusage\n```\n\n**Campaign (`\u002Fcost campaign {slug}`):**\n\n```\n=== Campaign Cost: {slug} ===\n\nTotal: ${cost} across {N} sessions ({N} agents, {N} min)\nAverage session: ${avg}\n\nSessions:\n  {date}: ${cost} ({duration} min, {agents} agents, {msgs} msgs)\n  {date}: ${cost} ({duration} min, {agents} agents, {msgs} msgs)\n  ...\n```\n\n### Step 3: ADD CONTEXT\n\nAfter the cost data, add one of these contextual lines based on the numbers:\n\n- If burn rate > $2\u002Fmin: \"Burn rate is high. Consider whether subagent-heavy work\n  could be restructured into smaller focused sessions.\"\n- If cache hit rate \u003C 50%: \"Low cache hit rate. Long conversations with many tool\n  results tend to have lower cache efficiency.\"\n- If no real data available: \"Cost data is estimated. Real token data becomes\n  available when sessions complete and Claude Code writes session JSONL files.\"\n- Otherwise: no extra context needed.\n\n### Step 4: FRINGE CASES\n\n**If scripts\u002Fsession-tokens.js does not exist:**\nFall back to session-costs.jsonl data. Show estimated costs with \"(est)\" marker.\n\n**If no session data exists:**\n```\nNo session data found. Cost tracking requires Claude Code session files\nat ~\u002F.claude\u002Fprojects\u002F. These are created automatically by Claude Code.\n```\n\n**If pricing.json is missing or unreadable:**\nUse hardcoded pricing in session-tokens.js. Note: \"Using built-in pricing (pricing.json not found).\"\n\n**If user asks about Pro\u002FMax subscription costs:**\n```\nNote: Pro\u002FMax subscribers pay a flat monthly fee, not per-token.\nThe token counts shown here represent your usage volume, not billing.\nFor rate limit awareness, token throughput matters more than dollar cost.\n```\n\n## Fringe Cases\n\n- **Telemetry directory missing**: `.planning\u002Ftelemetry\u002F` does not exist — output: \"No telemetry data found. Run any skill first to generate session data, then re-run \u002Fcost.\"\n- **Malformed telemetry JSON**: a `session-*.json` file fails to parse — output: \"Telemetry file is corrupted. Delete `.planning\u002Ftelemetry\u002Fsession-*.json` and re-run the skill that generated it.\" Skip the bad file and continue with the rest.\n- **MCP cost API returns no data**: Claude Code is not tracking this session — output: \"Session cost unavailable from MCP. Check that Claude Code is running with cost tracking enabled. Showing telemetry file data only.\" Fall back to session-costs.jsonl.\n- **All session files are from a different project**: project paths in the files do not match the current working directory — warn: \"Session files found belong to a different project. You may be in the wrong directory.\" List the project paths found in the session files.\n\n## Contextual Gates\n\n**Disclosure:** \"Reading telemetry and session data. No files modified.\"\n**Reversibility:** green — read-only; no files modified\n**Trust gates:**\n- Any: full cost report, session data, campaign attribution.\n\n## Quality Gates\n\n- Always show real data when available, estimated when not\n- Always label data source: (real) vs (est)\n- Never claim specific dollar savings from Citadel -- show raw hook facts instead\n- Suggest ccusage for features we don't replicate (charts, billing windows)\n- Round costs to 2 decimal places, tokens to nearest K\u002FM\n- Total output must fit on one screen for current-session view\n\n## Exit Protocol\n\n\u002Fcost does not produce a HANDOFF block. It is a read-only cost exploration tool.\nAfter displaying the report, wait for the next user command.\n","# \u002Fcost -- Session & Campaign Cost Explorer\n\n## When to Use\n\n- `\u002Fcost` -- current session cost and burn rate\n- `\u002Fcost today` -- today's total spend\n- `\u002Fcost week` -- this week's spend\n- `\u002Fcost campaign {slug}` -- total spend for a specific campaign\n- `\u002Fcost all` -- lifetime cost summary\n- When \u002Fdo routes \"how much\", \"what's the cost\", \"spending\", \"tokens\", \"burn rate\"\n\n## Inputs\n\nOptional arguments parsed from user message:\n- `today` -- filter to today's sessions\n- `week` -- filter to last 7 days\n- `campaign {slug}` -- filter to a specific campaign\n- `all` -- show all-time data\n- No argument -- show current session\n\n## Protocol\n\n### Step 1: READ REAL DATA\n\nRun the session-tokens.js script to get real token data:\n\n```bash\nnode scripts\u002Fsession-tokens.js              # current\u002Flatest session\nnode scripts\u002Fsession-tokens.js --today      # today's sessions\nnode scripts\u002Fsession-tokens.js --all        # all sessions (use for week\u002Fall\u002Fcampaign)\n```\n\nAlso read:\n- `.planning\u002Ftelemetry\u002Fcost-tracker-state.json` for live burn rate\n- `.planning\u002Ftelemetry\u002Fsession-costs.jsonl` for campaign attribution\n- `scripts\u002Fpricing.json` to show which pricing is being used\n\nIf `session-tokens.js` is not available or fails, fall back to session-costs.jsonl\ndata and clearly mark output as \"(estimated)\".\n\n### Step 2: RENDER BASED ON SCOPE\n\n**Current session (`\u002Fcost` with no args):**\n\n```\n=== Session Cost Report ===\nSession: {sessionId (first 8 chars)}\nStarted: {relative time} ({absolute time})\nDuration: {minutes} min\n\nTokens:\n  Input:          {N} tokens\n  Output:         {N} tokens\n  Cache creation: {N} tokens\n  Cache read:     {N} tokens\n  Total:          {N} tokens\n\nCost: ${total}\nBurn rate: ${rate}\u002Fmin\nMessages: {N} ({N} main + {N} across {N} subagents)\n\nModel breakdown:\n  claude-opus-4-6:         {N} messages (${cost}, {pct}% of spend)\n  claude-haiku-4-5:        {N} messages (${cost}, {pct}% of spend)\n\nCache efficiency: {pct}% of input tokens served from cache\n  (Higher = more cost-efficient. Cache reads cost 10x less than fresh input.)\n\nPricing source: scripts\u002Fpricing.json (version {version})\n```\n\n**Today \u002F Week \u002F All (`\u002Fcost today`, `\u002Fcost week`, `\u002Fcost all`):**\n\n```\n=== Cost Report: {Today \u002F This Week \u002F All Time} ===\n\nSummary:\n  Sessions: {N}\n  Total cost: ${total}\n  Subagents spawned: {N}\n  Total messages: {N}\n\nTop 5 sessions by cost:\n  ${cost}  {duration}min  {agents} agents  {msgs} msgs  {date}\n  ${cost}  {duration}min  {agents} agents  {msgs} msgs  {date}\n  ...\n\nBy campaign (from session-costs.jsonl):\n  {slug}: ${cost} across {N} sessions\n  _unattached: ${cost} across {N} sessions\n\nAverage session: ${avg_cost} | ${avg_rate}\u002Fmin | {avg_duration} min\n\nFor historical charts and billing-window views: npx ccusage\n```\n\n**Campaign (`\u002Fcost campaign {slug}`):**\n\n```\n=== Campaign Cost: {slug} ===\n\nTotal: ${cost} across {N} sessions ({N} agents, {N} min)\nAverage session: ${avg}\n\nSessions:\n  {date}: ${cost} ({duration} min, {agents} agents, {msgs} msgs)\n  {date}: ${cost} ({duration} min, {agents} agents, {msgs} msgs)\n  ...\n```\n\n### Step 3: ADD CONTEXT\n\nAfter the cost data, add one of these contextual lines based on the numbers:\n\n- If burn rate > $2\u002Fmin: \"Burn rate is high. Consider whether subagent-heavy work\n  could be restructured into smaller focused sessions.\"\n- If cache hit rate \u003C 50%: \"Low cache hit rate. Long conversations with many tool\n  results tend to have lower cache efficiency.\"\n- If no real data available: \"Cost data is estimated. Real token data becomes\n  available when sessions complete and Claude Code writes session JSONL files.\"\n- Otherwise: no extra context needed.\n\n### Step 4: FRINGE CASES\n\n**If scripts\u002Fsession-tokens.js does not exist:**\nFall back to session-costs.jsonl data. Show estimated costs with \"(est)\" marker.\n\n**If no session data exists:**\n```\nNo session data found. Cost tracking requires Claude Code session files\nat ~\u002F.claude\u002Fprojects\u002F. These are created automatically by Claude Code.\n```\n\n**If pricing.json is missing or unreadable:**\nUse hardcoded pricing in session-tokens.js. Note: \"Using built-in pricing (pricing.json not found).\"\n\n**If user asks about Pro\u002FMax subscription costs:**\n```\nNote: Pro\u002FMax subscribers pay a flat monthly fee, not per-token.\nThe token counts shown here represent your usage volume, not billing.\nFor rate limit awareness, token throughput matters more than dollar cost.\n```\n\n## Fringe Cases\n\n- **Telemetry directory missing**: `.planning\u002Ftelemetry\u002F` does not exist — output: \"No telemetry data found. Run any skill first to generate session data, then re-run \u002Fcost.\"\n- **Malformed telemetry JSON**: a `session-*.json` file fails to parse — output: \"Telemetry file is corrupted. Delete `.planning\u002Ftelemetry\u002Fsession-*.json` and re-run the skill that generated it.\" Skip the bad file and continue with the rest.\n- **MCP cost API returns no data**: Claude Code is not tracking this session — output: \"Session cost unavailable from MCP. Check that Claude Code is running with cost tracking enabled. Showing telemetry file data only.\" Fall back to session-costs.jsonl.\n- **All session files are from a different project**: project paths in the files do not match the current working directory — warn: \"Session files found belong to a different project. You may be in the wrong directory.\" List the project paths found in the session files.\n\n## Contextual Gates\n\n**Disclosure:** \"Reading telemetry and session data. No files modified.\"\n**Reversibility:** green — read-only; no files modified\n**Trust gates:**\n- Any: full cost report, session data, campaign attribution.\n\n## Quality Gates\n\n- Always show real data when available, estimated when not\n- Always label data source: (real) vs (est)\n- Never claim specific dollar savings from Citadel -- show raw hook facts instead\n- Suggest ccusage for features we don't replicate (charts, billing windows)\n- Round costs to 2 decimal places, tokens to nearest K\u002FM\n- Total output must fit on one screen for current-session view\n\n## Exit Protocol\n\n\u002Fcost does not produce a HANDOFF block. It is a read-only cost exploration tool.\nAfter displaying the report, wait for the next user command.\n",{"name":5,"license":15,"description":7,"auto-trigger":37,"last-updated":41,"user-invocable":42,"trigger_keywords":43},1774828800000,true,[5,44,45,46,47,27,48],"costs","cost breakdown","campaign cost","token usage","model breakdown","main","e1a3d45697a0f323aaedcbea0ab6a0387b5fe722","skills\u002Fcost",84,"https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel","https:\u002F\u002Fsethgammon.github.io\u002FCitadel\u002F","https:\u002F\u002Fgithub.com\u002FSethGammon","Building Citadel, the repo-local operating layer for Claude Code and Codex. Persistent work, routing, verification, and coordinated agent fleets.","2026-11-13 02:05:13",{"source":8,"skillName":5,"commands":59,"prompt":69,"zipAvailable":42},[60,63,66],{"tool":61,"command":62},"npx","npx skills add SethGammon\u002FCitadel --skill cost",{"tool":64,"command":65},"bunx","bunx skills add SethGammon\u002FCitadel --skill cost",{"tool":67,"command":68},"pnpm","pnpm dlx skills add SethGammon\u002FCitadel --skill cost","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fcost\u002FSKILL.md",[],[72,96,119,143,165,184],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":36},"01M6GXSBKE9A2HQWF8QRAZ4WJ5","workspace","Multi-repo campaign coordinator. Same lifecycle as fleet -- scope claims, discovery relay, wave-based execution -- but the unit of work is a repo, not a file. Coordinates campaigns across repositories with shared context.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fworkspace\u002FSKILL.md",[],[74,79,80,81,82,83,31,84,85,86,87,88,89,25,90,91,92,93,94,95],"repos","snowflake","multi-repo","work","context","coordinate","but","across","campaigns","shared","as","scope","add","unit","coordinator","fleet","claims",{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":36},"01M6GXS873AD1Y6RTM6GV47F3E","wiki","Markdown-first knowledge base where the LLM acts as librarian. Ingests raw sources, compiles and interlinks topic files, self-maintains an index. No vector DB or embeddings required -- uses LLM-native navigation over structured markdown up to ~400K words.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fwiki\u002FSKILL.md",[],[98,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,89,25,118,23],"vector","embeddings","librarian","markdown","knowledge","karpathy","knowledge management","karpathy wiki","up","files","maintain","self","knowledge base","project","db","sources",{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":36},"01M6GXS2840SJ61285SZ43EJC3","watch","File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills. Poll-based via git diff against the last scan commit. Writes intake items for batch processing and routes marker actions through \u002Fdo. Use for automatic reactions to file changes; do NOT use for one-off inspection or tasks needing human judgment per file.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fwatch\u002FSKILL.md",[],[121,126,127,128,129,130,131,132,133,134,135,136,112,137,138,139,140,141,25,142],"directory","commit","tasks","git","batch","actions","start","sentinel","diff","auto","stop","do","scan","human","judgment","reactions","processing",{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":149,"publishedAt":36},"01M6GXRXHYJ5RD9RZP81S2VFSW","verify","Self-test the Citadel hook pipeline from within a live session. Exercises real tool calls (Write, Edit, Bash, Read) and checks that hooks fired, telemetry accumulated, and no errors occurred. Reports HOOK HEALTH: PASS or HOOK HEALTH: FAIL with a per-hook breakdown.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fverify\u002FSKILL.md",[],[145,150,151,152,153,154,155,156,157,158,32,159,160,114,161,25,162,163,164,20],"citadel","telemetry","harness","pipeline","Bash","tool","read","write","edit","hooks","reports","live","hook","errors","calls",{"skillNo":166,"name":167,"nameZh":6,"description":168,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":169,"categories":170,"keywords":171,"publishedAt":36},"01M6GXRS9MCJFMQZ917H2XH3AC","unharness","Safely leave Citadel using the active adoption receipt. Produces a no-write, reviewable plan, preserves a portable archive, removes only exact owned material, and reports modified or externally registered surfaces as retained or unknown. Legacy installs must be imported before exact leave is claimed.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Funharness\u002FSKILL.md",[],[167,172,150,152,173,174,175,176,177,111,160,178,179,180,181,182,89,25,183,20],"uninstall","adoption","plan","archive","remove","only","Legacy","surfaces","clean","imported","active","material",{"skillNo":185,"name":186,"nameZh":6,"description":187,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":188,"categories":189,"keywords":190,"publishedAt":36},"01M6GXRMEJ2VHD43R9FNPD4910","triage","GitHub issue and PR investigator. Pulls open issues\u002FPRs, classifies them, searches the codebase for root cause or reviews contributed code, proposes fixes with file:line references, and optionally implements fixes. Use for investigating GitHub issues and reviewing PRs; do NOT use for general code review unrelated to GitHub issues.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Ftriage\u002FSKILL.md",[],[186,191,192,193,194,35,195,196,197,198,199,200,201,202,137,25,203,204,205,20],"code review","review","review pr","pr","github issues","issues","open","use","unrelated","issue","general","references","line","investigator","reviews"]