ccstatusline
AGENTS.md13k starsChanged 4 months agoMITView on GitHub
ccstatusline is a customizable status line formatter for Claude Code CLI that displays model info, git branch, token usage, and other metrics. It functions as both: 1. A piped command processor for Claude Code status lines 2. An interactive TUI configuration tool when run without input The project has dual runtime compatibility - works with both Bun and Node.js: Widget Interface: All widgets must implement: - getDefaultColor(): Default color for the widget - getDescription(): Description shown in TUI - getDisplayName():…
- Reads credentials
1 other project uses a version of this.
Trending
Less talk lately.about the whole repository
Most recently taken up by
- huangguang1999/ccstatusline-zhword for word, first seen May 18, 2026
Who's talking about sirmalloc/ccstatusline
- kirodotdev/Kiro“Feature Request: Add statusline support to kiro-cli”GitHub · Jan 10, 2026 · 14 reactions
- anthropics/claude-code“[FEATURE] Built-in status line with rate limit usage bars”GitHub · Mar 3, 2026 · 10 reactions
- @github-trending-js.bsky.social“📦 sirmalloc / ccstatusline ⭐ 9,231 (+75) 🗒 TypeScript 🚀 Beautiful highly customizable statusline for …”Bluesky · May 14, 2026 · 2 likes
- @mnapoli.bsky.social“I'm not the kind to spend days tweaking the terminal UI and themes but I played with it this weekend and …”Bluesky · Jan 27, 2026 · 2 likes
- UfoMiao/zcf“Miscellaneous set of tools”GitHub · Aug 18, 2025 · 2 reactions
The biggest 5 of 46 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 46
Talked about on GitHub and Bluesky (46 times).
On GitHub · 40
- Jan 10, 2026Feature Request: Add statusline support to kiro-cli — kirodotdev/Kiro14 reactions · 2 comments
- Mar 3, 2026[FEATURE] Built-in status line with rate limit usage bars — anthropics/claude-code10 reactions · 10 comments
- Aug 18, 2025Miscellaneous set of tools — UfoMiao/zcf2 reactions · 1 comment
- Jun 15, 2026ccstatusline: update to 2.2.21 — theblazehen/packaging1 reaction
- Apr 15, 2026Add cache expiration timer/warning — Owloops/claude-powerline1 reaction · 1 comment
35 more on GitHub
- Oct 4, 2026fix(deps): update all non-major dependencies — berlysia/dotfiles0 reactions
- Oct 1, 2026catalog: provenance refresh — ryanmaclean/statuslines0 reactions · 1 comment
- Sep 23, 2026build(deps): Bump ccstatusline from 2.2.29 to 2.2.30 in the production-patch group across 1 directory — superkoh/koloft0 reactions
- Sep 18, 2026ccstatusline: update to 2.2.30 — theblazehen/packaging0 reactions
- Sep 18, 2026Upstream Parity: ccstatusline v2.2.30 released (17 commits ahead) — adrijshikhar/cxstatusline0 reactions · 1 comment
- Sep 18, 2026Bump the non-breaking group across 1 directory with 7 updates — keyute/dotfiles0 reactions · 1 comment
- Sep 15, 2026Bump the non-breaking group with 3 updates — keyute/dotfiles0 reactions · 1 comment
- Sep 13, 2026Upstream Parity: ccstatusline v2.2.29 released (14 commits ahead) — adrijshikhar/cxstatusline0 reactions · 1 comment
- Sep 13, 2026Upstream Parity: ccstatusline v2.2.29 released (14 commits ahead) — adrijshikhar/cxstatusline0 reactions · 1 comment
- Sep 4, 2026ccstatusline: update to 2.2.29 — theblazehen/packaging0 reactions
- Sep 4, 2026fix(pkg-cli): update npm:ccstatusline (2.2.27 -> 2.2.29) — ppat/dotfiles0 reactions
- Sep 3, 2026ccstatusline: update to 2.2.28 — theblazehen/packaging0 reactions
- Aug 18, 2026Bump the non-breaking group across 1 directory with 4 updates — keyute/dotfiles0 reactions
- Aug 11, 2026Bump the non-breaking group across 1 directory with 4 updates — keyute/dotfiles0 reactions · 1 comment
- Aug 4, 2026Bump the non-breaking group with 3 updates — keyute/dotfiles0 reactions · 1 comment
- Jul 27, 2026fix(cli-tools): update npm:ccstatusline (2.2.25 -> 2.2.27) — ppat/dotfiles0 reactions
- Jul 26, 2026ccstatusline: update to 2.2.27 — theblazehen/packaging0 reactions
- Jul 25, 2026ccstatusline: update to 2.2.26 — theblazehen/packaging0 reactions
- Jul 23, 2026catalog: provenance refresh — ryanmaclean/statuslines0 reactions
- Jul 21, 2026ccstatusline: update to 2.2.25 — theblazehen/packaging0 reactions
- Jul 20, 2026ccstatusline: update to 2.2.24 — theblazehen/packaging0 reactions
- Jul 20, 2026Bump the non-breaking group across 1 directory with 2 updates — keyute/dotfiles0 reactions
- Jul 19, 2026feat: Recommended tools view (v7.6.0) — vakovalskii/codbash0 reactions
- Jul 11, 2026ccstatusline: update to 2.2.23 — theblazehen/packaging0 reactions
- Jun 30, 2026Bump the non-breaking group across 1 directory with 2 updates — keyute/dotfiles0 reactions
- Jun 23, 2026Bump ccstatusline from 2.2.19 to 2.2.22 in the non-breaking group — keyute/dotfiles0 reactions · 1 comment
- Jun 16, 2026ccstatusline: update to 2.2.22 — theblazehen/packaging0 reactions · 1 comment
- Jun 14, 2026ccstatusline: update to 2.2.20 — theblazehen/packaging0 reactions
- Jun 4, 2026Bump ccstatusline from 2.2.12 to 2.2.19 in the non-breaking group across 1 directory — keyute/dotfiles0 reactions
- May 20, 2026Bump the non-breaking group across 1 directory with 2 updates — keyute/dotfiles0 reactions · 1 comment
- May 18, 2026ccstatusline: update to 2.2.19 — theblazehen/packaging0 reactions · 1 comment
- May 16, 2026ccstatusline: update to 2.2.18 — theblazehen/packaging0 reactions · 1 comment
- Apr 23, 2026Option for showing the actual available usage percentage? — bdkent/clauditor0 reactions · 4 comments
- Apr 2, 2026Informatique : ajout Claude Code statusline — piRGoif/GEPApiR0 reactions
- Sep 4, 2025AIs — NaClYen/blog0 reactions
On Bluesky · 6
- May 14, 2026📦 sirmalloc / ccstatusline ⭐ 9,231 (+75) 🗒 TypeScript 🚀 Beautiful highly customizable statusline for Claude Code CLI with powerline… — @github-trending-js.bsky.social2 likes and reposts
- Jan 27, 2026I'm not the kind to spend days tweaking the terminal UI and themes but I played with it this weekend and that font and theme in claude 🤌🤌… — @mnapoli.bsky.social2 likes and reposts
- Feb 10, 2026Highly recommend github.com/sirmalloc/cc... — @mathias.blog1 likes and repost
- Jan 27, 2026Replaced my custom status line script for Claude Code with ccstatusline. The interactive lines editor is particularly neat. The tool… — @mathias.blog1 likes and repost
- Aug 25, 2025ccstatusline: very helpful to get insight in Claude Code's context statistics. Most useful for now: how much time is left in the 5h window… — @hanlho.com1 likes and repost
1 more on Bluesky
- Mar 20, 2026これええで github.com/sirmalloc/cc... — @ryonakae.com0 likes and reposts · 1 reply
Other versions1 project uses a version of this.
Word for word · 1
- huangguang1999/ccstatusline-zh★ 806100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 62
Default configuration if no settings exist
- Distinctive: line 84
All widgets must implement:
- Very specific: line 123
Default to using Bun instead of Node.js:
- Very specific: line 124
Use bun <file> instead of node <file> or ts-node <file>
- Very specific: line 125
Use bun install instead of npm install
- Very specific: line 127
Use bun build with appropriate options for building
- Very specific: line 141
Dependencies: All runtime dependencies are bundled using --packages=external for npm package
- Very specific: line 142
Type checking and linting: Run checks via bun run lint and use bun run lint:fix only when you intentionally want ESLint auto-fixes.
- Distinctive: line 143
Lint rules: Never disable a lint rule via a comment, no matter how benign the lint warning or error may seem
- Very specific: line 149
Run tests with bun test or bun test --watch for watch mode
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
ccstatusline is a customizable status line formatter for Claude Code CLI that displays model info, git branch, token usage, and other metrics. It functions as both:
- A piped command processor for Claude Code status lines
- An interactive TUI configuration tool when run without input
Development Commands
# Install dependencies
bun install
# Run in interactive TUI mode
bun run start
# Test with piped input (use [1m] suffix for 1M context models)
echo '{"model":{"id":"claude-sonnet-4-5-20250929[1m]"},"transcript_path":"test.jsonl"}' | bun run src/ccstatusline.ts
# Or use example payload
bun run example
# Build for npm distribution
bun run build # Creates dist/ccstatusline.js with Node.js 14+ compatibility
# Run tests
bun test
# Run tests in watch mode
bun test --watch
# Lint and type check
bun run lint # Runs TypeScript type checking and ESLint without modifying files
# Apply ESLint auto-fixes intentionally
bun run lint:fixArchitecture
The project has dual runtime compatibility - works with both Bun and Node.js:
Core Structure
- src/ccstatusline.ts: Main entry point that detects piped vs interactive mode
- Piped mode: Parses JSON from stdin and renders formatted status line
- Interactive mode: Launches React/Ink TUI for configuration
TUI Components (src/tui/)
- index.tsx: Main TUI entry point that handles React/Ink initialization
- App.tsx: Root component managing navigation and state
- components/: Modular UI components for different configuration screens
- MainMenu, LineSelector, ItemsEditor, ColorMenu, GlobalOverridesMenu
- PowerlineSetup, TerminalOptionsMenu, StatusLinePreview
Utilities (src/utils/)
- config.ts: Settings management
- Loads from
~/.config/ccstatusline/settings.json - Handles migration from old settings format
- Default configuration if no settings exist
- Loads from
- renderer.ts: Core rendering logic for status lines
- Handles terminal width detection and truncation
- Applies colors, padding, and separators
- Manages flex separator expansion
- powerline.ts: Powerline font detection and installation
- claude-settings.ts: Integration with Claude Code settings.json
- Respects
CLAUDE_CONFIG_DIRenvironment variable with fallback to~/.claude - Provides installation command constants (NPM, BUNX, self-managed)
- Detects installation status and manages settings.json updates
- Validates config directory paths with proper error handling
- Respects
- colors.ts: Color definitions and ANSI code mapping
- model-context.ts: Model-to-context-window mapping
- Maps model IDs to their context window sizes based on [1m] suffix
- Sonnet 4.5 WITH [1m] suffix: 1M tokens (800k usable at 80%) - requires long context beta access
- Sonnet 4.5 WITHOUT [1m] suffix: 200k tokens (160k usable at 80%)
- Legacy models: 200k tokens (160k usable at 80%)
Widgets (src/widgets/)
Custom widgets implementing the Widget interface defined in src/types/Widget.ts:
Widget Interface: All widgets must implement:
getDefaultColor(): Default color for the widgetgetDescription(): Description shown in TUIgetDisplayName(): Display name shown in TUIgetEditorDisplay(): How the widget appears in the editorrender(): Core rendering logic that produces the widget outputsupportsRawValue(): Whether widget supports raw value modesupportsColors(): Whether widget supports color customization- Optional:
renderEditor(),getCustomKeybinds(),getHideableStates(),supportsNumberFormat(),handleEditorAction()
Widget Registry Pattern:
- Located in src/utils/widgets.ts
- Uses a Map-based registry (
widgetRegistry) that maps widget type strings to widget instances getWidget(type): Retrieves widget instance by typegetAllWidgetTypes(): Returns all available widget typesisKnownWidgetType(): Validates if a type is registered
Available Widgets:
- Model, Version, OutputStyle, VoiceStatus, ClaudeStatus - Claude Code metadata and service-health display
- GitBranch, GitChanges, GitInsertions, GitDeletions, GitWorktree - Git repository status
- TokensInput, TokensOutput, TokensCached, TokensTotal - Token usage metrics
- ContextLength, ContextPercentage, ContextPercentageUsable - Context window metrics (uses dynamic model-based context windows: 1M for Sonnet 4.5 with [1m] suffix, 200k for all other models)
- BlockTimer, SessionClock, SessionCost - Time and cost tracking
- CurrentWorkingDir, TerminalWidth - Environment info
- CustomText, CustomCommand - User-defined widgets
Key Implementation Details
- Cross-platform stdin reading: Detects Bun vs Node.js environment and uses appropriate stdin API
- Token metrics: Parses Claude Code transcript files (JSONL format) to calculate token usage
- Git integration: Uses child_process.execSync to get current branch and changes
- Terminal width management: Three modes for handling width (full, full-minus-40, full-until-compact)
- Flex separators: Special separator type that expands to fill available space
- Powerline mode: Optional Powerline-style rendering with arrow separators
- Custom commands: Execute shell commands and display output in status line
- Mergeable items: Items can be merged together with or without padding
Bun Usage Preferences
Default to using Bun instead of Node.js:
- Use
bun <file>instead ofnode <file>orts-node <file> - Use
bun installinstead ofnpm install - Use
bun run <script>instead ofnpm run <script> - Use
bun buildwith appropriate options for building - Bun automatically loads .env, so don't use dotenv
Important Notes
- ink@6.2.0 patch: The project uses a patch for ink@6.2.0 to fix backspace key handling on macOS
- Issue: ink treats
\x7f(backspace on macOS) as delete key instead of backspace - Fix: Patches
build/parse-keypress.jsto correctly map\x7fto backspace - Applied automatically during
bun installviapatchedDependenciesin package.json - Patch file:
patches/ink@6.2.0.patch
- Issue: ink treats
- Build process: Two-step build using
bun run buildbun build: Bundles src/ccstatusline.ts into dist/ccstatusline.js targeting Node.js 14+postbuild: Runs scripts/replace-version.ts to replace__PACKAGE_VERSION__placeholder with actual version from package.json
- ESLint configuration: Uses flat config format (eslint.config.js) with TypeScript and React plugins
- Dependencies: All runtime dependencies are bundled using
--packages=externalfor npm package - Type checking and linting: Run checks via
bun run lintand usebun run lint:fixonly when you intentionally want ESLint auto-fixes. Never usenpx eslint,eslint,tsx,bun tsc, or any other variation directly - Lint rules: Never disable a lint rule via a comment, no matter how benign the lint warning or error may seem
- Testing: Uses Vitest (via Bun) with 6 test files and ~40 test cases covering:
- Model context detection and token calculation (src/utils/tests/model-context.test.ts)
- Context percentage calculations (src/utils/tests/context-percentage.test.ts)
- JSONL transcript parsing (src/utils/tests/jsonl.test.ts)
- Widget rendering (src/widgets/tests/*.test.ts)
- Run tests with
bun testorbun test --watchfor watch mode - Test configuration: vitest.config.ts
- Manual testing also available via piped input and TUI interaction
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

