Agent skill

Cost

by SethGammon in SethGammon/Citadel

Deep cost exploration and transparency. An agent skill from SethGammon/Citadel.

MITAuto-check passedAgent Workflows

Install Cost

skills CLI
$ npx skills add SethGammon/Citadel --skill cost -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install SethGammon/Citadel cost --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/SethGammon/Citadel.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cost .claude/skills/cost && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cost
GitHub stars
922
Token cost
~1.7k tokens
SKILL.md length
552 words
Files
1
Skills in repo
48
Repo updated
First seen
Licence
MIT

At a glance

Deep cost exploration and transparency. An agent skill from SethGammon/Citadel.

  • Works in 4 steps: READ REAL DATA → RENDER BASED ON SCOPE → ADD CONTEXT → …
  • Agent Workflows work in your project
  • SKILL.md covers When to Use, Inputs, Protocol and Fringe Cases, plus 3 more sections
  • Calls node

What it does

Cost is an agent skill from SethGammon/Citadel. 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 /dashboard with focused cost views.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows. The repository describes itself as: The operating layer for Claude Code + OpenAI Codex: persistent project memory, intent routing, safety hooks, cost telemetry, and parallel agent fleets. The licence is MIT.

When your agent uses it

  • Agent Workflows work in your project

Example prompts

  • “/cost”

Requirements

  • Node.js

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. READ REAL DATA
  2. RENDER BASED ON SCOPE
  3. ADD CONTEXT
  4. FRINGE CASES

What it can do on your machine

Read from SKILL.md and the folder at commit e41ff1d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cost loads about 1.7k tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 552 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from SethGammon/Citadel at commit e41ff1d, republished under its MIT licence (© SethGammon). 552 words, ~1,652 tokens.

Download SKILL.mdSave it as .claude/skills/cost/SKILL.md (or your agent's skills folder).
name
cost
description
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 /dashboard with focused cost views.
license
MIT
user-invocable
true
auto-trigger
false
trigger_keywords
cost, costs, cost breakdown, campaign cost, token usage, burn rate, model breakdown
last-updated
2026-03-30

/cost -- Session & Campaign Cost Explorer

When to Use

  • /cost -- current session cost and burn rate
  • /cost today -- today's total spend
  • /cost week -- this week's spend
  • /cost campaign {slug} -- total spend for a specific campaign
  • /cost all -- lifetime cost summary
  • When /do routes "how much", "what's the cost", "spending", "tokens", "burn rate"

Inputs

Optional arguments parsed from user message:

  • today -- filter to today's sessions
  • week -- filter to last 7 days
  • campaign {slug} -- filter to a specific campaign
  • all -- show all-time data
  • No argument -- show current session

Protocol

Step 1: READ REAL DATA

Run the session-tokens.js script to get real token data:

bash
node scripts/session-tokens.js              # current/latest session
node scripts/session-tokens.js --today      # today's sessions
node scripts/session-tokens.js --all        # all sessions (use for week/all/campaign)

Also read:

  • .planning/telemetry/cost-tracker-state.json for live burn rate
  • .planning/telemetry/session-costs.jsonl for campaign attribution
  • scripts/pricing.json to show which pricing is being used

If session-tokens.js is not available or fails, fall back to session-costs.jsonl data and clearly mark output as "(estimated)".

Step 2: RENDER BASED ON SCOPE

Current session (/cost with no args):

=== Session Cost Report ===
Session: {sessionId (first 8 chars)}
Started: {relative time} ({absolute time})
Duration: {minutes} min

Tokens:
  Input:          {N} tokens
  Output:         {N} tokens
  Cache creation: {N} tokens
  Cache read:     {N} tokens
  Total:          {N} tokens

Cost: ${total}
Burn rate: ${rate}/min
Messages: {N} ({N} main + {N} across {N} subagents)

Model breakdown:
  claude-opus-4-6:         {N} messages (${cost}, {pct}% of spend)
  claude-haiku-4-5:        {N} messages (${cost}, {pct}% of spend)

Cache efficiency: {pct}% of input tokens served from cache
  (Higher = more cost-efficient. Cache reads cost 10x less than fresh input.)

Pricing source: scripts/pricing.json (version {version})

Today / Week / All (/cost today, /cost week, /cost all):

=== Cost Report: {Today / This Week / All Time} ===

Summary:
  Sessions: {N}
  Total cost: ${total}
  Subagents spawned: {N}
  Total messages: {N}

Top 5 sessions by cost:
  ${cost}  {duration}min  {agents} agents  {msgs} msgs  {date}
  ${cost}  {duration}min  {agents} agents  {msgs} msgs  {date}
  ...

By campaign (from session-costs.jsonl):
  {slug}: ${cost} across {N} sessions
  _unattached: ${cost} across {N} sessions

Average session: ${avg_cost} | ${avg_rate}/min | {avg_duration} min

For historical charts and billing-window views: npx ccusage

Campaign (/cost campaign {slug}):

=== Campaign Cost: {slug} ===

Total: ${cost} across {N} sessions ({N} agents, {N} min)
Average session: ${avg}

Sessions:
  {date}: ${cost} ({duration} min, {agents} agents, {msgs} msgs)
  {date}: ${cost} ({duration} min, {agents} agents, {msgs} msgs)
  ...
Step 3: ADD CONTEXT

After the cost data, add one of these contextual lines based on the numbers:

  • If burn rate > $2/min: "Burn rate is high. Consider whether subagent-heavy work could be restructured into smaller focused sessions."
  • If cache hit rate < 50%: "Low cache hit rate. Long conversations with many tool results tend to have lower cache efficiency."
  • If no real data available: "Cost data is estimated. Real token data becomes available when sessions complete and Claude Code writes session JSONL files."
  • Otherwise: no extra context needed.
Step 4: FRINGE CASES

If scripts/session-tokens.js does not exist: Fall back to session-costs.jsonl data. Show estimated costs with "(est)" marker.

If no session data exists:

No session data found. Cost tracking requires Claude Code session files
at ~/.claude/projects/. These are created automatically by Claude Code.

If pricing.json is missing or unreadable: Use hardcoded pricing in session-tokens.js. Note: "Using built-in pricing (pricing.json not found)."

If user asks about Pro/Max subscription costs:

Note: Pro/Max subscribers pay a flat monthly fee, not per-token.
The token counts shown here represent your usage volume, not billing.
For rate limit awareness, token throughput matters more than dollar cost.
Show full SKILL.md (253 more words)Show less

Fringe Cases

  • Telemetry directory missing: .planning/telemetry/ does not exist — output: "No telemetry data found. Run any skill first to generate session data, then re-run /cost."
  • Malformed telemetry JSON: a session-*.json file fails to parse — output: "Telemetry file is corrupted. Delete .planning/telemetry/session-*.json and re-run the skill that generated it." Skip the bad file and continue with the rest.
  • 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.
  • 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.

Contextual Gates

Disclosure: "Reading telemetry and session data. No files modified." Reversibility: green — read-only; no files modified Trust gates:

  • Any: full cost report, session data, campaign attribution.

Quality Gates

  • Always show real data when available, estimated when not
  • Always label data source: (real) vs (est)
  • Never claim specific dollar savings from Citadel -- show raw hook facts instead
  • Suggest ccusage for features we don't replicate (charts, billing windows)
  • Round costs to 2 decimal places, tokens to nearest K/M
  • Total output must fit on one screen for current-session view

Exit Protocol

/cost does not produce a HANDOFF block. It is a read-only cost exploration tool. After displaying the report, wait for the next user command.

© SethGammon, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/cost of SethGammon/Citadel.

Open the folder on GitHubat commit e41ff1d

Compare with similar skills

Cost next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cost compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cost this skillSethGammon/Citadel922—~1.7kAutomated safety check: PassMIT
MCP Server Builderanthropics/skills180k64 repos~2.3kAutomated safety check: PassApache-2.0
Hook Development for Claude Code Pluginsanthropics/claude-plugins-official38k11 repos~4.1kAutomated safety check: NotesApache-2.0
Using Superpowersfarm-fe/farm5.6k35 repos~1.4kAutomated safety check: PassMIT
Executing Plans Inlineobra/superpowers296k2 repos~5.1kAutomated safety check: PassMIT
Claude Code Agent Developmentanthropics/claude-plugins-official38k8 repos~2.8kAutomated safety check: PassApache-2.0

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 64 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • Hook Development for Claude Code Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.

    38k GitHub starsUsed in 11 repos~4.1k tokens
    Agent WorkflowsAuto-check: notes
  • Using Superpowers

    farm-fe/farm

    A skill your agent uses when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions

    5.6k GitHub starsUsed in 35 repos~1.4k tokens
    Agent WorkflowsAuto-check passed
  • Executing Plans Inline

    obra/superpowers

    Has the agent carry out an implementation plan itself, task by task in the current session, keeping a ledger, proving each step with a test and ending with one whole-branch review.

    296k GitHub starsUsed in 2 repos~5.1k tokens
    Agent WorkflowsAuto-check passed
  • Claude Code Agent Development

    anthropics/claude-plugins-official

    Official

    Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design.

    38k GitHub starsUsed in 8 repos~2.8k tokens
    Agent WorkflowsAuto-check passed
  • Skill Creator

    Azure/azqr

    Official

    Create new skills, modify and improve existing skills, and measure skill performance.

    795 GitHub starsUsed in 89 repos~8.2k tokens
    Agent WorkflowsAuto-check passed

More from SethGammon/Citadel

All 48 skills in this repo
  • Create Skill

    SethGammon/Citadel

    Creates new skills from the user's repeating patterns. An agent skill from SethGammon/Citadel.

    922 GitHub stars~1.9k tokensUpdated 7 days ago
    Auto-check passed
  • Houseclean

    SethGammon/Citadel

    Cross-drive storage audit and cleanup. An agent skill from SethGammon/Citadel.

    922 GitHub stars~2.2k tokensUpdated 7 days ago
    Auto-check passed
  • Loop

    SethGammon/Citadel

    Bounded foreground repetition for the current session. An agent skill from SethGammon/Citadel.

    922 GitHub stars~1.4k tokensUpdated 7 days ago
    Auto-check passed
  • Triage

    SethGammon/Citadel

    GitHub issue and PR investigator. An agent skill from SethGammon/Citadel.

    922 GitHub stars~2.7k tokensUpdated 7 days ago
    Auto-check passed
  • Watch

    SethGammon/Citadel

    File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills.

    922 GitHub stars~2.9k tokensUpdated 7 days ago
    Auto-check passed
  • Archon

    SethGammon/Citadel

    Autonomous multi-session campaign agent. An agent skill from SethGammon/Citadel.

    922 GitHub stars~5.4k tokensUpdated 7 days ago
    Auto-check passed

Categories

Questions about Cost

What does Cost do?

Deep cost exploration and transparency. An agent skill from SethGammon/Citadel. Cost is an agent skill from SethGammon/Citadel. Deep cost exploration and transparency.

When should I use Cost?

Cost fits situations like: agent Workflows work in your project.

How do I install Cost in Claude Code?

Run `npx skills add SethGammon/Citadel --skill cost -a claude-code`. Or copy the skill folder (skills/cost in SethGammon/Citadel) into .claude/skills/cost in your project. Claude Code loads it when a task matches its description.

How do I install Cost in Codex?

Run `npx skills add SethGammon/Citadel --skill cost -a codex`. Or copy the skill folder (skills/cost in SethGammon/Citadel) into .agents/skills/cost in your project. Codex loads it when a task matches its description.

Can I use Cost in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add SethGammon/Citadel --skill cost -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cost, .gemini/skills/cost, .github/skills/cost and .opencode/skills/cost in your project.

What does Cost need to run?

Going by SKILL.md and its folder, Cost needs the command-line tools its instructions call (node). Our summary lists: Node.js.

Does Cost access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Cost safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cost use?

Cost is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cost use?

About 1.7k tokens (SKILL.md is roughly 6.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cost?

Skills that share tags, products or a category with Cost: MCP Server Builder (anthropics/skills, 180k stars), Hook Development for Claude Code Plugins (anthropics/claude-plugins-official, 38k stars), Using Superpowers (farm-fe/farm, 5.6k stars) and Executing Plans Inline (obra/superpowers, 296k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cost?

SethGammon (a GitHub user) maintains it in SethGammon/Citadel, which has 922 GitHub stars. The repository holds 48 skills in this directory. The repository was last updated on October 1, 2026.

Source: SethGammon/Citadel on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.