Free browser tool
Claude Code status line builder
Choose workspace and cost fields from the Claude Code stdin JSON, set a separator and display options, then copy a settings.json block and Python status line script. Everything runs locally in your browser, with no account or network connection.
Live terminal preview
Sample dataDir: billing-api | Repo: billing-api | +128 | -31
Preview shows sample workspace and session cost data; your script runs locally.
Your settings.json block
{
"statusLine": {
"type": "command",
"command": "python3 ~/.claude/statusline.py",
"padding": 0
}
}
Your statusline.py script
#!/usr/bin/env python3
import json
import os
import sys
data = json.load(sys.stdin)
workspace = data.get("workspace", {})
cost = data.get("cost", {})
SEPARATOR = " | "
repo = workspace.get("repo") or {}
parts = []
current_dir = os.path.basename(workspace.get("current_dir") or data.get("cwd") or "")
parts.append("Dir: " + current_dir)
repo_label = repo.get("name") or os.path.basename(workspace.get("project_dir") or "")
parts.append("Repo: " + repo_label)
added = cost.get("total_lines_added", 0)
parts.append(f"+{added}")
removed = cost.get("total_lines_removed", 0)
parts.append(f"-{removed}")
print(SEPARATOR.join(parts))
Save and merge the configuration
- Save the Python script as
~/.claude/statusline.py. - Add the
statusLineblock to~/.claude/settings.jsonor your project settings. Merge this block with your existing settings instead of replacing other configuration. - The command uses
python3 ~/.claude/statusline.pyand reads the stdin JSON with defaults for missing fields.
For an alternative, run /statusline inside Claude Code and describe what you want in natural language. Claude Code can generate a script and update your settings automatically. Read the Claude Code status line guide for update behavior and terminal formatting.