Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save cassidydotdk/01171b34d8241fbaf73dd93bad3a5dd1 to your computer and use it in GitHub Desktop.

Select an option

Save cassidydotdk/01171b34d8241fbaf73dd93bad3a5dd1 to your computer and use it in GitHub Desktop.

Claude Code Terminal Pro — Windows Port

Windows PowerShell port of claude-code-terminal-pro by rathi-prashant.

Gruvbox Dark status line for Claude Code showing model name, context usage progress bar, token count, working directory, and git branch.

✦ Opus 4 | [■■■■■■■■■□□□□□□□□□□□] 49% | ↯ 98k/200k | ◆ my-project | ⎋ main

Prerequisites

  • Windows 10/11 with Windows Terminal (for 24-bit color support)
  • PowerShell 5.1+ (pre-installed on Windows 10/11)
  • Git (for branch display)
  • No other dependencies — no jq, no bc, no WSL

Install

  1. Create the scripts directory and copy the script:
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.claude\scripts"
Copy-Item status-line.ps1 "$env:USERPROFILE\.claude\scripts\status-line.ps1"
  1. Add the statusLine block to ~/.claude/settings.json (replace YOUR_USERNAME):
{
  "statusLine": {
    "type": "command",
    "command": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"C:\\Users\\YOUR_USERNAME\\.claude\\scripts\\status-line.ps1\""
  }
}
  1. Restart Claude Code.

What changed from the original

Original (bash/Linux/macOS) This port (Windows PowerShell)
bash + jq + bc PowerShell 5.1 only, zero dependencies
jq -r for JSON ConvertFrom-Json (built-in)
bc for math [math]::Floor() / [math]::Round()
echo -e for ANSI [char]0x1b + Write-Host
`u{XXXX} (PS 7+) [char]0xXXXX (PS 5.1 compatible)
basename Split-Path -Leaf
cd + git Push-Location/Pop-Location + git

Color Palette (Gruvbox Dark)

Element Color Hex
Model name Bright teal #56B6C2
Filled bar Gruvbox aqua #8EC07C
Empty bar Near-background #32302F
Brackets Gruvbox gray #665C54
Percentage Bright foreground #FBF1C7
Token count Warm yellow #E0AF68
Directory Green #98C379
Git branch Soft blue #8FAFD1
{
"statusLine": {
"type": "command",
"command": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"C:\\Users\\YOUR_USERNAME\\.claude\\scripts\\status-line.ps1\""
}
}
# Claude Code Status Line Script - Gruvbox Dark Theme (Windows PowerShell 5.1+)
# Port of claude-code-terminal-pro by rathi-prashant
# Format: [Model Name] | [Progress Bar] | [tokens_used/total_tokens] | [directory] | [git branch]
# Ensure UTF-8 output
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
# Read JSON input from stdin
$inputText = @($input) -join "`n"
if (-not $inputText) { exit }
try {
$data = $inputText | ConvertFrom-Json
} catch {
exit
}
# Extract values
$model_name = $data.model.display_name
$context_window_size = if ($data.context_window.context_window_size) { [long]$data.context_window.context_window_size } else { 200000 }
$used_percentage = if ($data.context_window.used_percentage) { [double]$data.context_window.used_percentage } else { 0 }
$cwd = $data.workspace.current_dir
# Unicode glyphs (compatible with PowerShell 5.1)
$SPARKLE = [char]0x2726 #
$FILLED = [char]0x25A0 #
$EMPTY = [char]0x25A1 #
$LIGHTNING = [char]0x21AF #
$DIAMOND = [char]0x25C6 #
$BRANCH = [char]0x238B #
# Gruvbox Dark color palette (ESC[38;2;R;G;Bm)
$ESC = [char]0x1b
$MODEL_COLOR = "$ESC[38;2;86;182;194m"
$BRACKET_COLOR = "$ESC[38;2;102;92;84m"
$EMPTY_BAR = "$ESC[38;2;50;48;47m"
$FILLED_BAR = "$ESC[38;2;142;192;124m"
$PCT_COLOR = "$ESC[38;2;251;241;199m"
$TOKEN_COLOR = "$ESC[38;2;224;175;104m"
$GIT_COLOR = "$ESC[38;2;143;175;209m"
$DIR_COLOR = "$ESC[38;2;152;195;121m"
$RESET = "$ESC[0m"
# Calculate tokens used from percentage
$tokens_used = if ($used_percentage -gt 0) { [math]::Floor($used_percentage * $context_window_size / 100) } else { 0 }
$parts = @()
# 1. Model name
if ($model_name) {
$parts += "${MODEL_COLOR}${SPARKLE} ${model_name}${RESET}"
}
# 2. Progress bar (20-segment, each = 5%)
if ($used_percentage -gt 0 -or $model_name) {
$bar = "${BRACKET_COLOR}[${RESET}"
for ($i = 1; $i -le 20; $i++) {
$threshold = $i * 5
if ($used_percentage -ge $threshold) {
$bar += "${FILLED_BAR}${FILLED}${RESET}"
} else {
$bar += "${EMPTY_BAR}${EMPTY}${RESET}"
}
}
$bar += "${BRACKET_COLOR}]${RESET}"
$pct_int = [math]::Round($used_percentage)
$parts += "${bar} ${PCT_COLOR}${pct_int}%${RESET}"
}
# 3. Token count
if ($tokens_used -gt 0) {
$tokens_k = [math]::Floor($tokens_used / 1000)
$window_k = [math]::Floor($context_window_size / 1000)
$parts += "${TOKEN_COLOR}${LIGHTNING} ${tokens_k}k/${window_k}k${RESET}"
}
# 4. Directory
if ($cwd) {
$dir_name = Split-Path $cwd -Leaf
$parts += "${DIR_COLOR}${DIAMOND} ${dir_name}${RESET}"
}
# 5. Git branch
if ($cwd -and (Test-Path $cwd)) {
Push-Location $cwd
try {
& git rev-parse --git-dir 2>$null | Out-Null
if ($LASTEXITCODE -eq 0) {
$branch = & git --no-optional-locks branch --show-current 2>$null
if ($branch) {
$parts += "${GIT_COLOR}${BRANCH} ${branch}${RESET}"
}
}
} finally {
Pop-Location
}
}
# Output
Write-Host ($parts -join " | ") -NoNewline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment