Show HN: Custom statusline for Claude Code with Git/PR/environment info

2 dhkts1 0 8/9/2025, 7:23:01 PM gist.github.com ↗
I was constantly losing track of context while using Claude Code - which worktree am I in? What's my git status? Is there an open PR? So when Anthropic added statusline support, I built this enhanced version.

Opus 4.1 │ ~/git/tictactoe │ main │ 2 untracked │ 22:22 for example.

  It's a bash script that shows your current model, directory, git
  branch/status, PR number, Python venv, Node version, and more - all
  with color-coded emojis for quick visual parsing. The git integration
  shows staged/modified/untracked file counts, ahead/behind status, and
  even detects merge conflicts.

  What makes it useful: Everything you need is visible at a glance
  without running git status or gh pr view. It auto-detects worktrees
  (shows ), highlights conflicts in red, and truncates long paths
  intelligently.
  Technical approach: Reads JSON from stdin, uses git porcelain for
  accurate counts, caches gh CLI calls for PR info, and outputs ANSI
  color codes with fallback for non-color terminals.

  To try it: Save the script, make it executable, and add to
  ~/.claude/settings.json:
  "statusLine": {"type": "command", "command": "bash
  ~/.claude/statusline-command.sh"
}

Comments (0)

No comments yet