Skip to main content

ADR-062: Claude Code Statusline Configuration System

FieldValue
StatusAccepted
Date2026-01-09
AuthorHal Casteel
ReviewersClaude Opus 4.5
CategoryDeveloper Experience
Tagsstatusline, configuration, CLI, UX

1. Executive Summary​

This ADR documents the comprehensive statusline configuration system for Claude Code, providing developers with real-time visibility into project state, git status, model usage, system resources, and development environment. The system is fully configurable via JSON, allowing users to toggle sections on/off based on their preferences.


2. Context​

2.1 Problem Statement​

Claude Code users need immediate visibility into:

  • Current project context
  • Git repository state
  • Model and context window usage
  • Development environment status
  • System resource availability
  • Active task tracking

Without this information readily available, developers must manually check multiple sources, reducing productivity and situational awareness.

2.2 Requirements​

RequirementPriorityDescription
Real-time updatesP0Status must reflect current state
ConfigurabilityP0Users can toggle sections on/off
PerformanceP0Must not add noticeable latency
Cross-platformP1Support macOS and Linux
Color-codedP1Visual distinction between status types
Non-intrusiveP1Multi-line format with logical grouping

3. Decision​

Implement a bash-based statusline system with JSON configuration that displays real-time information across 7 configurable sections.

3.1 Architecture​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Claude Code Runtime β”‚
β”‚ β”‚ β”‚
β”‚ β–Ό β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ JSON Input β”‚ β”‚
β”‚ β”‚ (stdin pipe) β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚
β”‚ β–Ό β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ statusline-command.sh β”‚ β”‚
β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚
β”‚ β”‚ β”‚ Configuration Loader β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ ~/.claude/statusline-config.json β”‚ β”‚ β”‚
β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚
β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚
β”‚ β”‚ β–Ό β–Ό β–Ό β”‚ β”‚
β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚
β”‚ β”‚ β”‚ Section β”‚ β”‚ Section β”‚ β”‚ Section β”‚ ... β”‚ β”‚
β”‚ β”‚ β”‚ Enabled? β”‚ β”‚ Enabled? β”‚ β”‚ Enabled? β”‚ β”‚ β”‚
β”‚ β”‚ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β”‚ β”‚
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ β–Ό β–Ό β–Ό β”‚ β”‚
β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚
β”‚ β”‚ β”‚ Generate β”‚ β”‚ Generate β”‚ β”‚ Generate β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ Content β”‚ β”‚ Content β”‚ β”‚ Content β”‚ β”‚ β”‚
β”‚ β”‚ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β”‚ β”‚
β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚
β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ β–Ό β”‚ β”‚
β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚
β”‚ β”‚ β”‚ Assemble & β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ Output Line β”‚ β”‚ β”‚
β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚
β”‚ β–Ό β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Terminal Line β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

3.2 File Locations​

FilePathPurpose
Script~/.claude/statusline-command.shMain statusline generator
Config~/.claude/statusline-config.jsonSection toggle configuration
Settings~/.claude/settings.jsonClaude Code settings (references script)

4. Statusline Sections​

4.1 Section Overview​

#SectionIconKeyDefaultDescription
1ProjectπŸ“projecttrueCurrent working directory name
2GitβŽ‡gittrueBranch, status, sync state
3ClaudeπŸ€–claudetrueModel, context usage, tokens
4Environmentβš™environmenttrueDev tools and runtimes
5SystemπŸ’»systemtrueHardware resources
6IdentityπŸ‘€identitytrueUser, host, time
7TaskπŸ“‹tasktrueActive CODITECT task ID

4.2 Section 2: Git (βŽ‡)​

Purpose: Provide comprehensive git repository status at a glance.

ElementSymbolColorDescription
Branch nameβ€”GreenCurrent branch or commit hash
Clean statusβœ“GreenWorking tree is clean
Dirty statusβœ—RedUncommitted changes exist
Ahead count↑nGreenCommits ahead of remote
Behind count↓nRedCommits behind remote
Stash countS:nYellowNumber of stashed changes
File countnfYellowNumber of changed files

Examples:

Status LineMeaning
mainβœ“On main, clean
mainβœ— 3fOn main, dirty, 3 files changed
featureβœ“β†‘2On feature, clean, 2 ahead
mainβœ—β†‘1↓3 S:2 5fDirty, 1 ahead, 3 behind, 2 stashes, 5 files

4.3 Section 3: Claude (πŸ€–)​

Purpose: Display model information and context window utilization.

ElementFormatDescription
Model nameOpus/Sonnet/HaikuCurrent Claude model
Context %n%Context window usage percentage
Token flownK→nKInput tokens → Output tokens (in thousands)

Model Colors:

ModelColorANSI Code
OpusMagenta\033[35m
SonnetBlue\033[34m
HaikuGreen\033[32m
UnknownWhite\033[97m

Context Usage Colors:

RangeColorMeaning
0-49%GreenPlenty of room
50-79%YellowGetting full
80-100%RedNear limit

4.4 Section 4: Environment (βš™)​

Purpose: Show active development tools, runtimes, and project type indicators.

ElementIconColorCondition
Python venv🐍Magenta$VIRTUAL_ENV set or .venv/ exists
Node.js⬒Greenpackage.json exists + node installed
Docker🐳BlueRunning containers > 0
RustπŸ¦€RedCargo.toml exists
GoπŸ”·Cyango.mod exists
TypeScriptTSBluetsconfig.json exists
VersionvX.Y.ZDimFrom package.json or pyproject.toml

4.5 Section 5: System (πŸ’»)​

Purpose: Display hardware resource status for awareness of system constraints.

ElementIconColor LogicSource
BatteryπŸ”‹/⚑/πŸͺ«Green (charging/ok), Red (<20%)pmset -g batt
MemoryπŸ’ΎBluevm_stat
DiskπŸ’ΏDimdf -h

Battery Icons:

IconMeaningCondition
⚑Charging"charging" in pmset output
πŸ”‹On battery (ok)>= 20%
πŸͺ«Low battery< 20%

4.6 Section 7: Task (πŸ“‹)​

Purpose: Display the active CODITECT task ID for project tracking integration.

ElementColorSource
Task IDWhite$CODITECT_TASK environment variable

Condition: Only displays if $CODITECT_TASK is set.

Integration:

export CODITECT_TASK="A.9.1.3"  # Set before starting Claude Code

5. Configuration​

5.1 Configuration File​

Location: ~/.claude/statusline-config.json

Full Schema:

{
"_comment": "Toggle sections on/off. Set to false to hide a section.",
"sections": {
"project": true,
"git": true,
"claude": true,
"environment": true,
"system": true,
"identity": true,
"task": true
},
"_section_descriptions": {
"project": "πŸ“ Current directory name",
"git": "βŽ‡ Branch, status, ahead/behind, stash, file count",
"claude": "πŸ€– Model name, context %, token usage (inβ†’out)",
"environment": "βš™ Python venv, Node version, Docker, language icons, package version",
"system": "πŸ’» Battery, RAM usage, disk space",
"identity": "πŸ‘€ User, hostname, time, timezone",
"task": "πŸ“‹ Active CODITECT task ID (requires $CODITECT_TASK env var)"
},
"_usage": "Edit this file to customize your statusline. Changes take effect immediately."
}

5.2 Preset Configurations​

PresetSections EnabledUse Case
FullAll 7Maximum visibility
Minimalproject, claudeClean, focused
Dev Focusproject, git, claude, environmentDevelopment work
System Monitorproject, claude, systemResource-aware
Git Focusproject, git, claudeVersion control focus

Minimal Configuration:

{
"sections": {
"project": true,
"git": false,
"claude": true,
"environment": false,
"system": false,
"identity": false,
"task": false
}
}

5.3 Configuration Commands​

ActionCommand
Edit confignano ~/.claude/statusline-config.json
Enable sectionjq '.sections.system = true' ~/.claude/statusline-config.json | sponge ~/.claude/statusline-config.json
Disable sectionjq '.sections.system = false' ~/.claude/statusline-config.json | sponge ~/.claude/statusline-config.json
Reset to fullCopy full config from ADR
View currentcat ~/.claude/statusline-config.json

6. Color System​

6.1 ANSI Color Codes​

ColorCodeEscape SequenceUsage
Cyan36\033[36mSeparators, username
Green32\033[32mGood status, names
Yellow33\033[33mWarnings, time
Red31\033[31mErrors, alerts
Blue34\033[34mInfo, Sonnet model
Magenta35\033[35mOpus model, Python
Grey90\033[90mBrackets, labels
White97\033[97mTask ID
Dim2\033[2mSecondary info
Reset0\033[0mClear formatting

6.2 Semantic Color Meanings​

ColorSemantic Meaning
GreenPositive: clean, ahead, good battery, success
YellowWarning: moderate usage, stashes, file changes
RedAlert: dirty, behind, high usage, low battery
BlueInformational: memory, Sonnet, Docker
MagentaSpecial: Opus, Python
CyanStructural: separators, user identity
Grey/DimDe-emphasized: brackets, secondary data

7. Integration with CODITECT-CORE-INITIAL-SETUP.py​

7.1 Installation Flow​

CODITECT-CORE-INITIAL-SETUP.py
β”‚
β”œβ”€β”€ Phase 1: Core Installation
β”‚
β”œβ”€β”€ Phase 2: Symlink Creation
β”‚
β”œβ”€β”€ Phase 3: Machine ID Generation
β”‚
β”œβ”€β”€ Phase 4: Context Database
β”‚
β”œβ”€β”€ Phase 5: Hooks Configuration
β”‚
└── Phase 6: Statusline Setup ◀── NEW
β”‚
β”œβ”€β”€ Create statusline-command.sh
β”œβ”€β”€ Create statusline-config.json
└── Update settings.json

7.2 Setup Function​

def setup_statusline(claude_dir: Path) -> None:
"""Configure Claude Code statusline with comprehensive system status."""

# Create statusline script
script_path = claude_dir / "statusline-command.sh"
script_path.write_text(STATUSLINE_SCRIPT)
script_path.chmod(0o755)

# Create default configuration (all sections enabled)
config_path = claude_dir / "statusline-config.json"
config_path.write_text(json.dumps({
"sections": {
"project": True,
"git": True,
"claude": True,
"environment": True,
"system": True,
"identity": True,
"task": True
}
}, indent=2))

# Update settings.json
settings_path = claude_dir / "settings.json"
settings = json.loads(settings_path.read_text()) if settings_path.exists() else {}
settings["statusLine"] = str(script_path)
settings_path.write_text(json.dumps(settings, indent=2))

print("βœ“ Statusline configured")

8. Troubleshooting​

8.1 Common Issues​

IssueCauseSolution
No statusline displayedSettings not configuredCheck ~/.claude/settings.json has statusLine
Sections missingConfig disabledCheck ~/.claude/statusline-config.json
Git info missingNot in git repoNormal - only shows in git repos
Environment emptyNo dev tools detectedNormal - only shows detected tools
Colors not showingTerminal doesn't supportUse terminal with ANSI support
jq errorsjq not installedbrew install jq or apt install jq

8.2 Debug Commands​

# Test statusline manually
echo '{"workspace":{"current_dir":"'"$PWD"'"}}' | bash ~/.claude/statusline-command.sh

# Check configuration
cat ~/.claude/statusline-config.json | jq .

# Verify settings
cat ~/.claude/settings.json | jq .statusLine

# Check script permissions
ls -la ~/.claude/statusline-command.sh

8.3 Reset to Defaults​

# Reset configuration to full
cat > ~/.claude/statusline-config.json << 'EOF'
{
"sections": {
"project": true,
"git": true,
"claude": true,
"environment": true,
"system": true,
"identity": true,
"task": true
}
}
EOF

9. Real-World Examples​

9.1 Full Configuration Example​

Output:

─[πŸ“:coditect-rollout-master]─[βŽ‡:mainβœ— S:1 5f]─
─[πŸ€–:Opus 55% 85.0Kβ†’25.0K]─
─[βš™:🐍venv β¬’22.1.0 πŸ¦€ v2.0.0]─[πŸ’»:⚑85% πŸ’Ύ8.2GB πŸ’Ώ120Gi]─
─[πŸ‘€:halcasteel@mac 14:23:45PST]─[πŸ“‹:A.9.1.3]─

9.2 Minimal Configuration Example​

Config:

{
"sections": {
"project": true,
"git": false,
"claude": true,
"environment": false,
"system": false,
"identity": false,
"task": false
}
}

Output:

─[πŸ“:my-project]─
─[πŸ€–:Opus 42% 55.0Kβ†’18.2K]─
  • Clean, focused view with only project and Claude status

10. Performance Considerations​

10.1 Execution Time Budget​

SectionTypical TimeOptimization
Project<1msDirect variable
Git10-50msOnly if in repo
Claude<1msJSON parsing only
Environment5-20msFile existence checks
System20-50msSystem calls
Identity<5msQuick commands
Task<1msEnvironment variable
Total40-130msWell within budget

10.2 Optimization Techniques​

  1. Lazy evaluation: Sections only computed if enabled
  2. Early exit: Git checks abort if not in repo
  3. Cached config: Config read once per invocation
  4. Parallel-safe: No locks or shared state

11. Consequences​

Positive​

  1. Real-time visibility into all development state
  2. Fully configurable via JSON
  3. Performance optimized with lazy evaluation
  4. Cross-platform support (macOS, Linux)
  5. Color-coded for quick visual scanning
  6. Integrated with CODITECT task tracking

Negative​

  1. Shell dependency - Requires bash 4+
  2. jq dependency - Required for JSON parsing
  3. macOS-specific commands for some features

12. References​


Document Version: 1.0.0 Last Updated: 2026-01-09 Next Review: 2026-04-09