Free Tool

Free Claude Code Statusline Generator

A Claude Code statusline generator creates a ready-to-install statusLine config and shell script for showing model, directory, git branch, cost, runtime, context, and other session details inside Claude Code.

Start from a statusline preset

Generates local files only - no API call.

Statusline

FieldsKeep the line short enough for your terminal.

.claude/settings.json

statusLine command · 4 fields selected

{
  "statusLine": {
    "type": "command",
    "command": ".claude/statusline.sh",
    "padding": 0
  }
}
statusline.sh
#!/usr/bin/env bash
set -euo pipefail

input=$(cat)
json() { echo "$input" | jq -r "$1" 2>/dev/null || true; }

RESET=$'\033[0m'; MODEL_COLOR=$'\033[36m'; DIR_COLOR=$'\033[37m'; BRANCH_COLOR=$'\033[32m'; COST_COLOR=$'\033[33m'; META_COLOR=$'\033[90m'
sep=' | '
parts=()

model=$(json '.model.display_name // .model.id // "Claude"')
[ -n "$model" ] && [ "$model" != "null" ] && parts+=("${MODEL_COLOR}${model}${RESET}")

dir=$(json '.workspace.current_dir // .cwd // empty')
[ -n "$dir" ] && [ "$dir" != "null" ] && parts+=("${DIR_COLOR}${dir##*/}${RESET}")

if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
  branch=$(git branch --show-current 2>/dev/null || true)
  [ -n "$branch" ] && parts+=("${BRANCH_COLOR}git:${branch}${RESET}")
fi

cost=$(json '.cost.total_cost_usd // empty')
if [ -n "$cost" ] && [ "$cost" != "null" ]; then
  cost_fmt=$(awk "BEGIN { printf \"%.4f\", $cost + 0 }" 2>/dev/null || printf "%s" "$cost")
  parts+=("${COST_COLOR}\$${cost_fmt}${RESET}")
fi

if [ ${#parts[@]} -eq 0 ]; then
  parts+=("Claude Code")
fi

(IFS="$sep"; echo "${parts[*]}")
Install snippet
mkdir -p .claude
cat > .claude/statusline.sh <<'EOF'
#!/usr/bin/env bash
set -euo pipefail

input=$(cat)
json() { echo "$input" | jq -r "$1" 2>/dev/null || true; }

RESET=$'\033[0m'; MODEL_COLOR=$'\033[36m'; DIR_COLOR=$'\033[37m'; BRANCH_COLOR=$'\033[32m'; COST_COLOR=$'\033[33m'; META_COLOR=$'\033[90m'
sep=' | '
parts=()

model=$(json '.model.display_name // .model.id // "Claude"')
[ -n "$model" ] && [ "$model" != "null" ] && parts+=("${MODEL_COLOR}${model}${RESET}")

dir=$(json '.workspace.current_dir // .cwd // empty')
[ -n "$dir" ] && [ "$dir" != "null" ] && parts+=("${DIR_COLOR}${dir##*/}${RESET}")

if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
  branch=$(git branch --show-current 2>/dev/null || true)
  [ -n "$branch" ] && parts+=("${BRANCH_COLOR}git:${branch}${RESET}")
fi

cost=$(json '.cost.total_cost_usd // empty')
if [ -n "$cost" ] && [ "$cost" != "null" ]; then
  cost_fmt=$(awk "BEGIN { printf \"%.4f\", $cost + 0 }" 2>/dev/null || printf "%s" "$cost")
  parts+=("${COST_COLOR}\$${cost_fmt}${RESET}")
fi

if [ ${#parts[@]} -eq 0 ]; then
  parts+=("Claude Code")
fi

(IFS="$sep"; echo "${parts[*]}")
EOF
chmod +x .claude/statusline.sh
node <<'NODE'
const fs = require('fs');
const path = ".claude/settings.json".replace(/^~\//, process.env.HOME + '/');
const incoming = {
  "statusLine": {
    "type": "command",
    "command": ".claude/statusline.sh",
    "padding": 0
  }
};
fs.mkdirSync(require('path').dirname(path), { recursive: true });
const current = fs.existsSync(path) ? JSON.parse(fs.readFileSync(path, 'utf8')) : {};
current.statusLine = incoming.statusLine;
fs.writeFileSync(path, JSON.stringify(current, null, 2) + '\n');
NODE

How to create a Claude Code statusline

  1. Choose the fields. Select model, directory, git branch, cost, duration, context, line changes, version, or output style.
  2. Pick scope and script path. Use project scope for repository-local settings or user scope for a statusline shared across machines and projects.
  3. Copy the config and script. Copy the generated statusLine JSON and executable shell script, or use the install snippet to write both files.
  4. Make the script executable. Run chmod +x on the statusline script so Claude Code can execute it.
  5. Test in Claude Code. Open Claude Code in the target directory and confirm the generated one-line status appears at the bottom of the interface.

Anatomy of a statusLine config

Claude Code reads a statusLine object from settings, runs the configured command, and renders the first line printed to stdout.

  • type - use command for a script-backed statusline.
  • command - points to the executable script Claude Code should run.
  • padding - controls spacing around the rendered line.

Frequently Asked Questions

What is a Claude Code statusline?

+

A Claude Code statusline is a custom command that prints one line of context at the bottom of Claude Code, similar to a terminal prompt.

Where does the statusline config go?

+

The statusLine setting goes in .claude/settings.json for a project or ~/.claude/settings.json for a user-level setup.

What data can a statusline command read?

+

Claude Code sends JSON on stdin with session context such as model, current directory, project directory, version, output style, cost, duration, and line changes.

Can a statusline use colors?

+

Yes. Claude Code supports ANSI color codes in the first stdout line returned by the statusline command.

How often does Claude Code update the statusline?

+

The statusline updates when conversation messages change, with updates capped to avoid running the command too frequently.

Statuslines show context. Tornic runs the workflow.

Claude Code statuslines make each session easier to scan. Tornic turns Claude, Codex, and Cursor CLI subscriptions into repeatable workflows with clear steps, stable handoffs, and no surprise API bills.

Try Tornic