---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/claude_code_cli/wire/interfaces/WrapperGrandchildExitedEvent.md
description: >-
  The `claude` grandchild's OS process has exited (observed via the wrapper's
  own `grandchild.on('exit', ...)` handler) — issue #42 round-2 defect #1's
  additive protocol extension. Emitted unconditionally on that exit, independent
  of whether it was expected (`sawResult`) or already mid-shutdown, and
  independent of whether the wrapper itself goes on to exit cleanly afterwards.
---

# Interface: WrapperGrandchildExitedEvent

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

The `claude` grandchild's OS process has exited (observed via the wrapper's own
`grandchild.on('exit', ...)` handler) — issue #42 round-2 defect #1's additive protocol
extension. Emitted unconditionally on that exit, independent of whether it was expected
(`sawResult`) or already mid-shutdown, and independent of whether the wrapper itself goes on to
exit cleanly afterwards.

## Remarks

Exists solely so the adapter can clear its own cached `grandchildPid`: once the grandchild is
gone, its pid/pgid is free for the OS to reuse for an entirely unrelated process group, and the
adapter's SIGKILL-escalation path in `gracefulShutdown()` must never signal a pid it no longer
has positive evidence is still the grandchild's own group. The wrapper itself can observe (and
emit) this even while stuck elsewhere in its own shutdown sequence — Node still delivers a
`ChildProcess` `'exit'` event to a handler registered on it regardless of what else the process is
doing — unless the wrapper is wedged badly enough to never run any JS at all, in which case
nothing it could emit would help regardless. 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                                                                                                                                          |
| --------------------------------- | --------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|  `type` | `"grandchild_exited"` | Discriminant for the [WrapperEvent](../type-aliases/WrapperEvent.md) union. | [src/batteries/llm/claude\_code\_cli/wire.ts:193](https://github.com/NHTIO/ADK/blob/v1.20260925.0/src/src/batteries/llm/claude_code_cli/wire.ts#L193) |
