[FEATURE] Expose background subprocess info to hooks

Resolved 💬 3 comments Opened Mar 23, 2026 by echo-bravo-yahoo Closed Mar 27, 2026

Summary

Claude Code tracks background subprocesses (dev servers, builds, long-running tasks) and displays them in the statusline. This information isn't available to hooks or external tooling.

Use case

Session managers and statusline hooks want to display or act on background subprocess state — for example, showing which dev servers are running across sessions, detecting when a build finishes, or cleaning up orphaned processes on session end.

Proposal

Expose background subprocess metadata in hook inputs. Suggested fields on the hook input object:

  • subprocesses: array of { pid: number, command: string, status: 'running' | 'exited', exit_code?: number }

This could be included on all hook events, or at minimum on:

  • stop / session-end (for cleanup)
  • post-bash (when a new background process is spawned)
  • notification (general state sync)

Alternatively, a dedicated subprocess-start / subprocess-end hook event would work and avoid bloating existing hook payloads.

Current workaround

None — the data is internal to Claude Code's process manager and not written to disk or exposed via any interface.

View original on GitHub ↗

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