Claude Powerline

repository·main·Indexed 22 days ago

https://github.com/owloops/claude-powerline

A vim-style powerline statusline for Claude Code featuring real-time usage tracking, git integration, and custom themes. It provides segments for directory paths, git branch status, session costs/tokens, context window usage, and prompt cache TTL tracking. Supports multiple visual styles (minimal, powerline, capsule, tui) and can be configured via an interactive Setup Wizard, a web-based Powerline Studio, or JSON configuration files.

Tokens
16.1K
Snippets
50
Records
78
Agent score
78%

What's inside @owloops/claude-powerline

  1. Customize the TUI Grid Layout

    main

    If you are using a TUI (Terminal User Interface) style, you can fine-tune the layout by editing the display.tui section in ~/.claude/claude-powerline.json.

    Layout Customization Options

    • Box Style: Change borders by adding a "box" key. Presets include: rounded, square, heavy, double, dashed, heavy-dashed, mixed, ascii, and invisible.
    • Title/Footer: Customize title.left, title.right, footer.left, and footer.right using segment tokens like {model.icon}, {dir}, or {weekly.pct}.
    • Grid Areas: Rearrange cells in breakpoints[].areas. Use . for empty cells, --- for dividers, or repeat a name across adjacent cells to span columns.
    • Custom Colors: Use dot-notation keys in colors.custom (e.g., "context.bar": { "fg": "#4a9eff" }).
    • Responsive Breakpoints: Define different layouts for different terminal widths using minWidth. The engine selects the largest minWidth that fits the current terminal.
    • Column Sizing: Use "auto" (fit content), "1fr" (fill remaining space), or a fixed integer (e.g., "20").
  2. Configure Claude Powerline file locations and priority

    main

    Claude Powerline looks for configuration files in the following order of priority:

    1. ./.claude-powerline.json (Project-specific)
    2. ~/.claude/claude-powerline.json (User config)
    3. ~/.config/claude-powerline/config.json (XDG standard)

    Override Priority: CLI flags > Environment variables > Config files > Defaults.

    Config files reload automatically; no restart is required for changes to take effect.

  3. Claude Powerline Requirements and Prerequisites

    main

    To use Claude Powerline, ensure your environment meets the following requirements:

    • Node.js: version 18 or higher.
    • Claude Code: installed and available.
    • Git: version 2.0 or higher.
    • Fonts: For the best visual experience (including icons), install a Nerd Font.

    Note on Symbols: If you cannot use a Nerd Font, you can use the --charset=text flag to switch to ASCII-only symbols.

  4. Install Node.js for Claude Powerline

    main

    Claude Powerline requires Node.js 18+ to function. If your system does not meet this requirement, install it using your package manager:

    macOS

    brew install node

    Ubuntu/Debian

    curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
    sudo apt-get install -y nodejs
    node --version
  5. Configure Claude Powerline via Setup Wizard

    main

    The Claude Powerline statusline for Claude Code is configured through an interactive setup wizard. The wizard guides you through selecting themes, styles, and segments, and ultimately writes the configuration as a JSON file to ~/.claude/claude-powerline.json.

    Wizard Workflow

    1. Node.js Check: Verifies Node.js 18+ is installed.
    2. Nerd Font Detection: Tests if your terminal can render Nerd Font glyphs. If icons appear as boxes, the wizard sets charset=text; otherwise, it uses charset=unicode.
    3. Theme Selection: Choose from dark (default), light, nord, tokyo-night, rose-pine, or gruvbox.
    4. Style Selection: Choose a visual style:
      • minimal, powerline, capsule: Standard statusline styles.
      • tui: A Terminal User Interface layout (skips standard segment selection).
    5. Layout/Segment Configuration:
      • If TUI style was chosen: Select a TUI layout (compact, standard, or full).
      • If standard style was chosen: Select a segment preset (essential, standard, or full).
    6. Bar Display Style: For progress indicators (context, block, and weekly segments), choose from text, bar, blocks, dots, geometric, or line.
    7. Budget (Optional): If using the full TUI layout, you can set a daily spending budget for cost tracking warnings.
    # Note: The wizard is an interactive process run within Claude Code.
  6. Configure Claude Powerline via the Setup Wizard

    main

    The Claude Powerline Setup Wizard automates the creation of configuration files and the integration of the statusline into Claude Code.

    Configuration Files Created/Updated

    • ~/.claude/claude-powerline.json: Contains the powerline visual configuration (themes, styles, segments).
    • ~/.claude/settings.json: Updated to include the statusLine command configuration.

    Integration with Claude Code

    To enable the statusline, your ~/.claude/settings.json must contain the following statusLine key:

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

    Post-Installation

    1. Restart Claude Code if the statusline does not appear immediately.
    2. Reconfigure: Run /powerline within Claude Code at any time to restart the setup process.
    3. Manual Edits: For advanced customization, edit ~/.claude/claude-powerline.json directly.
  7. Install Claude Powerline manually

    main

    If you prefer manual configuration, you can add Claude Powerline to your Claude Code settings.json file. Using npx ensures that the latest version is downloaded and executed automatically without requiring manual package updates.

    Add the following configuration to your settings.json:

    {
      "statusLine": {
        "type": "command",
        "command": "npx -y @owloops/claude-powerline@latest --style=powerline"
      }
    }
  8. Preview your Powerline statusline

    main

    After installation, you can verify that your statusline renders correctly by running the preview script with your chosen parameters. This allows you to see the visual output in your terminal before relying on it in Claude Code.

    Use the following command structure, replacing the placeholders with your actual configuration values:

    ${CLAUDE_PLUGIN_ROOT}/bin/preview.sh --theme=${chosen_theme} --style=${chosen_style} --charset=${charset}
  9. Install Claude Powerline via Setup Wizard

    main

    The recommended way to install Claude Powerline is using the interactive Setup Wizard inside Claude Code. This wizard automates the configuration of themes, styles, fonts, segments, and budget tracking. It automatically writes the configuration to ~/.claude/claude-powerline.json and updates your Claude Code settings.json.

    Run these commands one at a time inside a Claude Code session:

    1. Add the plugin to the marketplace.
    2. Install the specific package.
    3. Launch the powerline command to start the wizard.
    /plugin marketplace add Owloops/claude-powerline
    /plugin install claude-powerline@claude-powerline
    /powerline
  10. Use the browser-safe entry point for Claude Powerline

    main

    The src/browser.ts file serves as the browser-safe entry point for @owloops/claude-powerline. It exports all rendering modules, themes, types, and utilities required to generate statusline output without relying on Node.js built-in modules.

    Note: Data providers (such as git, session, or metrics) are NOT exported here. When using this entry point, you must supply pre-built data objects (e.g., GitInfo, UsageInfo, MetricsInfo) directly to the rendering functions.

  11. Configure model context limits

    main

    The ContextProvider determines the context limit based on the modelId provided. It maps model IDs to specific limits using the following logic:

    • Sonnet models: Uses the sonnet limit defined in PowerlineConfig.modelContextLimits.
    • Opus models: Uses the opus limit defined in PowerlineConfig.modelContextLimits.
    • Other models: Falls back to the default limit in modelContextLimits.
    • Global Fallback: If no limits are configured, it defaults to 200,000 tokens.

    Ensure your PowerlineConfig object contains a modelContextLimits mapping to override these defaults for specific model families.