Skip to content

Processes pile up when Claude Code keeps stdin open #485

Description

@shaharke

Hey! I ran into something weird — after a while my machine started crawling and I found 35+ ccstatusline processes all sitting there doing nothing.

What's happening

Claude Code spawns a new ccstatusline process each refresh cycle but keeps the stdin pipe open without sending EOF. Since readStdin() waits for EOF before processing (for await (const chunk of process.stdin)), each process just hangs indefinitely. They pile up fast with a short refreshInterval.

You can reproduce it like this:

# keeps pipe open, like Claude Code does
(echo '<status-json>'; sleep 60) | ccstatusline
# hangs forever

Workaround I found

Wrapping with head -1 forces EOF after the first line and things work fine:

"statusLine": {
  "command": "bash -c 'head -1 | ccstatusline'"
}

Possible fix

Adding a read timeout in readStdin(), or resolving as soon as stdin goes idle, would probably handle this cleanly without needing the wrapper.

Not sure if this is also a Claude Code bug (it probably should close stdin), but figured it's worth flagging here too since ccstatusline could defend against it.

Thanks for the great tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions