Install command
Not provided
Git-focused statusline showing branch, dirty status, ahead/behind indicators, and stash count alongside Claude session info
Open the source and read safety notes before installing.
Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.
Decision playbook
Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.
0
78
—
No baseline selected
No major trust-signal divergence detected in the current selection.
Confirm ownership and provenance before trusting install instructions.
Source link availableRequired
Open the canonical repository and verify ownership.
Source provenance statusRequired
Marked as source-backed.
Metadata reviewed
Registry metadata indicates a reviewed listing.
Validate risk disclosures before installation or API wiring.
Safety notes presentRequired
Review the listed safety guidance before running commands.
Privacy notes presentRequired
Review data handling notes before connecting accounts or secrets.
Trust level risk gateRequired
Trust level does not block evaluation.
Check package metadata and artifact integrity signals.
Install payload available
Install or copy payload is available for review.
Package verification flag
No package verification flag provided.
Checksum metadata
No checksum provided for downloaded artifact.
Use compare context to validate trade-offs before adoption.
Compare tray has multiple entries
Add at least one more entry to compare trust differences.
Baseline comparison available
No baseline peer selected yet.
Diverging trust signals identified
No major trust-signal divergence found.
Setup at a glance
Copy-ready — paste the snippet to get started.
Install command
Not provided
Config snippet
Provided
Copy snippet
Provided
Prerequisites
6 to clear
Platforms
1 listed
Difficulty
3/100
Adoption plan
Current risk score 16/100. Use staged verification before broader rollout.
Validate source and review signals before any execution.
Confirm source provenanceRequired
Source URL/provenance metadata is present.
Confirm metadata review state
Listing has review metadata.
Verify install payload
Install/config payload exists and can be inspected.
Confirm safety, privacy, and package integrity signals.
Review safety notesRequired
Safety notes are present.
Review privacy notesRequired
Privacy notes are present.
Verify package integrity metadata
No package verification/checksum metadata.
Adopt in controlled steps based on the selected plan.
Run in isolated sandbox firstRequired
Use a constrained sandbox and observe behavior across multiple tasks.
Roll out graduallyRequired
Roll out to a small cohort before wider usage.
Set monitoring and fallback
Define rollback path and monitor errors after adoption.
Evidence readiness
Required evidence gates are covered (5/6 signals complete).
Source repository/provenance is listed.
Required in this preset
Review metadata is present.
Required in this preset
Safety notes are present.
Required in this preset
Privacy notes are present.
Optional in this preset
Package integrity metadata is missing.
Optional in this preset
Install payload is available.
Required in this preset
Required evidence gates are covered for this preset.
Decision timeline
5/6 steps complete with no blocking gaps for this preset.
triage
Source/provenance metadata is available.
triage
Review metadata is available.
verify
Safety notes are available.
verify
Privacy notes are available.
verify
Package integrity metadata is missing.
rollout
Install payload is available.
No required blockers for this timeline preset.
Prerequisite readiness
6 prerequisites to line up before setup.
Safety & privacy surface
1 safety and 1 privacy notes across 1 risk area. Review closely: credentials & tokens.
#!/usr/bin/env bash
# Git-Focused Statusline for Claude Code
# Emphasizes git status with visual indicators
# Read JSON from stdin
read -r input
# Extract Claude session data
model=$(echo "$input" | jq -r '.model // "unknown"' | sed 's/claude-//')
tokens=$(echo "$input" | jq -r '.session.totalTokens // 0')
workdir=$(echo "$input" | jq -r '.workspace.path // "."')
# Get git information from workspace
cd "$workdir" 2>/dev/null || cd .
if git rev-parse --git-dir > /dev/null 2>&1; then
# Get branch name
branch=$(git symbolic-ref --short HEAD 2>/dev/null || echo "(detached)")
# Check if working directory is clean
if [ -z "$(git status --porcelain)" ]; then
status_icon="✓"
status_color="\033[32m" # Green
else
status_icon="✗"
status_color="\033[33m" # Yellow
fi
# Check ahead/behind status
ahead_behind=$(git rev-list --left-right --count HEAD...@{upstream} 2>/dev/null)
if [ -n "$ahead_behind" ]; then
ahead=$(echo "$ahead_behind" | cut -f1)
behind=$(echo "$ahead_behind" | cut -f2)
if [ "$ahead" -gt 0 ]; then
tracking="↑$ahead"
fi
if [ "$behind" -gt 0 ]; then
tracking="${tracking}↓$behind"
fi
fi
# Check stash count
stash_count=$(git stash list 2>/dev/null | wc -l | tr -d ' ')
if [ "$stash_count" -gt 0 ]; then
stash_info=" ⚑$stash_count"
fi
git_info=" ${status_color}${branch}${tracking}${stash_info} ${status_icon}\033[0m"
else
git_info=""
fi
# Build statusline
echo -e "\033[36m${model}\033[0m │ \033[35m${tokens}\033[0m${git_info}"{
"statusLine": {
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/git-status-statusline.sh",
"refreshInterval": 1000
}
}{
"statusLine": {
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/git-status-statusline.sh",
"refreshInterval": 1000
}
}
Extended version detecting merge conflicts and showing conflict count
#!/usr/bin/env bash
# Enhanced Git Status Statusline with Conflict Detection
input=$(cat)
model=$(echo "$input" | jq -r '.model.display_name // .model.id // "unknown"' | sed 's/claude-//')
tokens=$(echo "$input" | jq -r '.cost.total_tokens // .session.totalTokens // 0')
workdir=$(echo "$input" | jq -r '.workspace.current_dir // .workspace.project_dir // "."')
cd "$workdir" 2>/dev/null || cd .
if git rev-parse --git-dir > /dev/null 2>&1; then
branch=$(git symbolic-ref --short HEAD 2>/dev/null || echo "(detached)")
# Check for merge conflicts
conflict_count=$(git diff --name-only --diff-filter=U 2>/dev/null | wc -l | tr -d ' ')
# Check working directory status
if [ "$conflict_count" -gt 0 ]; then
status_icon="⚠"
status_color="\033[31m" # Red for conflicts
elif [ -z "$(git status --porcelain 2>/dev/null)" ]; then
status_icon="✓"
status_color="\033[32m" # Green
else
status_icon="✗"
status_color="\033[33m" # Yellow
fi
ahead_behind=$(git rev-list --left-right --count HEAD...@{upstream} 2>/dev/null)
tracking=""
if [ -n "$ahead_behind" ]; then
ahead=$(echo "$ahead_behind" | cut -f1)
behind=$(echo "$ahead_behind" | cut -f2)
if [ "$ahead" -gt 0 ]; then
tracking="↑$ahead"
fi
if [ "$behind" -gt 0 ]; then
tracking="${tracking}↓$behind"
fi
fi
stash_count=$(git stash list 2>/dev/null | wc -l | tr -d ' ')
stash_info=""
if [ "$stash_count" -gt 0 ]; then
stash_info=" ⚑$stash_count"
fi
conflict_info=""
if [ "$conflict_count" -gt 0 ]; then
conflict_info=" ⚠$conflict_count"
fi
git_info=" ${status_color}${branch}${tracking}${stash_info}${conflict_info} ${status_icon}\033[0m"
else
git_info=""
fi
if [ "$tokens" -gt 1000 ]; then
tokens_formatted=$(printf "%'d" $tokens 2>/dev/null || echo $tokens)
else
tokens_formatted=$tokens
fi
echo -e "\033[36m${model}\033[0m │ \033[35m${tokens_formatted}\033[0m${git_info}"
Version showing remote repository name and URL
#!/usr/bin/env bash
# Git Status Statusline with Remote Status
input=$(cat)
model=$(echo "$input" | jq -r '.model.display_name // .model.id // "unknown"' | sed 's/claude-//')
tokens=$(echo "$input" | jq -r '.cost.total_tokens // .session.totalTokens // 0')
workdir=$(echo "$input" | jq -r '.workspace.current_dir // .workspace.project_dir // "."')
cd "$workdir" 2>/dev/null || cd .
if git rev-parse --git-dir > /dev/null 2>&1; then
branch=$(git symbolic-ref --short HEAD 2>/dev/null || echo "(detached)")
# Get remote name
remote=$(git config --get branch.${branch}.remote 2>/dev/null || echo "origin")
remote_url=$(git config --get remote.${remote}.url 2>/dev/null | sed 's/.*\/\([^/]*\)\.git$/\1/')
if [ -z "$(git status --porcelain 2>/dev/null)" ]; then
status_icon="✓"
status_color="\033[32m"
else
status_icon="✗"
status_color="\033[33m"
fi
ahead_behind=$(git rev-list --left-right --count HEAD...@{upstream} 2>/dev/null)
tracking=""
if [ -n "$ahead_behind" ]; then
ahead=$(echo "$ahead_behind" | cut -f1)
behind=$(echo "$ahead_behind" | cut -f2)
if [ "$ahead" -gt 0 ]; then
tracking="↑$ahead"
fi
if [ "$behind" -gt 0 ]; then
tracking="${tracking}↓$behind"
fi
fi
stash_count=$(git stash list 2>/dev/null | wc -l | tr -d ' ')
stash_info=""
if [ "$stash_count" -gt 0 ]; then
stash_info=" ⚑$stash_count"
fi
remote_info=""
if [ -n "$remote_url" ]; then
remote_info=" @${remote_url}"
fi
git_info=" ${status_color}${branch}${tracking}${stash_info}${remote_info} ${status_icon}\033[0m"
else
git_info=""
fi
if [ "$tokens" -gt 1000 ]; then
tokens_formatted=$(printf "%'d" $tokens 2>/dev/null || echo $tokens)
else
tokens_formatted=$tokens
fi
echo -e "\033[36m${model}\033[0m │ \033[35m${tokens_formatted}\033[0m${git_info}"
Complete setup script with Git verification and Unicode character testing
#!/bin/bash
# Installation script for Git Status Statusline
# Check if Git is installed
if ! command -v git &> /dev/null; then
echo "Error: Git is not installed or not in PATH"
echo "Install Git: https://git-scm.com/downloads"
exit 1
fi
# Check if jq is installed
if ! command -v jq &> /dev/null; then
echo "Installing jq for JSON parsing..."
if [[ "$OSTYPE" == "darwin"* ]]; then
brew install jq
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
sudo apt-get install -y jq || sudo yum install -y jq
else
echo "Please install jq manually: https://stedolan.github.io/jq/"
fi
fi
# Test Unicode characters
if echo -e '✓ ✗ ↑ ↓ ⚑' &> /dev/null; then
echo "Unicode characters supported"
else
echo "Warning: Unicode characters may not be supported in your terminal"
echo "Consider installing a Nerd Font for better icon support"
fi
mkdir -p .claude/statuslines
cat > .claude/statuslines/git-status-statusline.sh << 'SCRIPT_EOF'
#!/usr/bin/env bash
# Git-Focused Statusline for Claude Code
# Emphasizes git status with visual indicators
read -r input
model=$(echo "$input" | jq -r '.model.display_name // .model.id // "unknown"' | sed 's/claude-//')
tokens=$(echo "$input" | jq -r '.cost.total_tokens // .session.totalTokens // 0')
workdir=$(echo "$input" | jq -r '.workspace.current_dir // .workspace.project_dir // "."')
cd "$workdir" 2>/dev/null || cd .
if git rev-parse --git-dir > /dev/null 2>&1; then
branch=$(git symbolic-ref --short HEAD 2>/dev/null || echo "(detached)")
if [ -z "$(git status --porcelain 2>/dev/null)" ]; then
status_icon="✓"
status_color="\033[32m"
else
status_icon="✗"
status_color="\033[33m"
fi
ahead_behind=$(git rev-list --left-right --count HEAD...@{upstream} 2>/dev/null)
tracking=""
if [ -n "$ahead_behind" ]; then
ahead=$(echo "$ahead_behind" | cut -f1)
behind=$(echo "$ahead_behind" | cut -f2)
if [ "$ahead" -gt 0 ]; then
tracking="↑$ahead"
fi
if [ "$behind" -gt 0 ]; then
tracking="${tracking}↓$behind"
fi
fi
stash_count=$(git stash list 2>/dev/null | wc -l | tr -d ' ')
stash_info=""
if [ "$stash_count" -gt 0 ]; then
stash_info=" ⚑$stash_count"
fi
git_info=" ${status_color}${branch}${tracking}${stash_info} ${status_icon}\033[0m"
else
git_info=""
fi
if [ "$tokens" -gt 1000 ]; then
tokens_formatted=$(printf "%'d" $tokens 2>/dev/null || echo $tokens)
else
tokens_formatted=$tokens
fi
echo -e "\033[36m${model}\033[0m │ \033[35m${tokens_formatted}\033[0m${git_info}"
SCRIPT_EOF
chmod +x .claude/statuslines/git-status-statusline.sh
# Add to settings.json
if [ ! -f .claude/settings.json ]; then
echo '{"statusLine":{"type":"command","command":"$CLAUDE_PROJECT_DIR/.claude/statuslines/git-status-statusline.sh","refreshInterval":1000}}' > .claude/settings.json
else
jq '.statusLine = {"type":"command","command":"$CLAUDE_PROJECT_DIR/.claude/statuslines/git-status-statusline.sh","refreshInterval":1000}' .claude/settings.json > .claude/settings.json.tmp
mv .claude/settings.json.tmp .claude/settings.json
fi
echo "Git Status Statusline installed successfully!"
echo "Note: Ensure you're in a Git repository for git status to display"
echo "Set upstream branch for ahead/behind tracking: git branch --set-upstream-to=origin/main main"
Ensure you're on a proper branch: git checkout main. Detached HEAD state is normal when checking out specific commits. Verify branch exists: git branch. Check symbolic-ref command: git symbolic-ref --short HEAD. If in detached state, create new branch: git checkout -b new-branch-name.
This requires an upstream branch to be set. Run: git branch --set-upstream-to=origin/main main (adjust branch name as needed). Verify upstream is set: git branch -vv. Check remote exists: git remote -v. Ensure remote branch exists: git ls-remote origin main. If remote doesn't exist, push branch first: git push -u origin main.
Check git status for untracked files or changes. The statusline reflects actual git state. Run git status -s to see what's detected. Check for untracked files: git status --porcelain. Verify all changes are committed: git diff HEAD. Check for ignored files that might be tracked: git ls-files.
Install a Nerd Font or ensure terminal has Unicode support. Test with: echo '✓ ✗ ↑ ↓ ⚑'. Check terminal encoding: locale charmap (should be UTF-8). Set terminal to UTF-8: export LANG=en_US.UTF-8. Install Nerd Font: https://www.nerdfonts.com/. If Unicode not supported, modify script to use ASCII alternatives: + for clean, * for dirty, ^ for ahead, v for behind.
Verify stashes exist: git stash list. Check stash count calculation: git stash list | wc -l. Ensure git stash command works: git stash list 2>/dev/null. If stashes exist but not showing, check script logic for stash_count variable. Verify wc and tr commands are available: which wc tr.
Check JSON input structure: echo '$input' | jq .. Verify cost.total_tokens exists: echo '$input' | jq .cost.total_tokens. Check alternative field: echo '$input' | jq .session.totalTokens. Verify jq is installed: which jq. Test with sample JSON: echo '{"cost":{"total_tokens":1234}}' | jq -r '.cost.total_tokens // 0' (should return 1234).
Check JSON input: echo '$input' | jq .model. Verify model.display_name exists: echo '$input' | jq .model.display_name. Check alternative: echo '$input' | jq .model.id. Verify sed command works: echo 'claude-sonnet-4.5' | sed 's/claude-//' (should return sonnet-4.5). Check model field structure in Claude Code JSON output.
This is expected behavior - script gracefully handles non-git directories. Verify git repository check: git rev-parse --git-dir (should return .git path or error). If you want git info in non-git directories, modify script to show 'no-git' indicator. Check workspace path: echo '$input' | jq .workspace.current_dir.
Show that Git Status Statusline - Statuslines is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.
[](https://heyclau.de/entry/statuslines/git-status-statusline)Git Status Statusline - Statuslines side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
| Field | Git-focused statusline showing branch, dirty status, ahead/behind indicators, and stash count alongside Claude session info Open dossier | Clean, performance-optimized statusline with Powerline glyphs showing model, directory, and token count Open dossier | Comprehensive multi-line statusline displaying detailed session information across two lines with organized sections and visual separators Open dossier | Starship-inspired powerline statusline with Nerd Font glyphs, modular segments, and Git integration for Claude Code Open dossier |
|---|---|---|---|---|
| Next steps | ||||
| Trust | ||||
| Review status | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed |
| Package trust | Package not verified | Package not verified | Package not verified | Package not verified |
| Source provenance | Source-backed | Source-backed | Source-backed | Source-backed |
| Submitter | — | — | — | — |
| Install risk | Review first | Review first | Review first | Review first |
| Notes | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ |
| Brand | — | — | — | — |
| Category | statuslines | statuslines | statuslines | statuslines |
| Source | source-backed | source-backed | source-backed | source-backed |
| Author | JSONbored | JSONbored | JSONbored | JSONbored |
| Added | 2025-10-01 | 2025-10-01 | 2025-10-01 | 2025-10-16 |
| Platforms | Claude Code | Claude Code | Claude Code | Claude Code |
| Source repo | — | — | — | — |
| Safety notes | ✓Runs as a Claude Code statusline command on every refresh and depends on the local shell environment; a failure only affects status rendering, not your session. | ✓Runs as a Claude Code statusline command on every refresh and depends on the local bash environment, jq, and a Powerline-patched font; a failure only affects status rendering, not your session. | ✓Runs as a Claude Code statusline command on every refresh and depends on the local shell environment; a failure only affects status rendering, not your session. | ✓Runs as a Claude Code statusline command on every refresh and depends on the local shell environment; a failure only affects status rendering, not your session. |
| Privacy notes | ✓Reads the Claude Code statusline JSON from stdin (model, workspace path, token usage) and renders it in the local terminal; it does not send data off-machine. | ✓Reads the Claude Code statusline JSON from stdin (model, workspace path, token count) and renders it in the local terminal; it does not send data off-machine. | ✓Reads the Claude Code statusline JSON from stdin (model, workspace path, token usage) and renders it in the local terminal; it does not send data off-machine. | ✓Reads the Claude Code statusline JSON from stdin (model, workspace path, token usage) and renders it in the local terminal; it does not send data off-machine. |
| Prerequisites |
|
|
|
|
| Install | — | — | — | — |
| Config | | | | |
| Citations | ||||
| Claim | Unclaimed | Unclaimed | Unclaimed | Unclaimed |
Source-backed guides for putting this to work.
Configure Claude Code bash sandboxing for safer autonomous shell use.
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.