ccmonitor: Instructions file for Claude Code

CLAUDE.md

ccmonitor CLAUDE.md is an instructions file for Claude Code from tobyilee/ccmonitor. It costs 2,118 tokens per session, scanned A, original, MIT.

A set of project instructions for ccmonitor, a Bun terminal app that watches Claude Code activity and displays sessions, tools, tasks, token use, and changed files. It also documents how to build, run, test, and upgrade the app.

In plain words
What is it for?
Guiding development, builds, manual verification, and upgrades of the ccmonitor project.
Why use it?
It gives coding agents the project context and expected commands, reducing mistakes when changing or checking the application.

Instructions file for Claude Code

Written for Claude Code: PostToolUse hook event. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

This is tobyilee/ccmonitor's own configuration. It tells Claude Code how to work on ccmonitor 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 ccmonitor configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/foo/bar.

Reuse

Borrowing it

Nothing to install: this file belongs to tobyilee/ccmonitor. 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/tobyilee/ccmonitor/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/tobyilee/ccmonitor

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/tobyilee/ccmonitor/claude-md/github.svg)](https://agentmods.dev/instructions/tobyilee/ccmonitor/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/tobyilee/ccmonitor/claude-md"><img src="https://agentmods.dev/badge/instructions/tobyilee/ccmonitor/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 ccmonitor CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/tobyilee/ccmonitor/claude-md"><img src="https://agentmods.dev/badge/instructions/tobyilee/ccmonitor/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,118 This file is loaded in full into every session.
When invoked 2,118 The same file — it is already loaded in full.
Security scan A 0 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.02118 $0.02118
Opus 5.5 $0.00847 $0.00847
Sonnet 5.5 $0.00424 $0.00424
Haiku 4.5 $0.00212 $0.00212

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

Security

Grade A, and why

ccmonitor CLAUDE.md scanned grade A with 0 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 27d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 93 lines

How it starts

The opening of the file, as written. The whole thing — 93 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

ccmonitor — A standalone Bun TUI app that monitors Claude Code session activity in real time. It watches ~/.claude/ data files (JSONL transcripts, subagent metadata, team configs, task files) and renders a terminal dashboard showing tool usage, skills, subagents, teams, tasks, token consumption, and file activity.

Build & Run Commands

bun run start          # Run the monitor (bun run src/index.ts)
bun run dev            # Run with --watch for auto-reload
bun run build          # Compile to standalone binary: dist/ccmonitor
bun run install:global # Build + copy binary to ~/.bun/bin/ccmonitor

Run with a specific session: bun run src/index.ts <sessionId>

Testing

bun test               # synthetic + fixture tests (src/*.test.ts, fixtures/*.jsonl)
bun run typecheck      # tsc --noEmit, strict + noUncheckedIndexedAccess
bun run src/index.ts --fixture fixtures/recap-basic.jsonl   # render a fixture, no registry

Fixtures are scrubbed cuts of real transcripts (scripts/make-fixture.ts, re-cut with scripts/cut-fixtures.sh). Each has a measured .expect.json sidecar. Before a release also run bun run build and the width sweep in src/ui.test.ts (80/100/140 columns). Golden renders live in fixtures/golden/; after a deliberate visual change run bun run scripts/update-golden.ts and read the diff.

Upgrade

When the user says upgrade:

  • Bump the minor version in package.json
  • Verify with bun run build (rebuild dist/ccmonitor)
  • Add an entry to CHANGELOG.md (Keep a Changelog format)
  • Update README.md (version line + any user-facing changes)
  • Save, commit, push

Architecture

No external UI framework — raw ANSI escape codes to stdout. Parsing is split into a pure layer and disk loaders:

  • index.ts — Entry point. CLI args ([sessionId], --fixture), keyboard (q/r/n/s/c/b/i/d/1-9/0/Enter/Esc/j/k; ↑/↓ on the dashboard change the refresh interval), view state (dashboard | recap | background | info | sessions), collapsed-section prefs (src/uiPrefs.ts → ~/.claude/ccmonitor-ui.json), refresh loop (2 s default, 2–60 s, src/refresh.ts). Holds one TranscriptReader per transcript file.
  • parser.ts — Orchestration. parseTranscriptLines(lines, ctx) (pure), enrichSessionState(state) (runs the loaders on a copy), TranscriptReader (incremental tail reads; full reparse when the file shrinks or its first 64 bytes change), locate*Session helpers, computeDerived.
  • entry.ts — The pure per-entry state machine (processEntry + handleSystem / handleAttachment / handleAssistant / handleUser …). Groups assistant lines by message.id, opens/closes turns, tracks background tasks, recap text, hooks, permissions, cost, links, queue, attribution, errors. Reports unknown type / system.subtype / attachment.type values through ctx.onUnknown.
  • state.ts — createSessionState, ParseMemo (parser working memory), ParseSession.
  • recap.ts — Pure text helpers: extractKoreanRecap, mdToPlain, parseTaskNotification, cleanNativeRecap.
  • loaders/ — One file per disk source (subagents, teams, tasks, skillHook, git, gitStatus, fileHistory, sessions, memory, effort, rateLimit, process, scratchpad, globalConfig, modelCatalog, plans, feedback, history, update).
  • views/sessions.ts — pure row builder for the session picker. paths.ts holds CLAUDE_DIR (override with CCMONITOR_CLAUDE_DIR).
  • types.ts — All TypeScript interfaces. SessionState is the central data structure; TranscriptEntry models the JSONL schema.
  • ui.ts — Pure rendering. The dashboard is header + SECTIONS (each a Section {id, key, title, render}) + footer; renderDashboardLines / renderRecapViewLines / renderBackgroundViewLines / renderInfoViewLines / renderSessionsViewLines return string[]; render() writes to stdout. Adding a panel = appending to SECTIONS. Handles CJK fullwidth and emoji widths. No state mutation.
  • keys.ts — splitKeys: splits a stdin chunk into single keys (escape sequences whole). CCMONITOR_KEYLOG=<file> logs raw chunks.
  • unknownFields.ts — Appends unknown kinds to ~/.claude/ccmonitor-unknown-fields.log.

Read the full file on GitHub · 93 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. 27d ago Changed · +22 lines · +960 tokens per session 2e3c043b1ecb
  2. 2mo ago First seen · 71 lines · 1,158 tokens per session scan A 5c7da552d948

Subscribe to this mod's changes

ccmonitor CLAUDE.md is an instructions file published in the GitHub repository tobyilee/ccmonitor (54 stars, last pushed 27d ago), licensed MIT. It adds 2,118 tokens to every session, about $0.0085 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

ccmonitor CLAUDE.md compared with instructions from other repositories

ccmonitor CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ccmonitor CLAUDE.mdtobyilee/ccmonitorInstructions file5427d agoMITA2,118Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode