[BUG] Custom statusLine permanently stops being invoked after a subagent/response completes at project scope — but not at user scope

Resolved 💬 1 comment Opened May 30, 2026 by Desp163 Closed Jul 3, 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?

A custom statusLine (type: command) in PROJECT settings (.claude/settings.local.json) renders fine at first, then permanently disappears mid-session — usually right after a subagent/Task or an assistant response completes. It never re-renders; only restarting Claude Code brings it back. refreshInterval: 10 is set but does NOT revive it.

The SAME command in USER settings (~/.claude/settings.json) does not disappear under the same workload.

I instrumented the script to log one line per invocation. Evidence:

  • Every invocation that ran finished in <30 ms with valid, non-empty output and exit 0 — so it is NOT the script erroring, timing out, or producing empty output.
  • When the line vanished, the log simply STOPPED for that session — i.e. Claude Code stopped spawning the command — while the claude process stayed alive (verified with ps).
  • A ~50x slower statusline (ccstatusline via npx, ~1.4 s/render) at USER scope did NOT disappear, ruling out script speed/timeout.

So at project scope Claude Code stops invoking the command after subagent/response completion; at user scope it keeps invoking it. Terminal- and OS-independent (persisted across Ubuntu 24.04 → 26.04 desktop and a full terminal change).

What Should Happen?

The statusLine command should keep being invoked for the whole session (including via refreshInterval), at both project and user scope. It must not permanently stop after a subagent/Task or an assistant response completes.

Error Messages/Logs

None — the absence of errors is the signal. The command never errors or exits non-zero; Claude Code just stops calling it. Per-invocation logging shows regular ~10 s ticks (refreshInterval) that abruptly stop the moment a subagent/response completes, while the `claude` process keeps running.

Steps to Reproduce

Minimal repro using a trivial marker command (no custom script, no Node):

  1. In a project, create .claude/settings.local.json:

{
"statusLine": {
"type": "command",
"command": "sh -c 'date +%s >> /tmp/sl-ticks.log; echo statusline-alive'",
"refreshInterval": 10
}
}

  1. Start Claude Code there. Confirm the line shows statusline-alive and /tmp/sl-ticks.log grows every ~10 s (tail -f /tmp/sl-ticks.log).
  2. Send a prompt that spawns a subagent/Task (or run several normal turns) and let it complete.
  3. Observe: the line disappears AND /tmp/sl-ticks.log stops growing — while claude is still running (ps aux | grep claude). It returns only after a restart.
  4. Move the SAME block to user settings ~/.claude/settings.json (remove it from the project file), restart, and repeat. The line keeps rendering and the marker log keeps growing.

The bug is intermittent ("after several iterations / after a subagent"), so step 3 may take a few cycles to trigger.

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.158

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

  • Reproduced on Ubuntu 26.04 desktop (also seen on 24.04) and across different terminal emulators (incl. Ptyxus) → not terminal- or OS-specific.
  • refreshInterval: 10 was set and did NOT revive the line after it vanished.
  • Saving any settings file triggers a statusline reload that revives a dead line WITHOUT a full restart (useful workaround, and a hint that the invocation loop can be re-initialized).
  • Workaround: define statusLine in ~/.claude/settings.json (user scope) instead of project scope.
  • Possibly related: #21304 (after Task/subagent), #18955 (after slash commands), #29383, #52637; and closed-not-planned #43826. The new element here is project-scope vs user-scope.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗