CCD-CLI 2.1.128+ (Claude Code Desktop remote) does not invoke statusLine in headless sessions despite compiled support
Summary
The CCD-CLI runtime (~/.claude/remote/ccd-cli/2.1.128, used by Claude Code Desktop for headless stream-json sessions) does not invoke the user-configured statusLine command, despite the binary containing compiled symbols for that feature.
The regular claude CLI (2.1.131 tested) invokes statusLine correctly. The bug only manifests in CCD-CLI sessions.
Impact
User-side context-awareness tooling that reads from a cache file populated by statusLine becomes silently stale indefinitely in CCD-CLI sessions. We rely on this for context-window warnings (75% / 85% thresholds for save-intermediate / encerrar). Without the cache update, our hook either emits a "stale" warning forever or, worse, presents misleading old context numbers.
This silently breaks any setup where statusLine is the only mechanism populating a downstream artifact.
Reproduction
- Configure
~/.claude/settings.json:
``json``
{
"statusLine": {
"type": "command",
"command": "bash /home/user/.claude/statusline-marechal.sh"
}
}
- Make the script write a timestamped file (e.g.
~/.claude/rate-cache.jsonwithts: $(date +%s)) - Open a Claude Code Desktop session in any project (which spawns CCD-CLI)
- Use the session normally for hours/days
- Observe:
rate-cache.jsonmtime does not update across turns - Verify the script works:
echo '{...synthetic payload...}' | bash <script>→ updates cache correctly
Empirical findings
CCD-CLI process args (from cat /proc/<pid>/cmdline):
/home/user/.claude/remote/ccd-cli/2.1.128
--output-format stream-json --verbose --input-format stream-json
--effort xhigh --model claude-opus-4-7[1m]
--permission-prompt-tool stdio
--allowedTools ...
--setting-sources=user,project,local
--permission-mode bypassPermissions
--allow-dangerously-skip-permissions
--include-partial-messages
--plugin-dir ...
No --statusline or equivalent flag visible.
Binary string analysis (strings ~/.claude/remote/ccd-cli/2.1.128 | grep -oE "(statusLine|StatusLine|status_line)[a-zA-Z_]*" | sort -u):
StatusLine
StatusLineCommand
statusLine
statusLineText
status_line_mount
status_line_result
This suggests the statusLine feature is compiled into CCD-CLI but the invocation path differs from the regular CLI. The symbols status_line_mount and status_line_result hint that invocation is tied to a UI mount event — which presumably doesn't fire in stream-json headless mode.
Versions
claude --version: 2.1.131- CCD-CLI binary (running process): 2.1.128
- OS: Ubuntu 22.04, kernel 5.15.0
- Settings: only user-level
~/.claude/settings.jsondefinesstatusLine; no project-level override
Questions
- Is
statusLineintentionally disabled in CCD-CLI headless sessions? If so, please document this. - If unintentional, is there a workaround (flag, env var, settings field) to force invocation?
- Is there a documented alternative event/hook in CCD-CLI to populate context state per-turn (something analogous to
statusLinefor headless mode)?
Workaround currently in place
We patched our UserPromptSubmit hook to parse the transcript_path JSONL directly:
tail -200 $transcript | jq -sc '[.[] | select(.type=="assistant" and .message.usage != null)] | last'- Extract
input_tokens + cache_creation_input_tokens + cache_read_input_tokens - Detect context window via model string match (
*1m*,*[1m]*) or heuristic (total > 195000 → 1M) - Compute
ctx_pct = total / context_window_size
This works empirically on claude-opus-4-7[1m]. Code available on request.
Would prefer a first-class solution from CCD-CLI side though.
Related
We saw --include-partial-messages in args — perhaps statusLine invocation could be expanded to emit a sidechannel event in stream-json output, allowing downstream tooling to pick it up?
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗