Skip to content

Instantly share code, notes, and snippets.

@AKCodez
Last active July 10, 2026 18:23
Show Gist options
  • Select an option

  • Save AKCodez/ffb420ba6a7662b5c3dda2edce7783de to your computer and use it in GitHub Desktop.

Select an option

Save AKCodez/ffb420ba6a7662b5c3dda2edce7783de to your computer and use it in GitHub Desktop.
Claude Code Status Line - Complete Guide: all fields, config, ready-to-use scripts

Claude Code Status Line - Complete Guide: all fields, config, ready-to-use scripts

Claude Code Status Line β€” Complete Guide

A persistent, customizable bar at the bottom of Claude Code that shows real-time session data.

image

Table of Contents


What Is It?

The status line is an info bar pinned to the bottom of your Claude Code window. Think of it like the status bar in VS Code or the bottom of a Google Doc β€” it just sits there showing you useful stuff while you work.

What can it show?

  • Which AI model you're using
  • Your project name and git branch
  • How much of your conversation memory is used up (context %)
  • How much the session has cost so far
  • How long you've been working
  • Lines of code added / removed
  • …and more

How does it work? You tell Claude what you want to see, and it builds the status bar for you. No coding required on your part β€” just describe it in plain English.

Does it cost anything? Nope. It runs entirely on your machine. Zero API usage.


Quick Start

Just type a /statusline command describing what you want:

/statusline show model name and context percentage with a progress bar

Claude generates the script, saves it, and wires up settings for you. Done.

More examples:

/statusline show repo name, git branch, context bar, and model
/statusline show cost and session duration with model name
/statusline show git branch with colored staged/modified file counts
/statusline two lines: model and branch on top, color-coded context bar with cost on bottom

To remove it:

/statusline clear

Want Mine?

Here's the exact status line I use daily. Fully color-coded with icons and a gradient context bar.

What it looks like:

image
Element Example Color
Repo name EasyClaw Bold yellow
Branch 🌿 (main) Bold cyan
Context bar ⚑ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 47% True RGB gradient (green β†’ yellow β†’ red) + dynamic emoji
Context emoji 🟒 β†’ ⚑ β†’ πŸ”₯ β†’ 🚨 Changes at 20% / 70% / 90%
Cost $0.47 Yellow
Code velocity +156 -23 Green adds, red deletes
Model πŸ€– Opus 4.6 Magenta
Separators | Dim gray

One command to get it:

/statusline single line, fully color-coded with truecolor RGB gradient: repo name bold yellow, 🌿 leaf icon + git branch in bold cyan with parentheses, 20-block context bar using 24-bit RGB gradient from green(0,200,80) through yellow(220,200,0) to red(220,40,20) with dark gray(60,60,60) empty blocks, dynamic emoji that changes with usage (🟒 under 20%, ⚑ 20-69%, πŸ”₯ 70-89%, 🚨 90%+), percentage colored by usage level, session cost in yellow, code velocity showing +lines in green and -lines in red, πŸ€– robot icon + model name in magenta, dim gray pipe separators between all elements

Or copy the script directly:

#!/usr/bin/env bash
# Claude Code status line: RGB gradient, dynamic emoji, cost, code velocity

input=$(cat)

# ── Colors ──
CYAN='\033[36m'
GREEN='\033[32m'
YELLOW='\033[33m'
RED='\033[31m'
MAGENTA='\033[35m'
DIM='\033[2m'
BOLD='\033[1m'
RESET='\033[0m'

# ── Truecolor helper ──
rgb() { printf '\033[38;2;%d;%d;%dm' "$1" "$2" "$3"; }

# ── Parse JSON fields ──
model=$(echo "$input" | jq -r '.model.display_name // "Unknown"')
used=$(echo "$input" | jq -r '.context_window.used_percentage // empty')
cost=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')
lines_add=$(echo "$input" | jq -r '.cost.total_lines_added // 0')
lines_del=$(echo "$input" | jq -r '.cost.total_lines_removed // 0')
cwd=$(echo "$input" | jq -r '.workspace.current_dir // .cwd // ""')

# ── Git info ──
branch=""
repo=""
if [ -n "$cwd" ]; then
  branch=$(git -C "$cwd" --no-optional-locks symbolic-ref --short HEAD 2>/dev/null)
  repo=$(basename "$(git -C "$cwd" --no-optional-locks rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null)
fi

# ── Context bar: RGB gradient, full blocks only ──
BAR_WIDTH=20

if [ -n "$used" ]; then
  used_int=$(printf '%.0f' "$used")

  # Round to nearest block
  filled=$(( (used_int * BAR_WIDTH + 50) / 100 ))

  bar=""
  for (( i=0; i<BAR_WIDTH; i++ )); do
    pos=$(( i * 100 / (BAR_WIDTH - 1) ))

    if [ "$pos" -le 50 ]; then
      r=$(( 0 + 220 * pos / 50 ))
      g=200
      b=$(( 80 - 80 * pos / 50 ))
    else
      adj=$(( pos - 50 ))
      r=220
      g=$(( 200 - 160 * adj / 50 ))
      b=$(( 0 + 20 * adj / 50 ))
    fi

    if [ "$i" -lt "$filled" ]; then
      bar="${bar}$(rgb $r $g $b)β–ˆ"
    else
      bar="${bar}\033[38;2;60;60;60mβ–‘"
    fi
  done
  bar="${bar}${RESET}"

  if [ "$used_int" -ge 90 ]; then status_emoji="🚨"
  elif [ "$used_int" -ge 70 ]; then status_emoji="πŸ”₯"
  elif [ "$used_int" -ge 20 ]; then status_emoji="⚑"
  else status_emoji="🟒"; fi

  if [ "$used_int" -ge 90 ]; then pct_color="$RED"
  elif [ "$used_int" -ge 70 ]; then pct_color="$YELLOW"
  else pct_color="$GREEN"; fi

  ctx_part="${status_emoji} ${bar} ${pct_color}${used_int}%${RESET}"
else
  ctx_part="🟒 \033[38;2;60;60;60mβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘${RESET} --%"
fi

# ── Cost ──
cost_part="${YELLOW}$(printf '$%.2f' "$cost")${RESET}"

# ── Code velocity ──
velocity="${GREEN}+${lines_add}${RESET} ${RED}-${lines_del}${RESET}"

# ── Single line ──
out=""
[ -n "$repo" ] && out="${BOLD}${YELLOW}${repo}${RESET}"
[ -n "$branch" ] && out="${out:+$out }${BOLD}${CYAN}🌿 (${branch})${RESET}"
out="${out:+$out ${DIM}|${RESET} }${ctx_part}"
out="${out} ${DIM}|${RESET} ${cost_part}"
out="${out} ${DIM}|${RESET} ${velocity}"
out="${out} ${DIM}|${RESET} ${MAGENTA}πŸ€– ${model}${RESET}"

printf '%b' "$out"

Available Data Fields

Every time your script runs, it receives JSON via stdin. Here is everything you can display.

Model and Session

Field What It Shows Example Value
model.id Model identifier "claude-opus-4-6"
model.display_name Friendly model name "Opus"
session_id Unique session ID "abc123..."
session_name Custom name (via /rename) "my-feature-work"
version Claude Code version "2.1.90"

Workspace

Field What It Shows Example Value
cwd Current working directory "/Users/me/project"
workspace.current_dir Same as cwd (preferred) "/Users/me/project"
workspace.project_dir Where Claude Code was launched "/Users/me/project"
workspace.added_dirs Extra dirs added via /add-dir []
workspace.git_worktree Git worktree name (if in one) "feature-xyz"

Context Window

Field What It Shows Example
context_window.used_percentage % of context used 30
context_window.remaining_percentage % of context remaining 70
context_window.context_window_size Max tokens (200K or 1M) 200000
context_window.total_input_tokens Cumulative input tokens 15234
context_window.total_output_tokens Cumulative output tokens 4521
context_window.current_usage.input_tokens Input tokens in last API call 8500
context_window.current_usage.output_tokens Output tokens from last call 1200
context_window.current_usage.cache_creation_input_tokens Tokens written to cache 5000
context_window.current_usage.cache_read_input_tokens Tokens read from cache 2000
exceeds_200k_tokens Last response exceeded 200K false

Cost and Duration

Field What It Shows Example Value
cost.total_cost_usd Total session cost (USD) 0.01234
cost.total_duration_ms Wall-clock time since start 45000
cost.total_api_duration_ms Time waiting for API responses 2300
cost.total_lines_added Lines of code added 156
cost.total_lines_removed Lines of code removed 23

Rate Limits (Claude.ai Pro/Max only)

Field What It Shows Example Value
rate_limits.five_hour.used_percentage 5-hour usage % 23.5
rate_limits.five_hour.resets_at Reset time (Unix epoch) 1738425600
rate_limits.seven_day.used_percentage 7-day usage % 41.2
rate_limits.seven_day.resets_at Reset time (Unix epoch) 1738857600

Optional Fields (appear only when relevant)

Field When It Appears Example Value
vim.mode When vim mode is enabled "NORMAL" or "INSERT"
output_style.name Current output style "default"
agent.name When using --agent flag "security-reviewer"
worktree.name During --worktree sessions "my-feature"
worktree.path Worktree directory path "/path/to/worktree"
worktree.branch Worktree git branch "worktree-my-feature"
worktree.original_cwd Dir before entering worktree "/path/to/project"
worktree.original_branch Branch before entering worktree "main"
transcript_path Path to conversation transcript "/path/to/transcript"

Your Script Superpowers

Multiple Lines

Each echo / print creates a separate row:

echo "Line 1: Model and branch info"
echo "Line 2: Context bar and cost"
+-----------------------------------------------------------------+
|  [Opus] EasyClaw | main                                          |
|  [####......] 40% | $0.23 | 12m 5s                               |
+-----------------------------------------------------------------+

ANSI Colors

Use escape codes for colored output:

GREEN='\033[32m'
YELLOW='\033[33m'
RED='\033[31m'
CYAN='\033[36m'
RESET='\033[0m'

echo -e "${GREEN}All good${RESET} | ${RED}Warning${RESET}"

Clickable Links

Use OSC 8 escape sequences (requires iTerm2, Kitty, or WezTerm):

printf '%b' "\e]8;;https://github.com/user/repo\aRepo Name\e]8;;\a"

Hold Cmd (macOS) or Ctrl (Windows/Linux) and click to open.


Ready-to-Use Scripts

Copy any of these and pass them to /statusline, or just describe what you want in plain English.

1. Context Bar + Model (Minimal)

[Opus] [###.......] 30%
#!/bin/bash
input=$(cat)

MODEL=$(echo "$input" | jq -r '.model.display_name')
PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)

BAR_WIDTH=10
FILLED=$((PCT * BAR_WIDTH / 100))
EMPTY=$((BAR_WIDTH - FILLED))
BAR=""
[ "$FILLED" -gt 0 ] && printf -v FILL "%${FILLED}s" && BAR="${FILL// /β–“}"
[ "$EMPTY" -gt 0 ] && printf -v PAD "%${EMPTY}s" && BAR="${BAR}${PAD// /β–‘}"

echo "[$MODEL] $BAR $PCT%"

2. Repo + Branch + Context + Model (Recommended)

EasyClaw (main)  [β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘] 30%  Claude Opus 4
#!/bin/bash
input=$(cat)

model=$(echo "$input" | jq -r '.model.display_name // "Unknown Model"')

used=$(echo "$input" | jq -r '.context_window.used_percentage // empty')
if [ -n "$used" ]; then
  used_int=$(printf '%.0f' "$used")
  filled=$(( used_int / 10 ))
  empty=$(( 10 - filled ))
  bar=""
  for i in $(seq 1 $filled); do bar="${bar}β–ˆ"; done
  for i in $(seq 1 $empty);  do bar="${bar}β–‘"; done
  ctx_part="[${bar}] ${used_int}%"
else
  ctx_part="[β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘] --%"
fi

cwd=$(echo "$input" | jq -r '.workspace.current_dir // .cwd // ""')
branch=""
repo=""
if [ -n "$cwd" ]; then
  branch=$(git -C "$cwd" --no-optional-locks symbolic-ref --short HEAD 2>/dev/null)
  repo=$(basename "$(git -C "$cwd" --no-optional-locks rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null)
fi

out=""
[ -n "$repo" ] && out="$repo"
[ -n "$branch" ] && out="${out:+$out }(${branch})"
out="${out:+$out  }${ctx_part}  ${model}"

printf '%s' "$out"

3. Git Status with Colors

[Opus] EasyClaw | main +2 ~5
#!/bin/bash
input=$(cat)

MODEL=$(echo "$input" | jq -r '.model.display_name')
DIR=$(echo "$input" | jq -r '.workspace.current_dir')

GREEN='\033[32m'; YELLOW='\033[33m'; RESET='\033[0m'

if git rev-parse --git-dir > /dev/null 2>&1; then
    BRANCH=$(git branch --show-current 2>/dev/null)
    STAGED=$(git diff --cached --numstat 2>/dev/null | wc -l | tr -d ' ')
    MODIFIED=$(git diff --numstat 2>/dev/null | wc -l | tr -d ' ')

    GIT_STATUS=""
    [ "$STAGED" -gt 0 ] && GIT_STATUS="${GREEN}+${STAGED}${RESET}"
    [ "$MODIFIED" -gt 0 ] && GIT_STATUS="${GIT_STATUS}${YELLOW}~${MODIFIED}${RESET}"

    echo -e "[$MODEL] ${DIR##*/} | $BRANCH $GIT_STATUS"
else
    echo "[$MODEL] ${DIR##*/}"
fi

4. Cost + Duration Tracker

[Opus] $0.23 | 12m 5s
#!/bin/bash
input=$(cat)

MODEL=$(echo "$input" | jq -r '.model.display_name')
COST=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')
DURATION_MS=$(echo "$input" | jq -r '.cost.total_duration_ms // 0')

COST_FMT=$(printf '$%.2f' "$COST")
DURATION_SEC=$((DURATION_MS / 1000))
MINS=$((DURATION_SEC / 60))
SECS=$((DURATION_SEC % 60))

echo "[$MODEL] $COST_FMT | ${MINS}m ${SECS}s"

5. Multi-Line with Color-Coded Context Bar

[Opus] EasyClaw | main
[####......] 40% | $0.23 | 12m 5s

Context bar changes color: green < 70% | yellow 70-89% | red 90%+

#!/bin/bash
input=$(cat)

MODEL=$(echo "$input" | jq -r '.model.display_name')
DIR=$(echo "$input" | jq -r '.workspace.current_dir')
COST=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')
PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)
DURATION_MS=$(echo "$input" | jq -r '.cost.total_duration_ms // 0')

CYAN='\033[36m'; GREEN='\033[32m'; YELLOW='\033[33m'; RED='\033[31m'; RESET='\033[0m'

if [ "$PCT" -ge 90 ]; then BAR_COLOR="$RED"
elif [ "$PCT" -ge 70 ]; then BAR_COLOR="$YELLOW"
else BAR_COLOR="$GREEN"; fi

FILLED=$((PCT / 10)); EMPTY=$((10 - FILLED))
printf -v FILL "%${FILLED}s"; printf -v PAD "%${EMPTY}s"
BAR="${FILL// /β–ˆ}${PAD// /β–‘}"

MINS=$((DURATION_MS / 60000)); SECS=$(((DURATION_MS % 60000) / 1000))

BRANCH=""
git rev-parse --git-dir > /dev/null 2>&1 && BRANCH=" | $(git branch --show-current 2>/dev/null)"

echo -e "${CYAN}[$MODEL]${RESET} ${DIR##*/}$BRANCH"
COST_FMT=$(printf '$%.2f' "$COST")
echo -e "${BAR_COLOR}${BAR}${RESET} ${PCT}% | ${YELLOW}${COST_FMT}${RESET} | ${MINS}m ${SECS}s"

6. Rate Limits (Pro/Max)

[Opus] 5h: 23% | 7d: 41%
#!/bin/bash
input=$(cat)

MODEL=$(echo "$input" | jq -r '.model.display_name')
FIVE_HR=$(echo "$input" | jq -r '.rate_limits.five_hour.used_percentage // empty')
SEVEN_DAY=$(echo "$input" | jq -r '.rate_limits.seven_day.used_percentage // empty')

out="[$MODEL]"
[ -n "$FIVE_HR" ] && out="$out 5h: $(printf '%.0f' "$FIVE_HR")%"
[ -n "$SEVEN_DAY" ] && out="$out | 7d: $(printf '%.0f' "$SEVEN_DAY")%"

echo "$out"

Full JSON Schema

This is the complete JSON your script receives on stdin:

{
  "cwd": "/current/working/directory",
  "session_id": "abc123...",
  "session_name": "my-session",
  "transcript_path": "/path/to/transcript.jsonl",
  "model": {
    "id": "claude-opus-4-6",
    "display_name": "Opus"
  },
  "workspace": {
    "current_dir": "/current/working/directory",
    "project_dir": "/original/project/directory",
    "added_dirs": [],
    "git_worktree": "feature-xyz"
  },
  "version": "2.1.90",
  "output_style": {
    "name": "default"
  },
  "cost": {
    "total_cost_usd": 0.01234,
    "total_duration_ms": 45000,
    "total_api_duration_ms": 2300,
    "total_lines_added": 156,
    "total_lines_removed": 23
  },
  "context_window": {
    "total_input_tokens": 15234,
    "total_output_tokens": 4521,
    "context_window_size": 200000,
    "used_percentage": 8,
    "remaining_percentage": 92,
    "current_usage": {
      "input_tokens": 8500,
      "output_tokens": 1200,
      "cache_creation_input_tokens": 5000,
      "cache_read_input_tokens": 2000
    }
  },
  "exceeds_200k_tokens": false,
  "rate_limits": {
    "five_hour": {
      "used_percentage": 23.5,
      "resets_at": 1738425600
    },
    "seven_day": {
      "used_percentage": 41.2,
      "resets_at": 1738857600
    }
  },
  "vim": {
    "mode": "NORMAL"
  },
  "agent": {
    "name": "security-reviewer"
  },
  "worktree": {
    "name": "my-feature",
    "path": "/path/to/.claude/worktrees/my-feature",
    "branch": "worktree-my-feature",
    "original_cwd": "/path/to/project",
    "original_branch": "main"
  }
}

Fields that may be absent:

  • session_name -- only when set via --name or /rename
  • workspace.git_worktree -- only inside a linked git worktree
  • vim -- only when vim mode is enabled
  • agent -- only when using --agent
  • worktree -- only during --worktree sessions
  • rate_limits -- only for Claude.ai Pro/Max after first API response

Fields that may be null:

  • context_window.current_usage -- null before first API call
  • context_window.used_percentage -- may be null early in session

Tips and Tricks

Tip Details
When does it update? After each assistant message, permission mode change, or vim mode toggle. Debounced at 300ms.
No API tokens used Status line runs locally -- completely free.
Hides during prompts Temporarily hidden during autocomplete, help menu, and permission prompts.
Can use any language Bash, Python, Node.js -- anything that reads stdin and prints to stdout.
Test your script Pipe sample JSON: `echo '{"model":{"display_name":"Opus"}}'

All Claude Code Settings

Every setting lives in settings.json. There are three levels, loaded in order (later overrides earlier):

Level Path Scope
User ~/.claude/settings.json All projects on your machine
Project .claude/settings.json (in repo root) Everyone on this repo
Managed ~/.claude/settings.managed.json Enterprise IT policy (read-only)

Core Settings

Setting Type Default What It Does
model string "claude-sonnet-4-6" Default model for all sessions
availableModels string[] all Restrict which models users can pick
effortLevel "auto" | "low" | "medium" | "high" varies Opus 4.6 reasoning depth β€” lower = faster & cheaper
fastMode boolean false 2.5x faster output, higher per-token cost (same model)
fastModePerSessionOptIn boolean false Require /fast each session instead of persisting
language string β€” Preferred language for Claude's responses
outputStyle string "default" Response style: default, Explanatory, Learning, or custom
alwaysThinkingEnabled boolean false Extended thinking on by default for all sessions

Status Line

Setting Type Default What It Does
statusLine.type "command" β€” Must be "command" to enable a custom status line
statusLine.command string β€” Shell command or script path that reads JSON stdin, prints status to stdout
statusLine.padding number 0 Extra horizontal spacing characters around the status line content

Permissions

Setting Type Default What It Does
permissions.defaultMode string "default" Default permission mode: default, plan, bypassPermissions, etc.
permissions.allow string[] [] Tools always allowed without asking
permissions.deny string[] [] Tools always denied
allowManagedPermissionRulesOnly boolean false (Managed only) Block user/project permission rules

Display & UI

Setting Type Default What It Does
spinnerTipsEnabled boolean true Show tips in the spinner while Claude works
spinnerTipsOverride object β€” Custom tip messages for the spinner
spinnerVerbs object β€” Custom verbs shown in spinner progress
terminalProgressBarEnabled boolean true Progress bar in terminals that support it (Windows Terminal, iTerm2)
showTurnDuration boolean true Show "Cooked for 1m 6s" after responses
prefersReducedMotion boolean false Disable UI animations (spinners, shimmer, flash) for accessibility
companyAnnouncements string[] β€” (Managed only) Startup messages, one picked randomly

Plugins & Marketplaces

Setting Type Default What It Does
enabledPlugins object {} Map of "plugin@marketplace": true to enable plugins
extraKnownMarketplaces object {} Additional plugin marketplace sources
pluginConfigs object {} Per-plugin configuration (MCP user configs, etc.)
skippedPlugins string[] [] Plugins you declined when prompted
skippedMarketplaces string[] [] Marketplaces you declined when prompted
strictKnownMarketplaces string[] β€” (Managed only) Allowlist of permitted marketplaces
blockedMarketplaces string[] β€” (Managed only) Blocked marketplace sources
pluginTrustMessage string β€” (Managed only) Custom message on plugin trust warning

MCP Servers

Setting Type Default What It Does
enableAllProjectMcpServers boolean false Auto-approve all MCP servers in the project
enabledMcpjsonServers string[] [] Approved MCP servers from .mcp.json
disabledMcpjsonServers string[] [] Rejected MCP servers from .mcp.json
allowedMcpServers string[] β€” Enterprise allowlist (undefined = allow all)
deniedMcpServers string[] β€” Enterprise denylist (takes precedence over allow)
allowManagedMcpServersOnly boolean false (Managed only) Only admin-defined MCP servers apply

Hooks

Setting Type Default What It Does
hooks object {} Custom commands before/after tool executions
disableAllHooks boolean false Kill all hooks and statusLine execution
allowManagedHooksOnly boolean false (Managed only) Block user/project/plugin hooks
allowedHttpHookUrls string[] β€” URL patterns HTTP hooks may target (supports * wildcard)
httpHookAllowedEnvVars string[] β€” Env vars HTTP hooks may use in headers

Files & Memory

Setting Type Default What It Does
respectGitignore boolean true @ file picker respects .gitignore patterns
autoMemoryEnabled boolean true Auto-save useful context to .claude/memory/
claudeMdExcludes string[] [] Glob patterns for CLAUDE.md files to skip loading
cleanupPeriodDays integer β€” Days to retain chat transcripts (0 = keep forever)
plansDirectory string "~/.claude/plans" Where plan files are stored
fileSuggestion object β€” Custom script for @ file autocomplete

Auth & Enterprise

Setting Type Default What It Does
apiKeyHelper string β€” Script path that outputs auth values
awsCredentialExport string β€” Script that exports AWS credentials
awsAuthRefresh string β€” Script that refreshes AWS auth
forceLoginMethod "claudeai" | "console" β€” Force login via Claude Pro/Max or Console billing
forceLoginOrgUUID string β€” Organization UUID for OAuth login
otelHeadersHelper string β€” Script that outputs OpenTelemetry headers

Other

Setting Type Default What It Does
includeGitInstructions boolean true Include git commit/PR workflow instructions in system prompt
attribution object β€” Customize attribution for git commits and PRs
autoUpdatesChannel "stable" | "latest" "latest" stable = ~1 week old, skips regressions. latest = newest
skipWebFetchPreflight boolean false Skip WebFetch blocklist check (enterprise)
sandbox object β€” Sandbox execution configuration
teammateMode "auto" | "tmux" | "iterm" | "in-process" "auto" How agent team teammates display
worktree object β€” Config for --worktree sessions
env object {} Environment variables for sessions (many hidden settings live here)

Key Environment Variables (via env)

These go inside the "env" object and unlock settings not available as top-level properties:

Variable What It Does
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY Max parallel tool calls (default varies)
CLAUDE_CODE_DISABLE_AUTO_MEMORY 1 to disable auto memory
CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS 1 to disable git instructions
CLAUDE_CODE_EFFORT_LEVEL Override effort level
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS 1 to enable agent teams
CLAUDE_CODE_ENABLE_TELEMETRY 1 to enable telemetry
CLAUDE_CODE_DEBUG_LOG_LEVEL verbose for debug logging
DISABLE_AUTOUPDATER 1 to disable auto-updates
ANTHROPIC_MODEL Runtime model override
CLAUDE_CODE_SUBAGENT_MODEL Model for subagents

Reference

@rfweknowdata

Copy link
Copy Markdown

Hey, I saw you StatusLine, liked it but I needed it in PS1 format for Windows system without WSL, because it can't run bash. I'm going to leave it here if anyone wants it, it's exactly your statusline bar but converted in PowerShell:

`
[Console]::InputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8

$raw = [Console]::In.ReadToEnd()
if (-not $raw.Trim()) { exit 0 }
$json = $raw | ConvertFrom-Json

$e = [char]27
function clr($r, $g, $b) { "${e}[38;2;${r};${g};${b}m" }
$DIM = "${e}[2m"
$BOLD = "${e}[1m"
$RESET = "${e}[0m"

$model = $json.model.display_name; if (-not $model) { $model = "Claude" }
$used = $json.context_window.used_percentage
$cost = $json.cost.total_cost_usd; if (-not $cost) { $cost = 0.0 }
$linesAdd = $json.cost.total_lines_added; if (-not $linesAdd) { $linesAdd = 0 }
$linesDel = $json.cost.total_lines_removed; if (-not $linesDel) { $linesDel = 0 }
$cwd = $json.workspace.current_dir
if (-not $cwd) { $cwd = $json.cwd }
if (-not $cwd) { $cwd = "" }

$branch = ""
$repo = ""
if ($cwd) {
$b = git -C "$cwd" --no-optional-locks symbolic-ref --short HEAD 2>$null
if ($b) { $branch = $b.Trim() }
$t = git -C "$cwd" --no-optional-locks rev-parse --show-toplevel 2>$null
if ($t) { $repo = Split-Path $t.Trim() -Leaf }
}

$W = 20
if ($null -ne $used -and "$used" -ne "") {
$pct = [int][math]::Round([double]$used)
$filled = [int][math]::Round($pct * $W / 100.0)

$bar = ""
for ($i = 0; $i -lt $W; $i++) {
    $pos = $i * 100.0 / ($W - 1)
    if ($pos -le 50) {
        $t = $pos / 50.0
        $r = [int]($t * 220); $g = 200; $b = [int](80 * (1 - $t))
    } else {
        $t = ($pos - 50) / 50.0
        $r = 220; $g = [int](200 - 160 * $t); $b = [int](20 * $t)
    }
    if ($i -lt $filled) { $bar += "$(clr $r $g $b)β–ˆ" }
    else                 { $bar += "$(clr 60 60 60)β–‘" }
}
$bar += $RESET

if ($pct -ge 90)     { $emoji = "🚨"; $pctClr = clr 220 40 20 }
elseif ($pct -ge 70) { $emoji = "πŸ”₯"; $pctClr = clr 220 200 0 }
elseif ($pct -ge 20) { $emoji = "⚑"; $pctClr = clr 0 200 80 }
else                 { $emoji = "🟒"; $pctClr = clr 0 200 80 }

$ctxSeg = "${emoji} ${bar} ${pctClr}${pct}%${RESET}"

} else {
$ctxSeg = "🟒 $(clr 60 60 60)$('β–‘' * 20)${RESET} --%"
}

$costStr = '$' + ('{0:F2}' -f [double]$cost)
$sep = " ${DIM}|${RESET} "

$parts = @()
if ($repo) { $parts += "${BOLD}$(clr 220 200 0)${repo}${RESET}" }
if ($branch) { $parts += "${BOLD}$(clr 0 180 220)🌿 (${branch})${RESET}" }
$parts += $ctxSeg
$parts += "$(clr 220 200 0)${costStr}${RESET}"
$parts += "$(clr 0 200 80)+${linesAdd}${RESET} $(clr 220 40 20)-${linesDel}${RESET}"
$parts += "$(clr 220 80 220)πŸ€– ${model}${RESET}"

[Console]::Write($parts -join $sep)
`

@AKCodez

AKCodez commented Apr 22, 2026

Copy link
Copy Markdown
Author

Hey, I saw you StatusLine, liked it but I needed it in PS1 format for Windows system without WSL, because it can't run bash. I'm going to leave it here if anyone wants it, it's exactly your statusline bar but converted in PowerShell:

` [Console]::InputEncoding = [System.Text.Encoding]::UTF8 [Console]::OutputEncoding = [System.Text.Encoding]::UTF8

$raw = [Console]::In.ReadToEnd() if (-not $raw.Trim()) { exit 0 } $json = $raw | ConvertFrom-Json

$e = [char]27 function clr($r, $g, Extra open brace or missing close brace $b) { "${e}[38;2;${r};${g};${b}m" } D I M = " {e}[2m" B O L D = " {e}[1m" R E S E T = " {e}[0m"

$model = $json.model.display_name; if (-not $model) { $model = "Claude" } $used = $json.context_window.used_percentage $cost = $json.cost.total_cost_usd; if (-not $cost) { $cost = 0.0 } $linesAdd = $json.cost.total_lines_added; if (-not $linesAdd) { $linesAdd = 0 } $linesDel = $json.cost.total_lines_removed; if (-not $linesDel) { $linesDel = 0 } $cwd = $json.workspace.current_dir if (-not $cwd) { $cwd = $json.cwd } if (-not $cwd) { $cwd = "" }

$branch = "" $repo = "" if ($cwd) { $b = git -C "$cwd" --no-optional-locks symbolic-ref --short HEAD 2>$null if ($b) { $branch = $b.Trim() } $t = git -C "$cwd" --no-optional-locks rev-parse --show-toplevel 2>$null if ($t) { $repo = Split-Path $t.Trim() -Leaf } }

$W = 20 if ($null -ne $used -and "$used" -ne "") { $pct = [int][math]::Round([double]$used) $filled = [int][math]::Round($pct * $W / 100.0)

$bar = ""
for ($i = 0; $i -lt $W; $i++) {
    $pos = $i * 100.0 / ($W - 1)
    if ($pos -le 50) {
        $t = $pos / 50.0
        $r = [int]($t * 220); $g = 200; $b = [int](80 * (1 - $t))
    } else {
        $t = ($pos - 50) / 50.0
        $r = 220; $g = [int](200 - 160 * $t); $b = [int](20 * $t)
    }
    if ($i -lt $filled) { $bar += "$(clr $r $g $b)β–ˆ" }
    else                 { $bar += "$(clr 60 60 60)β–‘" }
}
$bar += $RESET

if ($pct -ge 90)     { $emoji = "🚨"; $pctClr = clr 220 40 20 }
elseif ($pct -ge 70) { $emoji = "πŸ”₯"; $pctClr = clr 220 200 0 }
elseif ($pct -ge 20) { $emoji = "⚑"; $pctClr = clr 0 200 80 }
else                 { $emoji = "🟒"; $pctClr = clr 0 200 80 }

$ctxSeg = "${emoji} ${bar} ${pctClr}${pct}%${RESET}"

} else { c t x S e g = " 🟒 (clr 60 60 60)$('β–‘' * 20)${RESET} --%" }

$costStr = '$' + ('{0:F2}' -f [double]$cost) s e p = " {DIM}|${RESET} "

$parts = @() if ($repo) { p a r t s + = " {BOLD}$(clr 220 200 0)${repo}${RESET}" } if ($branch) { p a r t s + = " {BOLD}$(clr 0 180 220)🌿 (${branch})${RESET}" } $parts += $ctxSeg p a r t s + = " (clr 220 200 0)${costStr}${RESET}" p a r t s + = " (clr 0 200 80)+${linesAdd}${RESET} ( c l r 220 40 20 ) βˆ’ {linesDel}${RESET}" p a r t s + = " (clr 220 80 220)πŸ€– ${model}${RESET}"

[Console]::Write($parts -join $sep) `

Thank you for contributing, love to see it :)

@JathonKatu

Copy link
Copy Markdown

can you support windows ,thanks .

@SorbP

SorbP commented May 13, 2026

Copy link
Copy Markdown

can you support windows ,thanks .

All of this works on windows, what are you talking about?

@AachoLoya

Copy link
Copy Markdown

Hey, I saw you StatusLine, liked it but I needed it in PS1 format for Windows system without WSL, because it can't run bash. I'm going to leave it here if anyone wants it, it's exactly your statusline bar but converted in PowerShell:

` [Console]::InputEncoding = [System.Text.Encoding]::UTF8 [Console]::OutputEncoding = [System.Text.Encoding]::UTF8

$raw = [Console]::In.ReadToEnd() if (-not $raw.Trim()) { exit 0 } $json = $raw | ConvertFrom-Json

$e = [char]27 function clr($r, $g, Extra open brace or missing close brace $b) { "${e}[38;2;${r};${g};${b}m" } D I M = " {e}[2m" B O L D = " {e}[1m" R E S E T = " {e}[0m"

$model = $json.model.display_name; if (-not $model) { $model = "Claude" } $used = $json.context_window.used_percentage $cost = $json.cost.total_cost_usd; if (-not $cost) { $cost = 0.0 } $linesAdd = $json.cost.total_lines_added; if (-not $linesAdd) { $linesAdd = 0 } $linesDel = $json.cost.total_lines_removed; if (-not $linesDel) { $linesDel = 0 } $cwd = $json.workspace.current_dir if (-not $cwd) { $cwd = $json.cwd } if (-not $cwd) { $cwd = "" }

$branch = "" $repo = "" if ($cwd) { $b = git -C "$cwd" --no-optional-locks symbolic-ref --short HEAD 2>$null if ($b) { $branch = $b.Trim() } $t = git -C "$cwd" --no-optional-locks rev-parse --show-toplevel 2>$null if ($t) { $repo = Split-Path $t.Trim() -Leaf } }

$W = 20 if ($null -ne $used -and "$used" -ne "") { $pct = [int][math]::Round([double]$used) $filled = [int][math]::Round($pct * $W / 100.0)

$bar = ""
for ($i = 0; $i -lt $W; $i++) {
    $pos = $i * 100.0 / ($W - 1)
    if ($pos -le 50) {
        $t = $pos / 50.0
        $r = [int]($t * 220); $g = 200; $b = [int](80 * (1 - $t))
    } else {
        $t = ($pos - 50) / 50.0
        $r = 220; $g = [int](200 - 160 * $t); $b = [int](20 * $t)
    }
    if ($i -lt $filled) { $bar += "$(clr $r $g $b)β–ˆ" }
    else                 { $bar += "$(clr 60 60 60)β–‘" }
}
$bar += $RESET

if ($pct -ge 90)     { $emoji = "🚨"; $pctClr = clr 220 40 20 }
elseif ($pct -ge 70) { $emoji = "πŸ”₯"; $pctClr = clr 220 200 0 }
elseif ($pct -ge 20) { $emoji = "⚑"; $pctClr = clr 0 200 80 }
else                 { $emoji = "🟒"; $pctClr = clr 0 200 80 }

$ctxSeg = "${emoji} ${bar} ${pctClr}${pct}%${RESET}"

} else { c t x S e g = " 🟒 (clr 60 60 60)$('β–‘' * 20)${RESET} --%" }

$costStr = '$' + ('{0:F2}' -f [double]$cost) s e p = " {DIM}|${RESET} "

$parts = @() if ($repo) { p a r t s + = " {BOLD}$(clr 220 200 0)${repo}${RESET}" } if ($branch) { p a r t s + = " {BOLD}$(clr 0 180 220)🌿 (${branch})${RESET}" } $parts += $ctxSeg p a r t s + = " (clr 220 200 0)${costStr}${RESET}" p a r t s + = " (clr 0 200 80)+${linesAdd}${RESET} ( c l r 220 40 20 ) βˆ’ {linesDel}${RESET}" p a r t s + = " (clr 220 80 220)πŸ€– ${model}${RESET}"

[Console]::Write($parts -join $sep) `

Formatting is messed up and its hard to copy. Can you re-share the code inside of code-block?

@SorbP

SorbP commented Jun 27, 2026

Copy link
Copy Markdown

Hey, I saw you StatusLine, liked it but I needed it in PS1 format for Windows system without WSL, because it can't run bash. I'm going to leave it here if anyone wants it, it's exactly your statusline bar but converted in PowerShell:
` [Console]::InputEncoding = [System.Text.Encoding]::UTF8 [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$raw = [Console]::In.ReadToEnd() if (-not $raw.Trim()) { exit 0 } $json = $raw | ConvertFrom-Json
$e = [char]27 function clr($r, $g, Extra open brace or missing close brace
Extra open brace or missing close brace

    $b) { "${e}[38;2;${r};${g};${b}m" } D I M = " {e}[2m" B O L D = " {e}[1m" R E S E T = " {e}[0m"

$model = $json.model.display_name; if (-not $model) { $model = "Claude" } $used = $json.context_window.used_percentage $cost = $json.cost.total_cost_usd; if (-not $cost) { $cost = 0.0 } $linesAdd = $json.cost.total_lines_added; if (-not $linesAdd) { $linesAdd = 0 } $linesDel = $json.cost.total_lines_removed; if (-not $linesDel) { $linesDel = 0 } $cwd = $json.workspace.current_dir if (-not $cwd) { $cwd = $json.cwd } if (-not $cwd) { $cwd = "" }
$branch = "" $repo = "" if ($cwd) { $b = git -C "$cwd" --no-optional-locks symbolic-ref --short HEAD 2>$null if ($b) { $branch = $b.Trim() } $t = git -C "$cwd" --no-optional-locks rev-parse --show-toplevel 2>$null if ($t) { $repo = Split-Path $t.Trim() -Leaf } }
$W = 20 if ($null -ne $used -and "$used" -ne "") { $pct = [int][math]::Round([double]$used) $filled = [int][math]::Round($pct * $W / 100.0)

$bar = ""
for ($i = 0; $i -lt $W; $i++) {
    $pos = $i * 100.0 / ($W - 1)
    if ($pos -le 50) {
        $t = $pos / 50.0
        $r = [int]($t * 220); $g = 200; $b = [int](80 * (1 - $t))
    } else {
        $t = ($pos - 50) / 50.0
        $r = 220; $g = [int](200 - 160 * $t); $b = [int](20 * $t)
    }
    if ($i -lt $filled) { $bar += "$(clr $r $g $b)β–ˆ" }
    else                 { $bar += "$(clr 60 60 60)β–‘" }
}
$bar += $RESET

if ($pct -ge 90)     { $emoji = "🚨"; $pctClr = clr 220 40 20 }
elseif ($pct -ge 70) { $emoji = "πŸ”₯"; $pctClr = clr 220 200 0 }
elseif ($pct -ge 20) { $emoji = "⚑"; $pctClr = clr 0 200 80 }
else                 { $emoji = "🟒"; $pctClr = clr 0 200 80 }

$ctxSeg = "${emoji} ${bar} ${pctClr}${pct}%${RESET}"

} else { c t x S e g = " 🟒 (clr 60 60 60)$('β–‘' * 20)${RESET} --%" }
$costStr = '$' + ('{0:F2}' -f [double]$cost) s e p = " {DIM}|${RESET} "
$parts = @() if (
Extra open brace or missing close brace

    $repo) { p a r t s + = " {BOLD}$(clr 220 200 0)${repo}${RESET}" } if (
Extra open brace or missing close brace

    
    $branch) { p a r t s + = " {BOLD}$(clr 0 180 220)🌿 (${branch})${RESET}" } $parts += 

c
t
x
S
e
g
p
a
r
t
s
+

"

(
c
l
r
220
200
0
)
{costStr}${RESET}" p a r t s + = " (clr 0 200 80)+${linesAdd}${RESET} ( c l r 220 40 20 ) βˆ’ {linesDel}${RESET}" p a r t s + = " (clr 220 80 220)πŸ€– ${model}${RESET}"
[Console]::Write($parts -join $sep) `

Formatting is messed up and its hard to copy. Can you re-share the code inside of code-block?

Maybe i'm not understanding what you mean, but this works in terminal in windows, you don't need WSL installed? Or bash for that matter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment