You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hook command breaks when the statusLine command is wrapped (--hook appended outside bash -c quotes) #623
syncWidgetHooks and the install flow build the hook command as `${statusCommand} --hook` (dist 2.2.30, lines 63815 and 73334). If the statusLine command is a wrapper such as bash -c 'head -1 | ccstatusline', the result is bash -c 'head -1 | ccstatusline' --hook. bash takes --hook as $0, so ccstatusline never receives the flag.
Effect
On UserPromptSubmit, ccstatusline runs in render mode and prints the full statusline. Claude Code adds UserPromptSubmit stdout to the model context, so the model sees a statusline on every turn. The hook payload has no context_window, so the Context widget falls back to DEFAULT_CONTEXT_WINDOW_SIZE = 200000. On 1M-context models the model reads, for example, "272k/200k (100%)" and believes its context is full. Each prompt also triggers an extra usage lookup, and the usage widgets showed [Rate limited].
Repro
Set statusLine to bash -c 'head -1 | ccstatusline' and enable the Skills widget, so ccstatusline installs its hooks.
With the flag inside the quotes (bash -c 'head -1 | ccstatusline --hook') it prints nothing, as intended.
Suggested fix
Build the hook command independently of the statusLine string (for example, resolve the ccstatusline invocation itself), or detect a bash -c '…' wrapper and insert --hook inside it. A defensive option: make render mode print nothing when the stdin JSON carries hook_event_name.
Note: a manual fix to settings.json is overwritten the next time syncWidgetHooks runs, because it strips and re-adds the managed hooks.
Activity
fix(hooks): dispatch wrapped hook payloads without rendering (#641)