# fix\(claude\): preserve subagent task context snapshots · PR \#21644 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/21644)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: open

Source repository: pingdotgg/t3code

Source branch: claude-context/claude-adapter

Target branch: claude-context/client-support

Head commit: 93c22b64a6ef44dd0a6b714a1cbcb40e317be9d0

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/21644)

[Commits](https://git.cafe/pingdotgg/t3code/pull/21644/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/21644/diffs?format=markdown)

## Description

---

Claude task frames report context usage, but the adapter drops it before clients can display it. This layer maps the latest plain-task snapshot from progress and completion frames, including completion while the parent is idle. Empty-description progress can update usage without erasing text. Both ordinary resume and buffered-wake reopening clear stale snapshots; absent completion usage preserves the last report.

Depends on the client/contract layer [#21643](https://github.com/pingdotgg/t3code/pull/21643). Rebuilt from Gigioxx’s [#15446](https://github.com/pingdotgg/t3code/pull/15446), preserving its snapshot mapping and both reset paths while adapting to current idle-completion handling. Workflow lifetime totals remain separate and never appear as context snapshots. No cumulative sum, cost or maximum-window denominator is introduced. Related [#15429](https://github.com/pingdotgg/t3code/issues/15429) remains open.

Verification: adapter definitions 176→177 (expanded cases 286→287). One rebuilt lifecycle case and an extended existing two-variant wake case fail on main, then pass here: snapshots decrease, zero is retained, missing usage preserves it, both reopen paths clear it, and idle completion is captured. An existing workflow case was extended to catch context/lifetime conflation in active and idle progress; it failed before the review fix. All nine focused adapter cases pass (278 skipped); scoped server typecheck, targeted lint/format and diff checks pass with existing diagnostics only. Two fresh whole-stack review rounds by Claude Opus 5.5 and GPT-6 Sol completed; both reviewers found no blockers in the second round. Round one caught workflow lifetime totals mislabeled as context and stale lineage context beside a newer finished child run; both were reproduced and fixed. Reviewers also ran 50 selected adapter cases successfully (237 skipped).

Headless Linux proof uses the actual adapter harness with current SDK frame types, not a live Claude invocation. Integrated web proof is in [#21643](https://github.com/pingdotgg/t3code/pull/21643). No fresh provider/account, live workflow, macOS, Windows, iOS, Android, Electron desktop or remote/relay/tunnel execution was verified; those remain human verification limits.

Implemented with GPT-6.1 Sol through the Codex harness; tests by GPT-6 Astra; adversarial reviews by Claude Opus 5.5 and GPT-6 Sol through T3 Code delegation.

