For standalone scripts outside a Codex session, pass --owner-session-id or set CLAUDE_COMPANION_SESSION_ID before delegating work.
Changed
- Require an owning Codex session for new delegated work and owner-scoped reads. The owner resolves from
--owner-session-id, thenCLAUDE_COMPANION_SESSION_ID, then a validCODEX_THREAD_ID, then the workspacecurrent-session.jsonmarker only while itsupdatedAtis less than 24 hours old; missing, malformed, or future timestamps reject the marker, and file mtime is never used. Newtask,review,adversarial-review, andpeer-createruns, plusbackground-routing-context, fail withSESSION_OWNER_REQUIREDbefore contacting Claude Code, creating jobs, or reserving job ids, and an accepted--job-idreservation is still released. Standalonetask/reviewcallers outside a Codex session must pass--owner-session-idor setCLAUDE_COMPANION_SESSION_ID. Without an owner, plainstatusreturns an empty, explained scope without listing or reaping jobs, and implicitresult/cancelrefuse; explicit ids, prefix matching, andstatus --allare unchanged. Implicitcancelwith an owner now considers only that owner's jobs and workflows.status,session-routing-context, andbackground-routing-contextJSON addownerSourceandmarkerStatusnext toownerSessionId.
Fixed
-
Record the SessionStart owner before pending cleanup can consume the hook budget. Keep the existing deadline and shared marker lock.
-
Keep
status --allavailable when the owner environment or marker contains an invalid session id. Request validation and the Claude Code loop guard retain precedence over missing-owner errors. Marker lock failures stop delegation and release an accepted reservation. -
Stop treating an old workspace marker as the current owner. Reads and same-owner delegation no longer renew the marker, and a prompt for another session still never overwrites it.
SessionEndnow trusts only the hook's session id orCLAUDE_COMPANION_SESSION_ID, so a missing id leaves jobs, processes, and the marker untouched; the Stop review gate recordsskipped_missing_owner_sessionwithout listing jobs or invoking Claude. Marker writes, the conditional prompt refresh, and the owner-checked clear now share the existing state lock, so a delayedSessionEndfor one session cannot delete another session's marker. Raw marker readers, including the Claude Code host-origin loop guard, remain age-independent.
CI
- Allow 60 minutes for the full mutation
stateshard; keep the other shards at 45 minutes. Mutation scope and score thresholds are unchanged.
Validation: all eight full mutation shards and PR CI passed; source, packaged and installed marker/lifecycle E2E passed.