_ _ _ _
___ ___ ___| |_ __ _| |_ _ _ ___| (_)_ __ ___
/ __/ __/ __| __/ _` | __| | | / __| | | '_ \ / _ \
| (_| (__\__ \ || (_| | |_| |_| \__ \ | | | | | __/
\___\___|___/\__\__,_|\__|\__,_|___/_|_|_| |_|\___|
π¨ A highly customizable status line formatter for Claude Code CLI Display model info, git branch, token usage, and other metrics in your terminal
- β±οΈ Block Timer - Track your progress through 5-hour Claude Code blocks
- Displays time elapsed in current block as hours/minutes (e.g., "3hr 45m")
- Progress bar mode shows visual completion percentage
- Two progress bar styles: full width (32 chars) or compact (16 chars)
- Automatically detects block boundaries from transcript timestamps
- β‘ Powerline Mode - Beautiful Powerline-style status lines with arrow separators and customizable caps
- π¨ Built-in Themes - Multiple pre-configured themes that you can copy and customize
- π Advanced Color Support - Basic (16), 256-color (with custom ANSI codes), and truecolor (with hex codes) modes
- π Widget Merging - Merge multiple widgets together with or without padding for seamless designs
- π¦ Easy Installation - Install directly with
npxorbunx- no global package needed - π€ Custom Separators - Add multiple Powerline separators with custom hex codes for font support
- π Auto Font Install - Automatic Powerline font installation with user consent
- π Real-time Metrics - Display model name, git branch, token usage, session duration, block timer, and more
- π¨ Fully Customizable - Choose what to display and customize colors for each element
- β‘ Powerline Support - Beautiful Powerline-style rendering with arrow separators, caps, and custom fonts
- π Multi-line Support - Configure up to 3 independent status lines
- π₯οΈ Interactive TUI - Built-in configuration interface using React/Ink
- βοΈ Global Options - Apply consistent formatting across all items (padding, separators, bold, background)
- π Cross-platform - Works seamlessly with both Bun and Node.js
- π Smart Width Detection - Automatically adapts to terminal width with flex separators
- β‘ Zero Config - Sensible defaults that work out of the box
# Run the configuration TUI with npm
npx ccstatusline@latest
# Or with Bun (faster)
bunx ccstatusline@latestThe interactive configuration tool provides a terminal UI where you can:
- Configure up to 3 separate status lines
- Add/remove/reorder status line items
- Customize colors for each element
- Configure flex separator behavior
- Edit custom text items
- Install/uninstall to Claude Code settings
- Preview your status line in real-time
π‘ Tip: Your settings are automatically saved to
~/.config/ccstatusline/settings.json
Once configured, ccstatusline automatically formats your Claude Code status line. The status line appears at the bottom of your terminal during Claude Code sessions.
- Model Name - Shows the current Claude model (e.g., "Claude 3.5 Sonnet")
- Git Branch - Displays current git branch name
- Git Changes - Shows uncommitted insertions/deletions (e.g., "+42,-10")
- Session Clock - Shows elapsed time since session start (e.g., "2hr 15m")
- Block Timer - Shows time elapsed in current 5-hour block or progress bar
- Version - Shows Claude Code version
- Output Style - Shows the currently set output style in Claude Code
- Tokens Input - Shows input tokens used
- Tokens Output - Shows output tokens used
- Tokens Cached - Shows cached tokens used
- Tokens Total - Shows total tokens used
- Context Length - Shows current context length in tokens
- Context Percentage - Shows percentage of context limit used (out of 200k)
- Context Percentage (usable) - Shows percentage of usable context (out of 160k, accounting for auto-compact at 80%)
- Terminal Width - Shows detected terminal width (for debugging)
- Custom Text - Add your own custom text to the status line
- Custom Command - Execute shell commands and display their output (refreshes whenever the statusline is updated by Claude Code)
- Separator - Visual divider between items (customizable: |, -, comma, space)
- Flex Separator - Expands to fill available space
These settings affect where long lines are truncated, and where right-alignment occurs when using flex separators:
- Full width always - Uses full terminal width (may wrap if auto-compact message appears or IDE integration adds text)
- Full width minus 40 - Reserves 40 characters for auto-compact message to prevent wrapping (default)
- Full width until compact - Dynamically switches between full width and minus 40 based on context percentage threshold (configurable, default 60%)
Configure global formatting preferences that apply to all status items:
- Default Padding - Add consistent padding to the left and right of each item
- Default Separator - Automatically insert a separator between all items
- Press (p) to edit padding
- Press (s) to edit separator
Global Formatting Options
- Inherit Colors - Default separators inherit foreground and background colors from the preceding widget
- Press (i) to toggle
- Global Bold - Apply bold formatting to all text regardless of individual item settings
- Press (o) to toggle
- Override Foreground Color - Force all items to use the same text color
- Press (f) to cycle through colors
- Press (g) to clear override
- Override Background Color - Force all items to use the same background color
- Press (b) to cycle through colors
- Press (c) to clear override
π‘ Note: These settings are applied during rendering and don't add items to your widget list. They provide a consistent look across your entire status line without modifying individual item configurations.
β οΈ VSCode Users: If colors appear incorrect in the VSCode integrated terminal, the "Terminal βΊ Integrated: Minimum Contrast Ratio" (terminal.integrated.minimumContrastRatio) setting is forcing a minimum contrast between foreground and background colors. You can adjust this setting to 1 to disable the contrast enforcement, or use a standalone terminal for accurate colors.
The Block Timer widget helps you track your progress through Claude Code's 5-hour conversation blocks:
Display Modes:
- Time Display - Shows elapsed time as "3hr 45m" (default)
- Progress Bar - Full width 32-character progress bar with percentage
- Progress Bar (Short) - Compact 16-character progress bar with percentage
Features:
- Automatically detects block boundaries from transcript timestamps
- Floors block start time to the hour for consistent tracking
- Shows "Block: 3hr 45m" in normal mode or just "3hr 45m" in raw value mode
- Progress bars show completion percentage (e.g., "[ββββββββββββββββββββββββββββββββ] 73.9%")
- Toggle between modes with the (p) key in the items editor
Some items support "raw value" mode which displays just the value without a label:
- Normal:
Model: Claude 3.5 Sonnetβ Raw:Claude 3.5 Sonnet - Normal:
Session: 2hr 15mβ Raw:2hr 15m - Normal:
Block: 3hr 45mβ Raw:3hr 45m - Normal:
Ctx: 18.6kβ Raw:18.6k
Add static text to your status line. Perfect for:
- Project identifiers
- Environment indicators (dev/prod)
- Personal labels or reminders
Execute shell commands and display their output dynamically:
- Refreshes whenever the statusline is updated by Claude Code
- Receives the full Claude Code JSON data via stdin (model info, session ID, transcript path, etc.)
- Displays command output inline in your status line
- Configurable timeout (default: 1000ms)
- Examples:
pwd | xargs basename- Show current directory namenode -v- Display Node.js versiongit rev-parse --short HEAD- Show current commit hashdate +%H:%M- Display current timecurl -s wttr.in?format="%t"- Show current temperaturenpx -y ccusage@latest statusline- Display Claude usage metrics (set timeout: 5000ms)
β οΈ Important: Commands should complete quickly to avoid delays. Long-running commands will be killed after the configured timeout. If you're not seeing output from your custom command, try increasing the timeout value (press 't' in the editor).
π‘ Tip: Custom commands can be other Claude Code compatible status line formatters! They receive the same JSON via stdin that ccstatusline receives from Claude Code, allowing you to chain or combine multiple status line tools.
ccusage is a tool that tracks and displays Claude Code usage metrics. You can integrate it directly into your status line:
- Add a Custom Command widget
- Set command:
npx -y ccusage@latest statusline - Set timeout:
5000(5 seconds for initial download) - Enable "preserve colors" to keep ccusage's color formatting
π How it works: The command receives Claude Code's JSON data via stdin, allowing ccusage to access session information, model details, and transcript data for accurate usage tracking.
When terminal width is detected, status lines automatically truncate with ellipsis (...) if they exceed the available width, preventing line wrapping.
- Bun (v1.0+)
- Git
- Node.js 18+ (optional, for npm publishing)
# Clone the repository
git clone https://github.com/yourusername/ccstatusline.git
cd ccstatusline
# Install dependencies
bun install# Run in TUI mode (configuration)
bun run src/ccstatusline.ts
# Build for distribution
bun run buildccstatusline/
βββ src/
β βββ ccstatusline.ts # Main entry point
β βββ tui/ # React/Ink configuration UI
β β βββ App.tsx # Root TUI component
β β βββ index.tsx # TUI entry point
β β βββ components/ # UI components
β β βββ MainMenu.tsx
β β βββ LineSelector.tsx
β β βββ ItemsEditor.tsx
β β βββ ColorMenu.tsx
β β βββ PowerlineSetup.tsx
β β βββ ...
β βββ widgets/ # Status line widget implementations
β β βββ Model.ts
β β βββ GitBranch.ts
β β βββ TokensTotal.ts
β β βββ OutputStyle.ts
β β βββ ...
β βββ utils/ # Utility functions
β β βββ config.ts # Settings management
β β βββ renderer.ts # Core rendering logic
β β βββ powerline.ts # Powerline font utilities
β β βββ colors.ts # Color definitions
β β βββ claude-settings.ts # Claude Code integration
β βββ types/ # TypeScript type definitions
β βββ Settings.ts
β βββ Widget.ts
β βββ PowerlineConfig.ts
β βββ ...
βββ dist/ # Built files (generated)
βββ package.json
βββ tsconfig.json
βββ README.md
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT Β© Matthew Breedlove
Matthew Breedlove
- GitHub: @sirmalloc
- tweakcc - Customize Claude Code themes, thinking verbs, and more.
- ccusage - Track and display Claude Code usage metrics.
- Built for use with Claude Code CLI by Anthropic
- Powered by Ink for the terminal UI
- Made with β€οΈ for the Claude Code community
Give a β if this project helped you!




