Skip to content

context-guard: zone capture is statusline-teed and silent in cloud/headless sessions #2957

Description

@kyle-sexton

Context

Surfaced in aihero-course lane 1 (#2899, 2026-08-17) while deciding handoff trigger criteria. context-guard's snapshot capture rides the statusline tee (scripts/statusline-tee.sh writing ~/.claude/context-guard/context/<session_id>.json on each statusline refresh). Verified in a live Claude Code on the web container: no statusLine is configured and ~/.claude/context-guard/ does not exist, so context-zone.sh resolves unknown and every zone consumer takes its conservative path. Consequence: the instrument-driven handoff trigger (zone says fork) is structurally silent exactly where sessions are most disposable (cloud), and session-flow:handoff's model-invocable proactivity loses its measurement there.

Proposed work

  • Investigate a cloud/headless-compatible capture path: whether cloud sessions ever refresh a statusline; whether a hook-based capture (e.g. PostToolBatch reading the same stdin fields, if available to hooks) or another documented mechanism can write the per-session snapshot without a statusline; verify against current official docs what context-window telemetry is available outside the statusline channel.
  • If a viable path exists, design it as an additive capture source honoring the existing reader contract (same snapshot path pattern, atomicity, staleness rule, fail-open posture). If none exists, record the limitation explicitly in reference/reader-contract.md and in the zone-consumer guidance so cloud consumers know unknown is expected, not an error.

Acceptance criteria

References

Metadata

Field Value
Category unspecified
Area context-guard
Ecosystem unspecified

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumReal value, no hard deadline; normal backlog flow.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions