[BUG] Statusline doesn't refresh after `!` (bash mode) commands complete

Resolved 💬 2 comments Opened Jan 25, 2026 by thomasreichmann Closed Jan 25, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using a custom statusline that displays git state, the statusline doesn't refresh after ! commands complete. The statusline continues showing stale git information until the user interacts with the input field.

What Should Happen?

The statusline should refresh after ! command output completes, the same way it refreshes when the user types in the input field.

Steps to Reproduce

  1. Save this minimal statusline script as ~/.claude/statusline.sh and chmod +x it:

```bash
#!/bin/bash
input=$(cat)
cwd=$(echo "$input" | jq -r '.workspace.current_dir')

printf '%s' "${cwd/#$HOME/~}"

if git -C "$cwd" rev-parse --git-dir > /dev/null 2>&1; then
branch=$(git -C "$cwd" rev-parse --abbrev-ref HEAD 2>/dev/null)
if [ "$branch" = "HEAD" ]; then
commit=$(git -C "$cwd" rev-parse --short HEAD 2>/dev/null)
printf ' (detached: %s)' "$commit"
else
printf ' (%s)' "$branch"
fi
fi

echo
```

  1. Configure in ~/.claude/settings.json:

``json
{
"statusLine": {
"type": "command",
"command": "/Users/you/.claude/statusline.sh"
}
}
``

  1. Open Claude Code in a git repo on a branch (e.g., main)
  2. Run !git checkout -b test-branch
  3. Observe: statusline still shows (main) instead of (test-branch)
  4. Type ! in the input field, and then clear the input → statusline updates correctly

Is this a regression?

I don't know

Claude Code Version

2.1.19 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗