ccm: Instructions file for Claude Code

CLAUDE.md

ccm CLAUDE.md is an instructions file for Claude Code from dr5hn/ccm. It costs 3,531 tokens per session, scanned B, original, MIT.

Repository instructions for CCM, a Bash command-line toolkit that manages Claude Code accounts, sessions, environments, and health checks.

In plain words
What is it for?
Use them when changing CCM, releasing a version, checking its health, or inspecting its statusline and web pages.
Why use it?
They give the coding agent the project’s structure, commands, and manual checks to run after changes, despite there being no automated test suite or build system.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

This is dr5hn/ccm's own configuration. It tells Claude Code how to work on ccm itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ccm configures →

Reuse

Borrowing it

Nothing to install: this file belongs to dr5hn/ccm. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/dr5hn/ccm/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/dr5hn/ccm

Made for: Claude Code.

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 ccm CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/dr5hn/ccm/claude-md/github.svg)](https://agentmods.dev/instructions/dr5hn/ccm/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/dr5hn/ccm/claude-md"><img src="https://agentmods.dev/badge/instructions/dr5hn/ccm/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ccm CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/dr5hn/ccm/claude-md"><img src="https://agentmods.dev/badge/instructions/dr5hn/ccm/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,531 This file is loaded in full into every session.
When invoked 3,531 The same file — it is already loaded in full.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.03531 $0.03531
Opus 5.5 $0.01412 $0.01412
Sonnet 5.5 $0.00706 $0.00706
Haiku 4.5 $0.00353 $0.00353

Measured 2mo ago against content hash bf5f8051f9df, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

ccm CLAUDE.md scanned grade B with 2 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 2mo 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- **`write_json` applies chmod 600** — fine for credentials/sequence.json but wrong for settings.json. When writing settings.json, preserve original permissions with `stat` + `chmod`

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Dependencies: bash 4.4+, jq, curl (checked at startup via `check_dependencies()`)
CLAUDE.md · 182 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

CCM (Claude Code Manager) is a Bash CLI toolkit for managing multiple Claude Code accounts, sessions, environments, and health. Single-file architecture (ccm.sh, ~6600 lines) with a static landing page (index.html), a statusline visual guide (statusline.html), and a standalone statusline installer (statusline.sh).

Commands

# Release (bumps version in ccm.sh + CHANGELOG.md, commits, pushes, creates GitHub release)
./release.sh patch|minor|major|X.Y.Z [--dry-run]

# Test locally after changes
bash ccm.sh version
bash ccm.sh doctor
bash ccm.sh help
bash ccm.sh permissions audit
bash ccm.sh clean tmp --days 365   # should find nothing
bash ccm.sh usage history --days 1
bash ccm.sh profiles list
bash ccm.sh watch status
bash ccm.sh recover
bash ccm.sh session archives

# Landing page — open index.html directly in browser, no build step
# Statusline guide — open statusline.html directly in browser

There is no test suite, linter, or build system. Validate changes by running commands manually.

Architecture

ccm.sh — Single-file modular Bash script

The script follows a strict top-to-bottom section layout:

  1. Constants & Utilities (lines 1–550) — CCM_VERSION, color init, platform detection (detect_platform() → macos/wsl/linux), JSON helpers, validation functions, write_json() (atomic: temp file → validate → mv)
  2. Credential Management (lines 261–370) — macOS uses Keychain, Linux/WSL uses file-based storage with atomic writes (temp + mv). read_credentials()/write_credentials() are platform-dispatched
  3. Sequence & Cache (lines 370–550) — sequence.json is the account registry (schema v3.1, auto-migrates from v1/v2/v3). resolve_account_identifier() matches by number, email, or alias. Bindings stored in sequence.json under "bindings" key
  4. Session Management (lines 550–1160) — session list|info|search|relocate|clean|archive|restore|archives. Path encoding: / → - for directory names under ~/.claude/projects/
  5. Account Management (lines 1160–2800) — Switching (checks project bindings first, supports --isolated [--quiet] for CLAUDE_CONFIG_DIR profiles), reordering (two-pass credential rename with pre-validated JSON), bind/unbind, shell hook (ccm hook [--isolated]), export/import
  6. Help System (lines 2900–3463) — Topic-based help with show_help(), covers all modules including profiles, watch, recover, setup, codex
  7. Environment Snapshots & Audit (lines 3464–3875) — capture/restore settings.json, MCP config, CLAUDE.md (strips tokens on save)
  8. Usage Statistics (lines 3876–4467) — usage summary|top|history|sessions|compare
  9. Doctor Module (lines 4468–4873) — 14 health checks (the Codex check is informational and never counts toward the issue total)
  10. Clean Module (lines 4874–5466) — 9 targeted cleanup commands plus clean all
  11. Profiles Module (lines 5467–5680) — switch_isolated [--quiet] creates CLAUDE_CONFIG_DIR profiles (quiet mode prints only the path for hook use), cmd_profiles routes list/sync/delete
  12. Watch Module (lines 5681–5884) — cmd_watch routes start/stop/status, background polling of rate-limits.json; watch status also reports Codex when installed
  13. Usage Dashboard Module (lines 5885–6102) — usage_dashboard with per-account token attribution, format_token_count helper
  14. Session Archive Module (lines 6103–6322) — session_archive compresses old JSONL to tar.gz, session_restore (validates the name and extracts with -C), session_archives_list
  15. Setup Module (lines 6323–6474) — cmd_setup interactive first-run wizard (6 steps)
  16. Recover Module (lines 6475–6604) — cmd_recover checks credential consistency (5 checks, including malformed project bindings)
  17. Statusline Module (lines 6605–6931) — statusline install|remove generates a bash script that reads Claude Code session JSON via stdin, writes rate-limits.json for the watcher
  18. Codex Module (lines 6932–7096) — codex_latest_rollout(), codex_read_limits(), format_epoch(), codex_status(), cmd_codex routes status. Read-only bridge parsing Codex CLI session rollout JSONL for rate limits and token usage; writes codex-limits.json. Never writes to ~/.codex.
  19. Init Module (lines 7097–7293) — init auto-generates .claudeignore by detecting project type from manifest files
  20. Permissions Module (lines 7294–7443) — permissions audit [--fix] scans settings.json for duplicate/contradictory/dead rules
  21. Main Entry (lines 7444–7520) — --no-color parsing, dependency checks, case-based command dispatch with deprecation notices for removed commands

Read the full file on GitHub · 182 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. 2mo ago First seen · 182 lines · 3,531 tokens per session scan B bf5f8051f9df

Subscribe to this mod's changes

ccm CLAUDE.md is an instructions file published in the GitHub repository dr5hn/ccm (30 stars, last pushed 2mo ago), licensed MIT. It adds 3,531 tokens to every session, about $0.0141 per session on Opus 5.5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,715 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,461 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,750 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens