Skip to main content

Status Line Script

An enhanced multi-line status line for Claude Code that displays comprehensive session information directly in your terminal.

Overview

The status line script provides real-time visibility into your Claude Code session, showing model information, git status, context window usage, token counts, session costs, and your remaining PwC Coding Agents budget.

What It Shows

The status line displays two lines of information:

Line 1: Session Context

  • Current model name (e.g., Opus, Sonnet)
  • Current directory
  • Git branch with staged and modified file counts

Line 2: Usage Metrics

  • Context window usage (visual progress bar + percentage)
  • Session token counts (input and output)
  • Session cost
  • Session duration
  • PwC Coding Agents Budget remaining

Example Output

[Opus] my-project | main +2 ~3
------- Context Window: 45% | Session Tokens: 125.0K 45.0K | Session Cost: $11.94 | Session Time: 1h3m | PwC Coding Agents Budget: 26% (286/1100)

Status Line Example

Budget Indicators

The budget display uses color-coded indicators based on usage:

ColorMeaning
GreenLess than 70% of budget used
YellowBetween 70% and 90% of budget used
RedMore than 90% of budget used

Prerequisites

Before installing, ensure you have:

  • jq installed (JSON processor)

    # macOS
    brew install jq

    # Linux (Debian/Ubuntu)
    apt install jq
  • ANTHROPIC_BASE_URL configured to point to the PwC AI-CoE Coding Agents Gateway (see Claude Code Configuration)

Installation

Step 1: Download the Script

Download the status line script:

📥 Download statusline.sh

Or download directly via terminal:

curl -o ~/.claude/statusline.sh https://idi-coding-agents.pwc.it/guide/scripts/statusline.sh

Step 2: Install the Script

If you downloaded via browser, copy the script to your Claude configuration directory:

cp ~/Downloads/statusline.sh ~/.claude/statusline.sh

If you used the curl command above, the script is already in place.

Step 3: Make It Executable

chmod +x ~/.claude/statusline.sh

Step 4: Configure Claude Code

Add the following to your ~/.claude/settings.json:

{
"statusLine": {
"type": "command",
"command": "~/.claude/statusline.sh"
}
}

If you already have other settings in your settings.json, merge the statusLine configuration with your existing settings.

How It Works

The script:

  1. Reads Claude Code's internal session data to get model, token, and context information
  2. Queries the current git repository for branch and file status
  3. Calls the PwC AI-CoE Coding Agents Gateway /quota/status endpoint to fetch your remaining budget
  4. Formats all information into a compact, readable status line

The status line updates automatically as you interact with Claude Code.

Troubleshooting

Status Line Not Appearing

  1. Verify the script is executable:

    ls -la ~/.claude/statusline.sh
  2. Check that the script runs without errors:

    ~/.claude/statusline.sh
  3. Ensure your settings.json syntax is valid (no trailing commas, proper JSON format)

Budget Not Showing

  1. Confirm ANTHROPIC_BASE_URL is set correctly in your settings.json
  2. Verify you can reach the gateway:
    curl -s https://idi-coding-agents.pwc.it/quota/status
  3. Ensure you are connected to the PwC VPN

jq Errors

If you see errors related to jq, ensure it is installed and available in your PATH:

which jq

If not found, install it using the commands in the Prerequisites section.