setup

setup is a command for coding agents from WaterTian/cc-hud. It costs 12 tokens per session (814 once invoked), scanned B, original, MIT.

A setup command for configuring cc-hud as the status line shown by Claude Code, with a stable launcher that finds the installed version.

In plain words
What is it for?
It is for installing the launcher in the user’s Claude configuration and updating the settings so cc-hud runs as the status line.
Why use it?
It avoids needing to repeat the setup whenever cc-hud is upgraded and can be safely run again.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the cc-hud plugin — 1 command shipped together

Install

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.

agentmods
npx agentmods add commands/watertian/cc-hud/setup
Clone the repo
git clone --depth 1 https://github.com/WaterTian/cc-hud

Or install cc-hud, the plugin that ships this one along with the rest of its 1 command.

Wrote 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.

agentmods badge for setup

README.md
[![agentmods](https://agentmods.dev/badge/commands/watertian/cc-hud/setup.svg)](https://agentmods.dev/commands/watertian/cc-hud/setup)
Your own site
<a href="https://agentmods.dev/commands/watertian/cc-hud/setup"><img src="https://agentmods.dev/badge/commands/watertian/cc-hud/setup.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 814 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00012 $0.00814
Opus 5 $0.00006 $0.00407
Sonnet 5 $0.00002 $0.00163
Haiku 4.5 $0.00001 $0.00081

Measured 3d ago against content hash d8debad709a0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

setup scanned grade B with 1 finding 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- User settings: `<HOME>/.claude/settings.json`
commands/setup.md · 74 lines

How it starts

The opening of the file, as written. The whole thing — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Configure cc-hud as the Claude Code statusline. Since v0.5.0, cc-hud uses a stable-path launcher so future plugin upgrades do not require re-running this setup — the launcher resolves whichever cc-hud version is currently installed on each tick.

Steps below are idempotent — safe to re-run.

Step 1 — Resolve paths

Resolve the user's home directory:

node -e "console.log(require('os').homedir())"

Call the output HOME. From it derive:

  • Launcher source: ${CLAUDE_PLUGIN_ROOT}/scripts/launcher.cjs
  • Launcher destination (stable path): <HOME>/.claude/bin/cc-hud-launcher.cjs
  • User settings: <HOME>/.claude/settings.json

Step 2 — Install the launcher

Always overwrite (the launcher is a managed file):

  1. mkdir -p <HOME>/.claude/bin
  2. Read ${CLAUDE_PLUGIN_ROOT}/scripts/launcher.cjs verbatim, then Write the exact same content to <HOME>/.claude/bin/cc-hud-launcher.cjs. Do not modify or annotate it.

The launcher reads <HOME>/.claude/plugins/installed_plugins.json on each tick and spawns the latest installed cc-hud's dist/index.js. Its contents stay valid across cc-hud versions, so this file rarely needs rewriting.

Step 3 — Update statusLine in ~/.claude/settings.json

Read <HOME>/.claude/settings.json (treat as {} if missing or unreadable). The target merged config:

{
  "statusLine": {
    "type": "command",
    "command": "node <HOME>/.claude/bin/cc-hud-launcher.cjs",
    "padding": 2
  }
}

Substitute <HOME> with the absolute path — do not leave ~ or ${HOME} in the JSON.

Branch on the current statusLine.command:

  • Missing → merge in the target. Tell user: ✓ statusLine registered (cc-hud launcher).
  • Already points at cc-hud-launcher.cjs → leave untouched. Tell user: ✓ launcher already registered (idempotent skip).
  • Direct cc-hud path (contains cc-hud and dist/index.js — i.e. the old version-pinned form) → overwrite. Tell user: ✓ migrated statusLine from version-pinned path to stable launcher — future cc-hud upgrades no longer need re-running /cc-hud:setup.
  • cc-bot shim (contains cc-bot and statusline.js) → leave untouched. Tell user: ℹ cc-bot's statusline shim already wraps cc-hud automatically — no change needed.
  • Other non-empty value → ask via AskUserQuestion whether to overwrite (default = keep existing). On "keep", skip the write and tell user the launcher is installed at <HOME>/.claude/bin/cc-hud-launcher.cjs for manual wiring.

Read the full file on GitHub · 74 lines

Changes

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.

  1. 3d ago First seen · 74 lines · 12 tokens per session scan B d8debad709a0

Subscribe to this mod's changes

setup is a command published in the GitHub repository WaterTian/cc-hud (8 stars, last pushed 1mo ago), licensed MIT. It adds 12 tokens to every session and 814 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.