Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@owloops/claude-powerline

Owloops9.3kMIT1.9.15

Beautiful vim-style powerline statusline for Claude Code with real-time usage tracking, git integration, and custom themes

claude, powerline, statusline, typescript, claude-code

readme

Claude Powerline

A vim-style powerline statusline for Claude Code with real-time usage tracking, git integration, and custom themes.

License:MIT npm downloads npm version Install size Dependencies

Mentioned in Awesome Claude Code

Demo

Claude Powerline Demo

Live demonstration: real-time usage tracking, git integration, and theme showcase

Dark Theme
Dark
Light Theme
Light
Nord Theme
Nord
Tokyo Night Theme
Tokyo Night
Rose Pine Theme
Rose Pine
Custom Theme
Create your own!

Features

Usage Tracking

  • Real-time session costs
  • 5-hour billing window monitoring
  • Daily budget alerts with percentages
  • Token breakdown (input/output/cached)

Git Integration

  • Branch status with clean/dirty indicators
  • Commits ahead/behind remote tracking
  • Repository info (SHA, tags, stash count)
  • Working tree staged/unstaged/untracked counts

Customization

  • 5 built-in themes (dark, light, nord, tokyo-night, rose-pine)
  • Custom color configuration
  • Three separator styles: minimal, powerline, and capsule
  • Multi-line layouts to prevent cutoff

Performance Metrics

  • Average and last response times
  • Session duration tracking
  • Message count monitoring
  • Context usage with auto-compact threshold

Installation

Setup

Requires Node.js 18+, Claude Code, Git 2.0+, and terminal with Nerd Font for proper icon display.

1. Add to your Claude Code settings.json:

{
  "statusLine": {
    "type": "command",
    "command": "npx -y @owloops/claude-powerline@latest --style=powerline"
  }
}

2. Start a Claude session - the statusline appears at the bottom during conversations.

Claude Code with powerline

Using npx automatically downloads and runs the latest version without manual updates.

Usage

Once added to Claude Code settings, the statusline runs automatically. For customization:

CLI Options:

  • --theme - dark (default), light, nord, tokyo-night, rose-pine, custom
  • --style - minimal (default), powerline, capsule
  • --config - Custom config file path
  • --help - Show help

Examples:

claude-powerline --theme=nord --style=powerline
claude-powerline --theme=dark --style=capsule
claude-powerline --config=/path/to/config.json

Environment Variables:

export CLAUDE_POWERLINE_THEME=dark
export CLAUDE_POWERLINE_STYLE=powerline
export CLAUDE_POWERLINE_CONFIG=/path/to/config.json
export CLAUDE_POWERLINE_DEBUG=1  # Enable debug logging

Styles

Claude Powerline Styles

Configuration

Get example config:

# Download full-featured example config
curl -o ~/.claude/claude-powerline.json https://raw.githubusercontent.com/Owloops/claude-powerline/main/.claude-powerline.json

Config locations (in priority order):

  • ./.claude-powerline.json - Project-specific
  • ~/.claude/claude-powerline.json - User config
  • ~/.config/claude-powerline/config.json - XDG standard

Override priority: CLI flags → Environment variables → Config files → Defaults

Config files reload automatically and no restart needed.

Segment Configuration

<summary>Directory - Shows current working directory name</summary>
"directory": {
  "enabled": true,
  "showBasename": false
}

Options:

  • showBasename: Show only folder name instead of full path
<summary>Git - Shows branch, status, and repository information</summary>
"git": {
  "enabled": true,
  "showSha": true,
  "showWorkingTree": false,
  "showOperation": false,
  "showTag": false,
  "showTimeSinceCommit": false,
  "showStashCount": false,
  "showUpstream": false,
  "showRepoName": false
}

Options:

  • showSha: Show abbreviated commit SHA
  • showWorkingTree: Show staged/unstaged/untracked counts
  • showOperation: Show ongoing operations (MERGE/REBASE/CHERRY-PICK)
  • showTag: Show nearest tag
  • showTimeSinceCommit: Show time since last commit
  • showStashCount: Show stash count
  • showUpstream: Show upstream branch
  • showRepoName: Show repository name

Symbols:

  • Branch • SHA • Tag • Stash • Clean • Dirty • Conflicts • ↑3 Ahead • ↓2 Behind • (+1 ~2 ?3) Staged/Unstaged/Untracked
<summary>Metrics - Shows performance analytics from your Claude sessions</summary>
"metrics": {
  "enabled": true,
  "showResponseTime": true,
  "showLastResponseTime": false,
  "showDuration": true,
  "showMessageCount": true,
  "showLinesAdded": true,
  "showLinesRemoved": true
}

Options:

  • showResponseTime: Total API duration across all requests
  • showLastResponseTime: Individual response time for most recent query
  • showDuration: Total session duration
  • showMessageCount: Number of user messages sent
  • showLinesAdded: Lines of code added during session
  • showLinesRemoved: Lines of code removed during session

Symbols:

  • Total API time • Δ Last response • Session duration • Messages • + Lines added • - Lines removed
<summary>Model - Shows current Claude model being used</summary>
"model": {
  "enabled": true
}
<summary>Context - Shows context window usage and auto-compact threshold</summary>
"context": {
  "enabled": true,
  "showPercentageOnly": false
}

Options:

  • showPercentageOnly: Show only percentage remaining (default: false)

Display: ◔ 34,040 (79%) or ◔ 79% (percentage only)

Model Context Limits

Configure context window limits for different model types. Defaults to 200K tokens for all models.

"modelContextLimits": {
  "sonnet": 1000000,
  "opus": 200000
}

Available Model Types:

  • sonnet: Claude Sonnet models (3.5, 4, etc.)
  • opus: Claude Opus models
  • default: Fallback for unrecognized models (200K)

Note: Sonnet 4's 1M context window is currently in beta for tier 4+ users. Set "sonnet": 1000000 when you have access.

<summary>Tmux - Shows tmux session name and window info when in tmux</summary>
"tmux": {
  "enabled": true
}

Display: tmux:session-name

<summary>Version - Shows Claude Code version</summary>
"version": {
  "enabled": true
}

Display: v1.0.81

<summary>Session - Shows real-time usage for current Claude conversation</summary>
"session": {
  "enabled": true,
  "type": "tokens",
  "costSource": "calculated"
}

Options:

  • type: Display format - cost | tokens | both | breakdown
  • costSource: Cost calculation method - calculated (ccusage-style) | official (hook data)

Symbols: § Session

<summary>Block - Shows usage within current 5-hour billing window (Claude's rate limit period)</summary>
"block": {
  "enabled": true,
  "type": "weighted",
  "burnType": "cost"
}

Options:

  • type: Display format - cost | tokens | both | time | weighted
  • burnType: Burn rate display - cost | tokens | both | none

Weighted Tokens: Opus tokens count 5x toward rate limits compared to Sonnet/Haiku tokens

Symbols: Block

<summary>Today - Shows total daily usage with budget monitoring</summary>
"today": {
  "enabled": true,
  "type": "cost"
}

Options:

  • type: Display format - cost | tokens | both | breakdown

Symbols: Today

Budget Configuration

"budget": {
  "session": { "amount": 10.0, "warningThreshold": 80 },
  "today": { "amount": 25.0, "warningThreshold": 80 },
  "block": { "amount": 15.0, "type": "cost", "warningThreshold": 80 }
}

Options:

  • amount: Budget limit (required for percentage display)
  • type: Budget type - cost (USD) | tokens (for token-based limits)
  • warningThreshold: Warning threshold percentage (default: 80)

Indicators: 25% Normal • +75% Moderate (50-79%) • !85% Warning (80%+)

[!TIP]
Claude's rate limits consider multiple factors beyond tokens (message count, length, attachments, model). See Anthropic's usage documentation for details.

Multi-line Layout

Prevent segment cutoff by organizing segments across multiple lines.

{
  "display": {
    "lines": [
      {
        "segments": {
          "directory": { "enabled": true },
          "git": { "enabled": true },
          "model": { "enabled": true }
        }
      },
      {
        "segments": {
          "session": { "enabled": true },
          "today": { "enabled": true },
          "context": { "enabled": true }
        }
      }
    ]
  }
}

[!NOTE]
Claude Code system messages may truncate long status lines. Multi-line layouts prevent segment cutoff and improve readability.

Colors & Themes

Create custom themes and configure color compatibility:

{
  "theme": "custom",
  "display": {
    "colorCompatibility": "auto"
  },
  "colors": {
    "custom": {
      "directory": { "bg": "#ff6600", "fg": "#ffffff" },
      "git": { "bg": "#0066cc", "fg": "#ffffff" },
      "session": { "bg": "#cc0099", "fg": "#ffffff" }
    }
  }
}

Color Options: bg (hex, transparent, none) • fg (hex)

Compatibility Modes: auto (default), ansi, ansi256, truecolor. Respects NO_COLOR, FORCE_COLOR, and COLORTERM environment variables.

Performance

Execution times for different configurations:

  • ~80ms default config (directory, git, model, session, today, context)
  • ~240ms full-featured (all segments enabled)
<summary>Detailed Segment Timings</summary>
Segment Timing Notes
directory ~40ms No external commands
model ~40ms Uses hook data
session ~40ms Minimal transcript parsing
context ~40ms Hook data calculation
metrics ~40ms Transcript analysis
git ~60ms No caching for fresh data
tmux ~50ms Environment check + command
block ~180ms 5-hour window transcript load
today ~250ms Full daily transcript load (cached: ~50ms)
version ~40ms Uses hook data

Benchmark: npm run benchmark:timing

Optimization Tips

  • Global install: npm install -g to avoid npx overhead
  • Disable unused segments for faster execution
  • Cache cleanup: Remove ~/.claude/powerline/ if needed

Custom Segments

Extend the statusline using shell composition:

{
  "statusLine": {
    "type": "command",
    "command": "npx -y @owloops/claude-powerline && echo \" $(date +%H:%M)\"",
    "padding": 0
  }
}

[!NOTE]
Use tput for colors: setab <bg> (background), setaf <fg> (foreground), sgr0 (reset). Example: echo "$(tput setab 4)$(tput setaf 15) text $(tput sgr0)". For complex logic, create a shell script with multiple commands, conditions, and variables.

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

See CONTRIBUTORS.md for people who have contributed outside of GitHub PRs.

License

This project is licensed under the MIT License.

changelog

1.9.15 (2025-09-22)

Bug Fixes

1.9.14 (2025-09-12)

Bug Fixes

  • ensure budget limit percentages display consistently across session and block segments (9ad393f)

1.9.13 (2025-09-04)

Bug Fixes

  • remove font installer and document nerd fonts as requirement (1ffdbba)

1.9.12 (2025-09-02)

Bug Fixes

  • add capsule style with pill-shaped segments (46ace72)

1.9.11 (2025-09-02)

Bug Fixes

  • add git repository detection from subdirectories (fe0b89c)

1.9.10 (2025-09-01)

Bug Fixes

  • add sea build in gitignore (96bd0e4)

1.9.9 (2025-08-27)

Bug Fixes

  • add live demo gif and improve readme organization (7c02c18)

1.9.8 (2025-08-27)

Bug Fixes

  • remove redundancy and improve documentation clarity (23d5a21)

1.9.7 (2025-08-27)

Bug Fixes

  • improve readme structure and organization (5677258)

1.9.6 (2025-08-27)

Bug Fixes

  • add configurable model context limits to fix sonnet 1m context percentages (8e12362)

1.9.5 (2025-08-25)

Bug Fixes

  • add color depth-optimized theme variants for terminal compatibility (8d37da5)
  • isolate test environment variables for CI compatibility (ed0b292)

1.9.4 (2025-08-22)

Bug Fixes

  • include cache tokens in burn rate calculation (3050149)

1.9.3 (2025-08-22)

Bug Fixes

1.9.2 (2025-08-22)

Bug Fixes

  • add unified budget system with cost and token limits for all segments (fe80730)

1.9.1 (2025-08-22)

Bug Fixes

  • add explicit ccusage and official cost data options for session segment (968db3e)
  • improve stale cache lock detection for better performance (83eef85)

Reverts

  • Revert "feat: use authentic hook data and remove pricing service" (b492350)

1.9.0 (2025-08-22)

Features

  • use authentic hook data and remove pricing service (be45e23)

1.8.0 (2025-08-21)

Features

  • add 24h ttl for pricing cache (7bb06a1)

1.7.10 (2025-08-21)

Bug Fixes

  • remove git caching for real-time data (415bfda)

1.7.9 (2025-08-21)

Bug Fixes

  • improve git cache invalidation to track remote refs (53dc664)

1.7.8 (2025-08-21)

Bug Fixes

  • add hook data total cost as a fallback (8906cf7)

1.7.7 (2025-08-21)

Bug Fixes

  • add hook data optimization for metrics segment with lines added/removed tracking (27ecf72)

1.7.6 (2025-08-21)

Bug Fixes

  • optimize version segment to use hook data instead of external command (40fa808)
  • version tests (dc354fe)

1.7.5 (2025-08-21)

Bug Fixes

  • optimize today segment with efficient file and time filters (5e281f2)

1.7.4 (2025-08-21)

Bug Fixes

  • optimize git operations with hybrid sequential/parallel execution strategy (c626e40)

1.7.3 (2025-08-21)

Bug Fixes

1.7.2 (2025-08-21)

Bug Fixes

  • benchmark table, defaults and segments test (23a989b)
  • default config benchmark in readme (6c598ed)

1.7.1 (2025-08-21)

Bug Fixes

  • implement smart cache invalidation and optimize pricing lookups (92b16af)
  • tests and add benchmark script (3e2c6db)

1.7.0 (2025-08-21)

Features

  • optimize segment caching with memory-only for time-sensitive data and dual caching for stable data (a1c0051)

1.6.9 (2025-08-21)

Bug Fixes

  • invalid json in example settings usage (#13) (be985f1)

1.6.8 (2025-08-20)

Bug Fixes

  • improve git branch detection with fallback for older versions (8b7fd90)

1.6.7 (2025-08-19)

Bug Fixes

  • improve README segment configuration readability with separators (8f11c3a)

1.6.6 (2025-08-19)

Bug Fixes

  • move time formatting functions to utils/formatters (a8d5943)

1.6.5 (2025-08-19)

Bug Fixes

  • improve powerline renderer maintainability with dedicated segment methods (0b491b1)

1.6.4 (2025-08-19)

Bug Fixes

  • modernize networking, optimize build config, and clean up exports (7a8ec28)

1.6.3 (2025-08-19)

Bug Fixes

  • optimize bundle size with minify, treeshake, and node18 target (4a72b44)

1.6.2 (2025-08-17)

Bug Fixes

  • update npm downloads badge to correct package name (9e70dac)

1.6.1 (2025-08-17)

Bug Fixes

  • streamline documentation and remove unused cli flags (eaae545)

1.6.0 (2025-08-15)

Features

  • add comprehensive segments demo and improve defaults (08e8590)

1.5.6 (2025-08-15)

Bug Fixes

  • enhance example config with comprehensive segment showcase (8993ba4)

1.5.5 (2025-08-15)

Bug Fixes

  • add support for transparent backgrounds in custom themes (2889535)
  • restore original config colors (7b5a379)

1.5.4 (2025-08-15)

Bug Fixes

  • add ttl cache to version segment for update detection (340d1b5)
  • add version segment to display claude version (ed60aa5), closes #8

1.5.3 (2025-08-14)

Bug Fixes

  • resolve cost calculation discrepancies and move burn rates to block segment (bc0eb51)
  • update test expectations for dynamic block time calculations (a209ed0)

1.5.2 (2025-08-14)

Bug Fixes

  • standardize directory basename option to showBasename (b5646f1)

1.5.1 (2025-08-14)

Bug Fixes

  • streamline documentation by removing unused troubleshooting section (d5272ee)

1.5.0 (2025-08-14)

Features

  • add today and block usage segments with timezone fixes (fa2e552)

1.4.5 (2025-08-14)

Bug Fixes

  • enhance claude path discovery with multi-path and environment support (04b6e6f)

1.4.4 (2025-08-14)

Bug Fixes

  • simplify config loader and add comprehensive tests (3e61806)

1.4.3 (2025-08-14)

Bug Fixes

  • improve performance and reliability with caching and timeouts (4b3bc15)

1.4.2 (2025-08-13)

Bug Fixes

  • add contributors documentation for community contributions (f006a47)

1.4.1 (2025-08-13)

Bug Fixes

  • improve metrics accuracy and directory/git context handling (e722f46)

1.4.0 (2025-08-13)

Features

  • add metrics segment with response time and burn rate calculations (1c1a7b5)

1.3.2 (2025-08-13)

Bug Fixes

  • filter pricing data to core models only (eb5e5d5)

1.3.1 (2025-08-13)

Bug Fixes

  • improve stdin error message (c582628)
  • remove deprecated features (6b3bae0)

1.3.0 (2025-08-13)

Bug Fixes

  • clean state visuals (6706b32)
  • empty tokens test (0dcf9eb)
  • restructure codebase with segments/utils folders, external pricing system, and improved session tracking without ccusage dependency (39bc3d7)

Features

  • add context segment and reorganize types (2fb3062)

1.2.1 (2025-08-13)

Bug Fixes

  • skip external calls when segments disabled (7544b72)

1.2.0 (2025-08-13)

Features

  • add debug logging for troubleshooting (bff8483)

1.1.15 (2025-08-13)

Bug Fixes

  • eliminate git error messages and improve tty user experience (98a28aa)

1.1.14 (2025-08-13)

Bug Fixes

  • add claude interface screenshot with setup clarifications (669c818)
  • usage flag now respects configuration priority order (7656185)

1.1.13 (2025-08-12)

Bug Fixes

  • add custom segments documentation with shell composition (c447d04)

1.1.12 (2025-08-12)

Bug Fixes

  • resolve style options empty output and improve type safety (589c1c9)

1.1.11 (2025-08-12)

Bug Fixes

  • replace synchronous stdin reading with native stream/consumers for npx compatibility (39d45d6)

1.1.10 (2025-08-12)

Bug Fixes

  • replace get-stdin with native fs.readFileSync for better maintainability (50ba1ff)

1.1.9 (2025-08-12)

Bug Fixes

  • document live config reload and clean up roadmap (8944e59)

1.1.8 (2025-08-12)

Bug Fixes

  • remove leftover statement from readme (0ca0c31)

1.1.7 (2025-08-12)

Bug Fixes

  • implement missing --usage cli option and reorganize documentation (952a408)

1.1.6 (2025-08-12)

Bug Fixes

  • add popular themes with validation and modernize readme showcase (e1a513d)

1.1.5 (2025-08-12)

Bug Fixes

  • refactor theme system with minimal style and built-in themes (47c4d37)
  • update tests for new theme system structure (e4ffbc3)

1.1.4 (2025-08-12)

Bug Fixes

  • resolve windows git segment path handling issues (f5fc23e)

1.1.3 (2025-08-12)

Bug Fixes

  • improve powerline arrow color transitions and prevent bleeding (1a46bd0)

1.1.2 (2025-08-11)

Bug Fixes

  • correct model segment color mapping and improve today segment visibility (c573e9e)

1.1.1 (2025-08-11)

Bug Fixes

  • use today segment by default instead of block segment for immediate data display (c55d7e5)

1.1.0 (2025-08-10)

Bug Fixes

  • update tests to match new default configuration structure (bccca4d)

Features

  • add session block tracking, token breakdown display, and enhanced theming (b2e15ec)

1.0.1 (2025-08-10)

Bug Fixes

  • update package references and expand font options (d019e8e)

1.0.0 (2025-08-10)

Bug Fixes

  • update github workflow to use main branch (85ac20b)
  • update semantic-release to use main branch (376aea4)

Features

  • initial implementation of vim-style powerline statusline for claude code (96c5210)