Status line for Claude Code with iTerm2 badge integration - shows session info, project context, git status, and updates iTerm2 badge.
This plugin is a fork of the statusline plugin that adds iTerm2 badge integration. In addition to displaying the standard status line, it also sets an iTerm2 user variable (user.badge) that can be displayed as a badge in your terminal.
✅ Session tracking - Shows current session ID ✅ Project context - Displays project and working directory ✅ Git status - Shows branch, repository, and change count ✅ Usage tracking - Integrates with par-cc-usage (optional) ✅ Auto-configuration - Hooks automatically update settings.json ✅ Worktree support - Handles git worktrees correctly ✅ iTerm2 badge - Updates iTerm2 badge with repo/branch/status
The plugin sets the user.badge variable with:
nsheaps/dotfiles
main ↑2 ↓1 ✗
- Line 1: owner/repo name
- Line 2: branch + ahead (↑) + behind (↓) + clean (✓) or dirty (✗)
To display the badge, configure your iTerm2 profile:
- Open iTerm2 Preferences → Profiles → [Your Profile] → General
- Set Badge to:
\(user.badge) - Optionally adjust badge appearance in the same settings
Or use Dynamic Profiles with:
{
"Badge Text": "\\(user.badge)"
}# Via GitHub
claude plugins install github:nsheaps/ai-mktpl/plugins/statusline-iterm
# Or locally for testing
cc --plugin-dir /path/to/plugins/statusline-itermThe plugin includes hooks that automatically configure your ~/.claude/settings.json:
- On SessionStart and UserPromptSubmit, the hook checks your settings
- If
statusLine.commandis not configured, it sets it to this plugin's script - If already pointing to this plugin, it updates silently (handles plugin path changes)
- If pointing to a different script, it warns and asks you to choose
The status line displays:
Session: abc-123-def-456
In: ~/src/project | In: ./src/components
On: org/repo@feature-branch (3 changes)
Usage: 50K tokens (5% of limit)
- Session: Current Claude Code session ID
- In: Project root and current working directory (abbreviated)
- On: Git repository (org/name), branch, and change count
- Usage: Token usage from par-cc-usage (if available)
bash- Shell interpreterjq- JSON parsinggit- Git status display
uvxandpar-cc-usage- Token usage tracking (degrades gracefully if missing)- iTerm2 - For badge display (degrades gracefully in other terminals)
- Ensure you're running iTerm2 (check
$TERM_PROGRAM) - Verify your profile has Badge Text set to
\(user.badge) - Check that the statusline script is being called
-
Check if the plugin is enabled:
jq '.enabledPlugins' ~/.claude/settings.json
-
Verify settings.json configuration:
jq '.statusLine' ~/.claude/settings.json
-
Restart Claude Code
# Test with sample input (in iTerm2)
echo '{"session_id": "test", "workspace": {"project_dir": "'"$PWD"'"}}' | \
./bin/statusline.sh- statusline - Original statusline plugin (without iTerm2 badge)
- commit-skill - Automatic git commit management
- Issues: GitHub Issues
- Documentation: Main README
MIT