Borrowing it
Nothing to install: this file belongs to howar31/claude-statusline. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/howar31/claude-statusline/main/CLAUDE.mdgit clone --depth 1 https://github.com/howar31/claude-statuslineWrote 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.
[](https://agentmods.dev/instructions/howar31/claude-statusline/claude-md)<a href="https://agentmods.dev/instructions/howar31/claude-statusline/claude-md"><img src="https://agentmods.dev/badge/instructions/howar31/claude-statusline/claude-md.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01641 | $0.01641 |
| Opus 5 | $0.00821 | $0.00821 |
| Sonnet 5 | $0.00328 | $0.00328 |
| Haiku 4.5 | $0.00164 | $0.00164 |
Grade B, and why
claude-statusline CLAUDE.md 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 7d 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.
Scripts are meant to be symlinked into `~/.claude/` and referenced from `~/.claude/settings.json` (see `SPEC.md` for the exact JSON stanza). Edits here take effect on the next statusline refresh — no reload needed, becau How it starts
The opening of the file, as written. The whole thing — 46 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.
What this repo is
A custom statusline for Claude Code: a one-shot Bash script that reads session JSON from stdin and renders an eight-line colored status display. No build, no package manager, no test suite.
Architecture
See SPEC.md for the authoritative spec — output layout, color formulas, JSON input contract, IPC invariants, install wiring.
Two scripts:
statusline.sh— the rendererhooks/compact-monitor.sh— aPreCompacthook that bumps a counter the renderer consumes via/tmp/claude-compacts-<sanitized_session_id>.json
Conventions to preserve
- Every
jqlookup instatusline.shmust have a//default. Claude Code may add or rename schema fields; the script must degrade gracefully. - Optional payload fields render gated. Fields that may be absent (
pr.*,worktree.*,thinking.enabled,context_window.context_window_size,cost.total_api_duration_ms,version) are shown only when present / non-zero, so a line never emits a stray separator or placeholder. Keep new field additions gated the same way. SeeSPEC.md→ Gated fields. - Effort comes from stdin
.effort.level, with no silent fallback. It is one oflow/medium/high/xhigh/max(Claude Code normalizesultracode→xhighupstream, so it never arrives literally). A missing field (models without effort support, e.g. Haiku 4.5) renders as a dim—; a present-but-unrecognized value renders as a loud bright-redunknownso schema drift stays visible. Don't reintroduce a quiet default. SeeSPEC.md→ Effort level. - Cross-platform
date: use the BSD-or-GNU fallbackdate -r "$EPOCH" "+%H:%M" 2>/dev/null || date -d "@$EPOCH" "+%H:%M" 2>/dev/null. Keep it when adding new time displays. - Bars are built by glyph concatenation, not
tr.tr ' ' '█'maps bytes, so GNU coreutils corrupts the 3-byte bar glyphs into invalid UTF-8 (only BSDtrrendered them) — the bars looked fine on macOS but were broken on Linux. Build runs with therepeat_glyphhelper instatusline.sh(and the inline loop indocs/swatches.sh); mirror that for any new bar. - Session id sanitization (
tr -dc 'a-zA-Z0-9' | cut -c1-24) is the IPC key shared bystatusline.sh,hooks/compact-monitor.sh, andhooks/account-monitor.sh. Change one, change all three. - The account label must be derived from the session's own credential, never from
~/.claude.json..oauthAccountthere is a single machine-global slot shared by every Claude Code surface and is only rewritten by a full profile fetch gated behind a 24h TTL, so it can name a different account than the one actually spending quota (it did, for two days, before 2026-08-24).hooks/account-monitor.shresolves the credential the session authenticates with and publishes the owner; the renderer reads only that. If resolution fails the label is a loud yellow?— never fall back to a name that might be wrong. SeeSPEC.md→ Account attribution. - The context bar must not be wrapped in DIM — it uses 24-bit truecolor and DIM collapses the gradient. (The 5h / 7d limit bars are also truecolor but are intentionally wrapped in DIM for a softer look — that's a deliberate aesthetic choice, not a precedent to copy.)
- Bar widths: context 30 chars, 5h/7d 20 chars. If you change one, update its
pct * N / 100calculation too. - Line width budget ≤ 60 columns. Keep every rendered line within ~60 visible columns (excluding ANSI codes and the line-8
⚠ <drift>suffix appended byclaude-backup). The shared label column is dynamic (it widens to the accountdisplayName), so a long account name — or long repo/branch/PR/worktree on line 1 — can blow the budget. If a design change would push any line past 60, confirm the design with the user before shipping rather than silently overflowing. SeeSPEC.md→ Width budget. docs/swatches.shmirrors the colors. It regenerates the three README graphics and duplicatesstatusline.sh's palette + gradient formulas (it is not sourced by the renderer — that stays a single drop-in file). Change a color constant or gradient formula instatusline.sh→ updatedocs/swatches.shtoo, then re-render and re-screenshot the affecteddocs/*.png.docs/preview.shregenerates the README text previews. It rewrites the two blocks between the<!-- preview:baseline -->/<!-- preview:full -->markers inREADME.mdby running the realstatusline.shagainst fixed sandboxed payloads (pinned clock viaTZ=UTC+ adateshim, scratch git repos for branch/diff, fakeHOMEfor the drift flag, seeded/tmpaccount + compact files). Unlikeswatches.shit does not duplicate renderer logic — it invokesstatusline.sh, so it can only drift in its sample inputs, never in output formatting. It is deterministic (a no-op change yields no diff) and byte-reproducible across BSD/GNU (verified in a Linux container). After any change tostatusline.sh's output, re-run it (./docs/preview.sh) and commit; no manual paste/screenshot needed (that's only swatches, because those are images)../docs/preview.sh --checkregenerates into a temp file and diffs without mutating README (exit 1 on drift); CI runs exactly this via.github/workflows/preview-check.yml, so a stale preview fails the build.
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.
- 7d ago First seen · 46 lines · 1,641 tokens per session scan B dcce315189e4
claude-statusline CLAUDE.md is an instructions file published in the GitHub repository howar31/claude-statusline (2 stars, last pushed 8d ago), licensed MIT. It adds 1,641 tokens to every session, about $0.0082 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.
Other instructions, from other repositories
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
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).
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.
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.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.