---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/claude_code_cli/wire/interfaces/WrapperGrandchildSpawnedEvent.md
description: >-
  The `claude` grandchild has just been spawned, detached in its own process
  group. Emitted once, immediately after `spawn()` returns and before any
  stream-json line has been parsed — issue #42 defect #1's additive protocol
  extension: without this, the adapter's own SIGKILL escalation in
  `gracefulShutdown()` could only ever target the wrapper's own pid, never the
  grandchild's process group, so escalating past a wrapper that ignores SIGTERM
  would orphan the grandchild's entire group (SIGKILL cannot be caught by any
  handler, so the wrapper's own `process.on('exit', ...)` group-cleanup can
  never run in that case). A consumer/adapter build that predates this event
  simply never sees it — the union member is additive, and every existing branch
  keeps working unchanged.
---

# Interface: WrapperGrandchildSpawnedEvent

Defined in: [src/batteries/llm/claude\_code\_cli/wire.ts:161](https://github.com/NHTIO/ADK/blob/v1.20260925.0/src/src/batteries/llm/claude_code_cli/wire.ts#L161)

The `claude` grandchild has just been spawned, detached in its own process group. Emitted once,
immediately after `spawn()` returns and before any stream-json line has been parsed — issue
\#42 defect #1's additive protocol extension: without this, the adapter's own SIGKILL escalation
in `gracefulShutdown()` could only ever target the wrapper's own pid, never the grandchild's
process group, so escalating past a wrapper that ignores SIGTERM would orphan the grandchild's
entire group (SIGKILL cannot be caught by any handler, so the wrapper's own
`process.on('exit', ...)` group-cleanup can never run in that case). A consumer/adapter build
that predates this event simply never sees it — the union member is additive, and every
existing branch keeps working unchanged.

## Properties

| Property                          | Type                   | Description                                                                                                                                                                                                                                                          | Defined in                                                                                                                                          |
| --------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|  `pid`   | `number`               | The grandchild's OS pid. Spawned with `detached: true` (its own process group leader), so on POSIX this pid also equals the process group id (pgid) — the adapter negates it (`process.kill(-pid, 'SIGKILL')`) to signal the whole group, not just this one process. | [src/batteries/llm/claude\_code\_cli/wire.ts:169](https://github.com/NHTIO/ADK/blob/v1.20260925.0/src/src/batteries/llm/claude_code_cli/wire.ts#L169) |
|  `type` | `"grandchild_spawned"` | Discriminant for the [WrapperEvent](../type-aliases/WrapperEvent.md) union.                                                                                                                                                                                          | [src/batteries/llm/claude\_code\_cli/wire.ts:163](https://github.com/NHTIO/ADK/blob/v1.20260925.0/src/src/batteries/llm/claude_code_cli/wire.ts#L163) |
