Skip to content

Runtime and Daemon (Developer Reference) ​

Audience: Developers — Contributors extending the runtime, adapters, or stage evaluation.

Pipeline Lifecycle ​

Command stages branch before adapter and model resolution. The runner renders their context and directly starts /bin/sh behavior through a shell string in the workspace root. It closes stdin, merges stdout and stderr, and places the shell in a new process session. Captured output is written directly to the stage log rather than passing through agent event normalization.

The command handle owns the shell PID and process-group ID. Standalone signals and daemon cancellation therefore use the same escalation path as subprocess adapters. The command path performs no adapter preparation, continuation, post-run evaluation, skill movement, or read-only guard work. Pure-command slices can initialize the runner with no agent object.

For claude, codex, opencode, cursor, and antigravity runs, hpilot performs the following lifecycle:

  1. Performs preflight checks.
  2. Restores any skills left in .hpilot/backups/skills/ from a previous unclean shutdown (see Skill Disable/Restore in User Guide).
  3. Moves skills listed in disabled_skills from the project-local skills directory to .hpilot/backups/skills/<adapter>/.
  4. Builds an immutable StageEvaluationContext for the attempt. It carries the selected agent, workspace, stage prompt, contract, retry counters, and evaluation event-log path directly to the adapter.
  5. For each stage, before the agent starts: if the stage defines read_only_paths, prepares read-only enforcement for that adapter.
    • Claude and Antigravity use the shared Git-backed guard, which detects protected Git-visible changes without restoring them.
    • Cursor uses Git-backed detect-only enforcement after each synchronous SDK turn. The SDK exposes no native pre-write permission control.
    • OpenCode enforces read-only paths through ordered native permission rules in the private OPENCODE_CONFIG / OPENCODE_CONFIG_CONTENT overlay, session permissions, and programmatic MCP file-write admission.
    • Codex SDK stages use the same anchored baseline and fail on protected changes after each turn.
    • If the stage has no read_only_paths, skips adapter-level enforcement so the stage runs without it.
    • This per-stage lifecycle means design stages can get write protection while implementation stages run without enforcement.

Repository ownership is resolved from each configured pattern rather than from the workspace root:

Git-ignored paths are intentionally outside protection. An uncovered or ignored prefix produces a warning naming the exact pattern and is skipped. The stage visit retains one baseline across all retries. 6. Starts the agent in a dedicated process group when supported:

  • For Claude, the prompt is passed to the claude-agent-sdk query() function via an in-process background thread.
  • For Codex, the prompt is delivered through the synchronous openai-codex SDK.
  • For a Codex runtime with goal: true, the adapter persists and validates the complete rendered instructions, subscribes to thread-scoped goal notifications before activation, coalesces physical turns into one logical completion, and pauses then interrupts owned work on every non-success exit. It never uses the SDK helper that clears prior goal state during recovery.
  • Native Codex goals retain structured capacity and response-stream errors from physical turn notifications. Once a blocked goal is quiescent, a matching transient error enters the same SDK overload retry batches as ordinary turns. Each retry renews the SDK notification subscription before a status-only reactivation of the existing goal; it preserves the objective and accounting, does not debit StageTurnBudget or leave the adapter attempt, and serializes reactivation with cancellation. Only native completion debits the logical operation. Other terminal states and read-only guard violations still fail normally.
  • If contract or verifier evaluation requests a correction after goal completion, the next allowed stage attempt resumes the Codex thread, sends the correction as a user message, and reactivates the same goal with a status-only update. This sequence also applies to shared app-server writers. The activation response must preserve the objective, token budget, and cumulative token/time counters. Unsupported reactivation or changed accounting is a non-retryable harness failure. Each completed correction uses the normal stage attempt budget.
  • For Cursor, the prompt is passed to the synchronous cursor-sdk API on a worker thread.
  • For OpenCode, the prompt is sent via HTTP to the serve instance.
  • For Antigravity, agy acp receives the prompt via session/prompt and streams session/update notifications. Stderr is a separate diagnostic stream.
  1. Streams agent output into stderr and the stage log file.
  2. Passes each completed turn's reply and context to the adapter's evaluate_reply(). Shared evaluation validates the contract first, then obtains a structured verifier decision. Blocking decisions continue the current session when supported or enter the normal retry path.
  3. Re-validates contract artifacts after agent exit, then routes by contract status or explicit next_stage when configured.
  4. Subprocess transports terminate the agent process with bounded timeouts via terminate_process() (from hpilot.adapters._process):
    • Close stdin.
    • Wait up to 5 seconds for a graceful exit.
    • Send SIGTERM to the dedicated process group on POSIX (when the PID is a group leader) or the process elsewhere and wait up to 2 seconds.
    • Send SIGKILL to the dedicated process group on POSIX (when the PID is a group leader) or the process elsewhere and wait up to 5 seconds.
    • The OpenCode serve transport also uses terminate_process() for cleanup.
    • Antigravity requests ACP cancellation, then closes the transport and applies bounded process-tree cleanup.
    • The Cursor adapter runs its synchronous SDK agent on a worker thread. Cancellation sets a stop event, requests SDK cancellation when available, and joins the worker with a bounded watchdog.
    • The Claude adapter uses claude-agent-sdk query() in a background thread with its own asyncio event loop; the SDK run completes when the query generator is exhausted.
    • If a subprocess turn loop raises an exception, terminate_process() is called in the error path before the exception propagates. In-process adapters cancel via stop events or thread completion.
  5. Terminates the agent's descendant processes via SignalHandler.terminate_descendants():
    • Sends SIGTERM to the process group (or individual PID on Windows).
    • Waits up to 2 seconds.
    • Sends SIGKILL to survivors.
    • Falls back to individually tracked child PIDs.
    • This runs in the execute_stage() finally block as a defense-in-depth safety net after adapter-level process termination.
  6. Restores moved skills from .hpilot/backups/skills/ to their original project-local directories.
  7. After the full pipeline loop, runs SignalHandler.terminate_remaining_descendants() as a safety net. This is CLI-only; the daemon relies on per-stage cleanup because it may hold multiple accepted tasks while executing them serially.
    • Walks the process tree via psutil.Process(os.getpid()).children(recursive=True) to discover and terminate any orphans that escaped stage-level cleanup.
  8. Removes only process-owned runtime state on success, failure, or interrupt. Agent settings files are never patched or restored by hpilot.

Iteration-Aware Runtime Resolution ​

The immutable runtime snapshot stores stage-level runtime fields plus an optional non-recursive integer-threshold mapping. The single stage resolver requires a positive current iteration, combines the global harness, stage fields, every applicable threshold in ascending order, and the global effort fallback, then returns the effective harness/model/effort/goal runtime with selected-threshold diagnostic metadata. The diagnostic threshold is excluded from runtime equality so a same-runtime threshold cannot invalidate continuation.

Fresh startup paths without initialized runner counters resolve iteration 1. Explicit --resume restores the persisted positive stage visit before resolving and matching the saved runtime. The runner reloads once per attempt, passes the already-incremented visit count only for harness-backed execution, and leaves command stages on the common hook snapshot without runtime resolution. Candidate enumeration calls the same resolver for iteration 1 and every configured threshold, deduplicates by the harness/model/effort/goal runtime, and intentionally ignores pipeline max_iterations; standalone startup, daemon startup, doctor, adapter discovery, and skill preparation consume this conservative set.

Canonical config loading first inspects the original YAML node spelling under stage_overrides.*.iterations, then performs normal safe loading and typed validation. This prevents YAML coercion from accepting quoted integers, booleans, floats, leading zeroes, signs, separators, or alternate bases. Canonical writing retains explicit empty schedules, emits numeric integer keys in ascending order, normalizes harness and effort values, preserves stage and model strings and explicit goal presence (including false), and allows unrelated updates such as hpilot use to copy complete override objects.

Structured Running records and stage_start events add runtime_iteration_threshold only when a threshold applies. Session metadata matching consumes the actual effective harness, model, effort, goal mode, and persisted visit. An explicit --resume regenerates .hpilot/goal.md from the current rendered stage instructions before reopening the native Codex thread. Usage records stay attributed to the launched harness/model/effort runtime, so diagnostic metadata neither changes identity nor introduces a second accounting model.

Live stderr and canonical events ​

All adapters emit canonical log events through stream_logging. Each stderr line is prefixed with [StageName][adapter_name], where adapter_name is the canonical lowercase descriptor.name (for example claude, codex). Never use display_name for log prefixes — it is reserved for product-facing prose. The three canonical event kinds are:

  • reply: — Visible assistant text. Claude TextBlock and stream-json text are classified as reply. Multiline replies render as reply: on its own line, a blank line, then the body lines indented two spaces, with a blank line before the next log entry. Each content line keeps its original leading whitespace from the agent output, so code blocks, nested lists, and other indented structures keep their shape. Single-line replies use the inline format reply: text.
  • thinking: — Internal model reasoning. Claude ThinkingBlock, Codex reasoning summaries or content, and OpenCode reasoning text are classified as thinking. Multiline thinking uses the same blank-line-and-indent format as replies, with original leading whitespace preserved per content line. Single-line thinking uses thinking: text.
  • tool call: — Tool invocations. Tool calls render as tool call: <ToolName> followed by one indented field: label line per parameter. Multiline values show the field name on its own line with content indented below. No rendered parameter is truncated or capped at a fixed number of fields.

Protocol adapters and in-process SDK adapters emit canonical log events. Adapter-local tool_mapping.py modules define how each agent's tool kinds, titles, content types, and argument field names select shared formatters before events reach stream_logging.

The workspace MCP server builds the same CanonicalLogEvent(kind="tool_call") used by local harnesses and sends it through render_canonical_event; MCP calls therefore use the same generic field formatter without an MCP formatter registry. Argument names and insertion order are preserved, each parameter remains independent, and no synthetic fields such as range, limits, or content summaries are created. A shared sanitizer feeds both stderr and MCP JSONL, retaining safe scalar values, replacing bulky or credential-bearing values with placeholders, and bounding nested structures. file_edit old_text and new_text remain intentionally visible for review. Correlation IDs, durations, and bounded failure details are recorded in JSONL rather than emitted as routine completion lines on stderr.

The flattened MCP JSONL contract uses mcp_tool_call_start with tool, correlation_id, and sanitized arguments; mcp_tool_call_complete with tool, correlation_id, and duration_ms; and mcp_tool_call_failed with those fields plus an error.category and bounded error.message. Every record also carries timestamp and event; the removed tool_name, params, and success fields must not be reintroduced. Logging is best effort: sanitizer, renderer, JSONL, and stderr failures are reduced to debug logging and never propagate into MCP execution.

Key behaviors:

  • Rendered tool call: lines keep the original agent-visible tool name (for example run_shell_command) while using the mapped formatter name (for example Bash) only to summarize arguments.
  • Adapters must not print final tool lines themselves or add agent-specific branches in the shared formatters; extend the owning adapter's mapping module when a new tool payload shape appears.
  • OpenCode V2 translates scoped native session.text/reasoning/tool/step.* events, deduplicates completed parts and tool IDs, and suppresses lifecycle/metadata/heartbeats from stderr while retaining redacted JSONL diagnostics.
  • Completed OpenCode reasoning becomes a canonical thinking: block, not a duplicate raw-part line or visible reply.
  • Raw events are still persisted to the JSONL stage log for debugging.
  • During OpenCode cancellation, bounded interrupt failures caused by an already-stopped server are quiet; there is no dispose API. The SSE consumer suppresses expected transport errors after its stop event.

Daemon cancellation and in-process adapters ​

The RunningProcess protocol requires a cancel() method.

Cancellation behavior:

  • OpenCode V2 marks/wakes its cooperative cancellation event, interrupts the native session, skips post-failure usage/keep-alive, and stops only its owned server plus verified PID/create-time descendants, including detached MCP children. The same tree tracker survives retry handles and adapter cleanup after parent exit.
  • Codex interrupts the active SDK turn. A daemon watchdog closes the SDK client transport if the turn remains blocked, which terminates the standalone runtime and unblocks the notification reader.
  • For in-process adapters, cancel() stops the background SDK worker and joins the thread with a bounded timeout:
    • Claude requests cancellation of the running SDK task on its event loop thread with loop.call_soon_threadsafe; the worker checks the cancellation event every 100 ms so a delayed cross-thread wakeup cannot leave the task asleep. Cancelling at the suspended await unwinds the async for and closes the SDK async generators cleanly, avoiding the aclose(): asynchronous generator is already running error that a between-iteration flag can trigger. The same event covers the startup race before the task exists.
    • Cursor sets a threading.Event that the SDK thread checks between iterations.
  • Antigravity requests session/cancel for the active ACP turn and escalates to bounded process-tree cleanup.
  • When a daemon cancel request arrives, the handler sets the task's cancel event, optionally delivers SIGINT, and calls handle.cancel() on the active running handle.
  • This cooperative path ensures in-process SDK work stops promptly rather than continuing after the daemon has marked the task as cancelled.

Adapter Compatibility ​

  • Codex: Uses the official synchronous openai-codex SDK with an explicitly selected standalone Codex CLI.
    • Communication: One SDK client is created per stage attempt. Fresh attempts use thread_start; retry continuation and explicit --resume use thread_resume with the captured thread ID and current stage options. The first turn uses continuation_prompt when supplied, otherwise the stage prompt. Resume errors fail the attempt without an adapter-local fresh-thread fallback. Notifications are normalized into canonical events while the SDK's collector returns the authoritative final_response. Assistant and reasoning deltas are ignored; completed items become whole reply: and thinking: blocks.
    • Turn Lifecycle: Blocking verifier decisions continue on the same thread while the shared stage attempt budget remains. Each completed turn consumes one max_retries slot, including in-session contract repair and verifier continuations; the adapter's 25-turn safety cap still applies to direct adapter callers without a pipeline budget. SDK resources close on success and failure.
    • Cancellation: The active turn is interrupted first. If it remains blocked for five seconds, the SDK client transport is closed. Cancellation exits with code 130 and bypasses verifier continuation.
    • Threads receive the requested model and effort, current working directory, and autonomous base instructions. A standalone server uses Full access. A shared server supports Approve for me and Full access for new chats and keeps a resumed chat’s permissions. See shared server permissions.
    • Permissions: the shared Git-backed read-only guard is the sole authority for configured path subsets. Matching Git-visible changes fail the attempt and remain in the working tree. Git administration and ignored files are outside its scope.
  • OpenCode V2: Uses authenticated loopback HTTP with process-local runtime configuration and harness-owned native persistence; see the adapter reference for module responsibilities and the verification report for evidence/limits.
    • Communication: opencode serve --hostname 127.0.0.1 --port ... is intrinsically standalone; --standalone is a client flag. Generated per-process Basic auth (opencode / OPENCODE_PASSWORD), JSON /api/info, and actual OpenAPI operations are validated before work. HTML fallback and auth/config rejection fail explicitly. Locations use directory refs, not the disproven location-resolve endpoint/header.
    • Turn lifecycle: Subscribe to /api/event before asynchronous /api/session/{id}/prompt admission. Scoped terminal execution plus authoritative Session.Info and paginated messages identify the admitted user's completed assistant result. Verifier corrections share the native session and stage turn budget.
    • Model: Validate native provider/model#variant, resolve effort-only defaults, set the session Model.Ref before every turn, and reject a different effective model/explicit variant. No silent warning-only fallback or generated legacy reasoningEffort is used.
    • Permissions: Native root/agent/session ordered allows and ask normalizations precede user/mandatory denies. Shell/question are denied; yieldshell readiness is required. Known MCP file writes check actual paths via native permission admission; unknown asks reject autonomously. Policy conflicts and malformed inherited rules are deterministic configuration errors, not interactive questions or Git-backed detection.
    • Configuration: Merge user settings into a private temporary overlay without editing originals. Clear automatic context instructions, disable child project/Claude context discovery, and inject mcp.servers.yieldshell with codemode:false.
    • Retry/resume: Reuse the live server when possible; otherwise restart an owned server and load the persisted session with workspace/ID checks and usage baselines. Only native 404 produces explicit fresh fallback. Shared execution records that fallback and preserves the explicit-resume target throughout its initial visit, but consumes that intent before a later routed visit; auth/transport failure does not become fresh work.
    • Recovery/cancellation: Both EOF and SSE errors receive up to three observation reconnects per turn, never replaying prompt text. Heartbeats/owned activity refresh the 600-second silence deadline; unrelated sessions do not. Cancellation bypasses usage/verifier waits and keep-alive, interrupts, and stops the exact owned tree; /instance/dispose is removed.
    • Accounting: Distinct cumulative root/child session snapshots produce per-turn token/USD deltas; native reasoning contributes to canonical output, and unknown values remain unknown. Stage JSONL carries native USD estimates; shared local usage stores tokens, not a new cost column.
  • Cursor: Uses the in-process cursor-sdk>=1.0.24 adapter.
    • Process Model: The SDK Agent API is synchronous, so the adapter runs it on a worker thread and exposes a synchronous running handle to the pipeline.
    • Prerequisites: The cursor_sdk module must be importable. The platform wheel bundles its own bridge launcher under cursor_sdk/_vendor/bridge/, so no cursor-sdk-bridge binary needs to be on PATH.
    • Authentication: Reads only harnesses.cursor.api_key from the active hpilot config. Ambient environment variables and external login state are not fallback sources.
    • Communication: Calls the SDK directly. Events cross from the worker through a thread-safe queue; no session protocol or JSON-RPC transport is involved.
    • Message Translation: Handles SDK message attributes defensively, tolerates absent or unfamiliar fields, and converts recognized replies, thinking, tool calls, completion events, session identifiers, and usage data into canonical events. Cursor extracts nested subagent conversationSteps from completed task tool results and renders them through the same canonical paths as top-level output.
    • Tool Mapping: Preserves Cursor's reported tool name while selecting a canonical formatter for known path, command, search, edit, task, and todo payloads.
    • Verification: Evaluates the collected reply after each turn and sends a continuation prompt through the same SDK agent when the verifier blocks completion.
    • Permissions: The SDK exposes no native pre-write control. read_only_paths therefore use the shared Git-backed read-only guard as Git-backed detect-only enforcement; protected changes are left in place for manual or agent correction and fail the attempt.
    • Cancellation: Uses cooperative threading.Event signaling, invokes SDK cancellation when available, and joins the worker with a bounded watchdog.
  • Antigravity runs an owned agy acp subprocess. Each attempt starts a connection in the effective workspace, with the invoking environment and process-local --dangerously-skip-permissions. Stderr carries diagnostics.
    • The cached preflight check negotiates ACP v1 and native session reattachment in a temporary directory. It does not start a model turn.
    • A new attempt opens a session or reattaches by ID. The adapter sets an explicit model before applying an explicit reasoning effort from the choices advertised for that model.
    • ACP updates report reply text, any streamed thought text, and tool activity. The handle accumulates the current reply for the evaluator, excludes history replay during load, and records per-turn token counters from the completed prompt result where available.
    • A successful end_turn is evaluated against the stage contract or verifier. Corrections use the same live session and the shared stage turn budget. A confirmed missing session on reattachment follows the pipeline’s one-time fresh-session fallback.
    • Cancellation sends session/cancel, then closes the transport and cleans up the owned process tree within bounded waits.

Run-Daemon Coordination ​

When hpilot run is invoked (both bare-prompt and explicit run subcommand), it checks whether the daemon is reachable before acquiring the local .hpilot/instance.lock. If the daemon is reachable and has any active task (status: "running"), run exits 1 with a message showing the running task ID and stage, directing the user to attach or cancel. This prevents run instances from executing concurrently with daemon-submitted tasks in the same directory. When the daemon is unreachable, run falls back to the standard .hpilot/instance.lock mechanism.

CWD normalization: Task matching resolves symlinks and normalizes paths (including trailing slashes). This means /workspace, /workspace/, and symlinked paths to the same directory all resolve to the same canonical path, ensuring nested task detection is not bypassed by symlinks or trailing slashes.

Generated Artifacts ​

  • .hpilot/logs/hpilot.log.jsonl: Structured disposable run log.
    • Cleanup: Run startup removes only .hpilot/logs/hpilot.log.jsonl, .hpilot/logs/evaluation-events.jsonl, and .hpilot/logs/stages/, then recreates the stage directory. Persistent services/ and unrelated future log paths are preserved.
    • Exceptions: Non-log state (locks, backups, contracts, artifacts) is not affected.
    • Errors: Cleanup failures are logged as warnings and do not abort the run.
  • .hpilot/logs/services/daemon.jsonl: Persistent daemon lifecycle and connection diagnostics, including task context on disconnect when known.
  • .hpilot/logs/services/mcp.jsonl: Persistent sanitized and correlated MCP lifecycle and tool diagnostics.
  • .hpilot/logs/stages/<stage_name>.jsonl: Captured transcript per stage; created fresh as each stage executes — stale stage JSONL files from previous runs are removed during log cleanup.
  • .hpilot/backups/<stage_name>/<timestamp>/: Versioned backups of stage artifacts after successful completion; each timestamped directory preserves one run's artifacts; never wiped by the artifact reset step.
  • .hpilot/contracts/artifacts/*.yaml: Optional stage-result artifacts for contract-enabled stages.
    • Cleanup: Before each stage execution, all top-level files in this directory (except the current stage's own artifact) are removed to avoid confusing agents with stale artifacts.
    • Exceptions: Nested subdirectories are preserved.
  • .hpilot/logs/evaluation-events.jsonl: Post-run evaluation event log.
    • Contents: Records verifier decisions and contract validation failures.
    • Cursor Enforcement: Cursor writes enforcement events when the Git-backed guard detects and reports protected changes without restoration. It does not write an enforcement-mode marker because no proactive subset permission mode exists.
  • generated contract guidance is derived from each stage's contract.routes and contract field definitions in hpilot.yaml

Client Subcommand Reference (Daemon Mode) ​

  • hpilot status: Sends a ping message.
    • Exit Code: Exits 0 if the daemon is reachable, 1 otherwise.
    • Output: Reads the extended pong response containing active task snapshots (protocol v2) and prints running task IDs and stages. Excludes tasks with status "completed" or "cancelled". Displays "initializing" if active stage is null.
  • hpilot submit: Sends one run message. Once accepted, the client retains its logical event cursor across up to three replacement connections, discards incomplete connection-local chunks, and sends only cursor-bearing resume messages.
    • Behavior: Streams pipeline events and returns the pipeline exit code on run_complete.
    • Input: Accepts positional prompt or stdin. Positional argument takes precedence if both are present.
    • Promptless Run: If all stages in the slice have a self-contained prompt_template, runs without an objective. Otherwise, exits with an error showing which stages require a prompt.
  • hpilot attach: Sends a resume message and uses the same logical event consumer as submit for replay frames, chunks, rendering, terminal state, and stop-boundary state.
    • Behavior: Replays buffered events (handles chunked payloads) and streams live events until termination.
    • Resolution: If task_id is omitted, auto-resolves to the single running task in current directory (errors if zero or multiple tasks).
  • hpilot cancel: Sends a cancel message.
    • Behavior: Cancels the running task. Daemon responds with pipeline_abort and run_complete.
    • Resolution: Uses cwd to find the task if task_id is omitted (same rules as attach).
    • Exit Code: Client exits 0 on pipeline_abort, 1 on error.
  • hpilot logs: Sends a resume message; drains all buffered events and outputs each as a JSON line to stdout.
  • hpilot end: Sends a set_stop_stage message.
    • Arguments: Accepts exactly one of --after <stage>, --before <stage>, or --clear.
    • Resolution: Optional task_id targets a specific task; otherwise uses cwd.
    • Runtime Update: The daemon keeps immutable submit-time boundary snapshots for halt classification and separate mutable effective boundary fields for status. Every update synchronizes the mutable fields and both EndStageRef instances. When a ref is supplied, its value is authoritative at every stage transition, including a cleared null value; the static submit-time stop-before value is not consulted. (Daemon mode only; direct run mode is fixed at invocation.)

All client commands use the shared typed endpoint resolver and accept --socket, --host, and --port. The default is the canonical invocation workspace Unix socket; either TCP flag opts into TCP, and conflicting flags fail before connection. Resolution occurs once before task-specific directory changes, and reconnects reuse that immutable endpoint. The connection timeout is 5 seconds; failures name the selected transport and actual endpoint without fallback.

Native Session Persistence and Indexing ​

Adapters let the harness persist its own transcript and index, then expose only the native identifier to the pipeline metadata writer. NativeSessionBehavior on AdapterDescriptor documents expected behavior but is deliberately separate from HarnessCapabilities; runtime code must never branch on it or accept it as integration evidence.

Codex now receives a copy of the ambient environment with CODEX_HOME untouched. hpilot supplies model, working directory, effort and temporary workspace trust through the SDK. The shared chat or standalone runtime determines the sandbox and approval settings. The override prevents Codex from adding the stage workspace to persistent config.toml; live write-audit evidence confirmed auth.json and config.toml remained byte-identical while session JSONL, state databases, caches, and indexes changed under the configured Codex home. No authentication file, configuration file, database, session directory, or transcript is copied by production code.

Codex write-audit pathClassification
sessions/**/rollout-*.jsonl, shell_snapshots/*.shSession runtime, expected
state_*.sqlite*, logs_*.sqlite*, goals_*.sqlite*, memories_*.sqlite*Native state and indexes, expected
models_cache.json, cache/, plugins/cache/, skills/.system/Native runtime caches and indexes, expected
installation_id, .personality_migrationNative runtime metadata, expected
auth.jsonPersistent authentication, byte-identical
config.tomlInitial audit blocker: the SDK added a trusted-project entry; the process-local projects override removed that write, and the final audit was byte-identical

OpenCode uses a private OPENCODE_CONFIG / OPENCODE_CONFIG_CONTENT overlay and process-local authentication; it preserves XDG_DATA_HOME, XDG_STATE_HOME, and the native database location. Antigravity inherits the ambient process environment. Cursor leaves storage ownership to the synchronous SDK and bundled bridge.

Claude spike outcome ​

The selected outcome is R4: documented native-picker limitation with exact-ID direct resume. Probe A confirmed that the SDK's filesystem session API parses an entrypoint: sdk-py transcript without history.jsonl; the isolated Claude Code 2.1.220 picker did not render it. Probe B confirmed neither the own-project nor all-project isolated picker repaired visibility. Probe C confirmed changing gitBranch did not repair visibility. Probe D confirmed the SDK entrypoint environment reaches ClaudeAgentOptions, while the SDK already defaults its child entrypoint to sdk-py. Probe E confirmed an SDK session_store is a separate application store and is not a native CLI index. Probe F ran a live hpilot ClaudeAdapter stage in an isolated CLAUDE_CONFIG_DIR: the exact transcript survived and claude --resume <session-id> opened it, but both picker views omitted it. hpilot therefore adds no registrar and never writes history.jsonl; user documentation names direct resume as the verified boundary.

Native-surface tests record identifiers, membership, and boolean visibility outcomes only. They never return picker screens, prompts, responses, authentication values, or transcript bodies in diagnostics. See the Native Session Verification Report for the metadata-only evidence from the verified harness smokes.