Native session context telemetry

The shared console distinguishes current context from cumulative token usage. A conversation can consume more tokens over its lifetime than fit in its context window. Neither value represents subscription charges.

Session.contextUsage is an account, native conversation, and process-generation-scoped observation. observedAt is collector freshness; context recordedAt and token observedAt preserve the native sample time. Unknown counts and unknown limits remain null, never guessed from a model name. The UI expires collector observations after 60 seconds. Child details support the same context-window shape.

The host collects live models, context and subagents independently every 15 seconds. Slow container builds, historical title scans and service-route reconciliation do not delay that observer. Each pass is bounded and does not overlap an unfinished pass. An idle Claude process can keep the same owned status-line file; rechecking its exact account, conversation, process generation and start boundary updates collector freshness while preserving native sample timestamps. A new process cannot inherit the previous process's measurements.

Context and usage payloads contain only sanitized numeric counters and identities. Prompts, transcript text, response bodies, credential material, and native filesystem paths are not serialized in those observations.

Upstream contracts checked on 2026-10-16:

The host publishes normalized measurements through /v1/agents/:id/sessions/:sessionId/context-usage. The controller rejects other hosts, accounts, conversations, providers, process generations, malformed counters, and future timestamps. Shared session cards omit account identifiers. Main context observations clear when the process ends or switches generation. Existing managed Claude collector scripts are refreshed in place; no command or prompt is sent to obtain these counters.

TUI, browser, and desktop use the same SessionContextRow. Projects and mosaic show current context and token scope below the model. The subagent detail panel displays each child's native usage and context window. Missing native measurements are explicitly unavailable. A status-line sample may be absent before the first response, immediately after compaction, or when native settings disable the collector.

The console displays token counts in thousands with a k suffix, including session totals, context use/limits and subagent input, output and cache counters. For example, 123,450 tokens appear as 123.45k; small counts retain enough precision to distinguish a nonzero observation from zero. API counters remain exact integer token counts.

The model row also shows native reasoning effort when reported, for example gpt-6.1-sol · high. Codex uses turn_context.effort from the exact latest turn, or that same turn's validated, same-model collaboration_mode.settings.reasoning_effort when no explicit effort is present. An explicit null in those native mode settings means the CLI selected its model default, displayed as model default (no explicit effort override). This is a native selection, not a claim that the effective reasoning level is known. The UI explains that the exact level is not reported; no model default is guessed from a model name or configuration file. Missing, invalid or mismatched fields remain unknown, and a later turn without native effort evidence clears the previous value. Claude uses the live status-line effort.level, including mid-session /effort changes. No effort is inferred from the model name or launch configuration. Unsupported or absent values stay unavailable.

Subagent details follow the same rule, including explicit native default selection, for Codex's own child turn records. Claude's subagentStatusLine reports a configured effort name or numeric token budget, so those values are explicitly labeled configured, rather than claimed as effective runtime effort. Account, conversation, ownership, process-generation, freshness and secret-redaction checks apply to effort too.

Antigravity model observations use the official hook modelName field, with conversationId from the same invocation. The private reporter keeps only the bounded native model identifier and identity fields. The host verifies its account UID, managed session, conversation, live process generation and start boundary before publishing antigravity-native-hook evidence. This field does not establish reasoning effort, token usage or child-agent state; model-name suffixes are preserved without interpretation. A missing or invalid model clears the previous observation. Existing sessions without the managed hooks remain unknown until native evidence is available. Antigravity hook input contract.

Subagent activity and history

The summary separates current activity from recorded children, for example 0 active · 4 recorded. Press j on a session to inspect its child history. Completed children remain available there; zero active children does not mean their history was lost. A truncated history is marked with ≥. The active count still uses all available native markers and expires with the observation.

A Codex Interacted event records an interaction, not a liveness transition. Only a native start or resumed child task marks it active; completion or interruption marks it inactive. No prompt is sent to discover child state.

Native CLI goals

Session.currentGoal is the goal installed inside the native CLI through /goal. It is separate from an autonomous Run goal, handoff text, prompts, session titles and Overnight. Projects, Mosaic and session lists show its short objective beside the name; session details expose a paged view of the observed objective. Completed goals retain their native completed status until cleared in the CLI. The shared title shows a green full bar and 100% for a native completed goal. When the native session also records a confirmed checklist during that installed goal, it shows completed items and their fraction, for example ■■■□□ 67% (2/3) · active. This measures checklist items, not remaining effort or independently verified acceptance criteria. Even 100% (3/3) · active keeps the native goal active; only the native goal's completion turns it green. Without a confirmed Codex checklist, the compact title distinguishes no checklist, reading checklist, unconfirmed checklist and an unavailable matching goal marker. The existing goal-details view explains the reason. Older observations without a reason retain progress not reported. Unknown progress never becomes 0%. Some Codex code-mode toolsets do not expose update_plan; an active native goal alone supplies no completed/total task counts. Token use and elapsed time remain accounting and never become a task percentage. When Codex stores a native pasted-text reference as its installed goal, the host reads the referenced goal text from that exact account's managed attachments/<UUID>/pasted-text-<number>.txt subtree. The renderer never opens referenced paths, and private attachment paths are not displayed. Short textual goals and resolved pasted goals appear beside the session name with a short excerpt; details retain the bounded objective. Neither operation modifies the goal in the CLI.

Codex collection reads only the exact thread's row in the account-owned CODEX_HOME/goals_1.sqlite database. The installed 0.161.0 CLI's generated v2/ThreadGoalGetResponse.json and native thread_goals schema were checked on 2026-10-16. This is a separate database from state_5.sqlite. A bounded private snapshot includes committed WAL changes; the original database and sidecars are never opened for writing. The snapshot query uses the thread primary key and returns only objective, status, update/creation times and supported numeric accounting from the same exact row. Legacy or custom database paths are not searched as fallbacks. Unsupported schemas, missing state, invalid ownership and failed reads remain unknown.

Paste resolution accepts only the exact native wrapper and managed Codex account path. Files and every attachment directory must be physical and owned by that account's runtime UID. Reads reject symlinks, hardlinks, traversal, foreign accounts, unsupported filenames, nested references, invalid UTF-8, missing files and attachments larger than 16 KiB. Directory descriptors pin Linux traversal; file and ancestor inode/change-time checks reject replacement or mutation during collection. Resolution shares the existing bounded collection deadline and does not search transcripts or other directories. Invalid references stay unknown and legacy unresolved reference observations remain hidden in the UI. Artifact contents and paths are never logged.

The collector normalizes whitespace and terminal controls and retains a bounded excerpt of up to 2,000 display-safe characters of the native objective. Codex status is kept as active, paused, blocked, usage_limited, budget_limited or complete. An exact successful read without a row clears the displayed goal. An installed goal may predate a resumed process; account UID, native thread, live process generation and collector freshness bind the observation instead of requiring its native update timestamp to follow launch.

Claude uses native transcript attachment.type: "goal_status" records, verified against the official installed 2.1.285 and published 2.1.301 CLI implementations on 2026-10-16. A set sentinel supplies condition; achieved evaluations expose complete, and impossible evaluations expose failed. A sentinel with met: true means cleared, including native unrecoverable-error clearing; it does not prove achievement. The reader follows the exact main session's UUID parent chain from a native message written by the current process. Goals from sidechains, discarded branches and prompt text are excluded. After resume, the goal remains unknown until native evidence identifies the current branch. The backward scan and verified branch checkpoints are bounded; missing ancestry, unsupported compact boundaries and invalid native records remain unknown. Collection does not parse the prose of a goal-evaluation response. Claude native goal lifecycle and resume behavior.

Bounded Codex checklist recovery

A native goal can outlive the last 4 MiB of its rollout. The host advances through only that selected owned rollout in batches of at most 4 MiB, plus a bounded header and short checkpoint verification. It retains the reducer state, a byte position, and the hash/length of a short anchor; it never caches transcript bodies, task text or tool arguments. The cache is bounded and expires. Large histories converge over ordinary polls; an incomplete scan withholds old percentages.

Checkpoints are bound to the account, native conversation, process generation, current goal creation time/objective, and physical file identity. A replacement, truncation, changed anchor, goal edit or rollback invalidates old checklist scope. Only a matching native goal marker followed by a successful update_plan receipt establishes counts. This read neither sends a prompt nor changes native files.

inspect_current_project.session.nativeGoal.progressUnavailableReason exposes the same bounded reason without account or native IDs. The shared TUI/web/app renderer uses it; the native goal's confirmed complete state still establishes 100%.

Goal progress and accounting

The upstream surfaces were rechecked on 2026-10-19:

CLI Observed goal state Work completion Separate accounting
Codex Exact native thread goal Native complete proves goal completion; successful update_plan receipts can supply a separate completed/total checklist Native tokens_used, optional token_budget, and time_used_seconds
Claude Main-branch goal_status attachments Native met proves goal completion; successful Task/TodoWrite calls after that goal's set sentinel can supply checklist counts Its native status screen reports elapsed time, evaluation turns and token spend; these are not work completion counters
Antigravity Its own CLI supports /goal; documented public hook/status-line payloads do not expose the installed goal Not collected; no percentage inferred Not collected for goals

Codex goal details label observed token counters as Goal budget used or Goal tokens used, separately from work progress. Spending can exceed a budget while work remains incomplete. Null budgets remain unbounded; invalid, negative, fractional, overflowing or unsupported counters remain unavailable. The host reads counters from the same bounded native snapshot as the objective; replacing or clearing a goal cannot inherit another goal's counters. Old schemas without the optional accounting columns continue to show the goal. There is no paid polling, injected prompt, extra agent turn, or conversation change to obtain progress.

currentGoal.progress contains only the native checklist source, completed/total counts and native record time. Task titles, descriptions, tool arguments/results and transcript bodies are never sent to the controller. Percentages round to the nearest integer and remain below 100 until every checklist item is complete.

Codex reads the already verified thread's owned rollout, bounded to a 4 MiB tail. A matching native thread_goal_updated marker must establish the current objective and creation epoch before the plan call. A correlated native function_call_output containing the fixed Plan updated receipt confirms the update_plan call. Current Codex does not persist the transient plan_update event, so merely assuming that event appears in JSONL would produce no progress. An edited/replaced objective, newer unconfirmed or malformed plan, rollback, missing creation metadata or missing marker makes checklist progress unknown. Accounting updates for the same objective/creation epoch preserve a confirmed checklist. Copied prompt text and another thread's records cannot supply one.

Claude follows its exact native UUID branch back to the current goal's set sentinel, within a separate 4 MiB bounded tail. It reconstructs successful TaskCreate/TaskUpdate receipts by tool-use ID, including native task IDs from structured create results, or the latest successful TodoWrite snapshot. Only tasks created on that branch after the installed goal's set are counted. Updates to unobserved tasks, shared lists with incomplete provenance, failed or unconfirmed calls, empty/invalid lists, a replaced goal, missing ancestry or a compaction boundary leave the percentage unknown. This deliberately does not read arbitrary shared ~/.claude/tasks/ lists or count a parent's/sibling's tasks. Task tools are model-dependent upstream; the collector does not enable tools or send an extra prompt to manufacture a checklist.

These are native agent-maintained task statuses, not a guarantee that the checklist covers every part of the goal. Some sessions never publish a checklist; older CLI schemas, code-mode call formats without durable native receipts and records beyond the scan bounds remain unknown. Public browser-link headers retain their minimal goal text/status/completed projection; they do not receive private checklist telemetry or partial percentages.

The collector does not convert token spend, context use, time, evaluation count, or unrelated plan/checklist steps into task completion. Goal status and spending use the existing account, native conversation, process generation and 60-second freshness checks. Expired or mismatched observations hide both the progress label and accounting. Named shared-session cards omit private goals. Public browser links expose the owner's short native goal in their explicit terminal header projection; account IDs, native identities, paths and raw goal records remain private.

Checked sources: Codex goal lifecycle and accounting model, the installed Codex 0.161.0 and current upstream ThreadGoalGetResponse JSON schema, the official Claude 2.1.302 native goal_status writer, Claude goal status, Codex plan tool, Codex rollout persistence policy, Claude task tracking and structured receipts, Antigravity goal lifecycle, Antigravity hook contract, and Antigravity status-line fields.

The host publishes goals through the authenticated agent /v1/agents/:id/sessions/:sessionId/current-goal route. The controller rejects other hosts, accounts, conversations, providers and generations. Observation freshness expires after 60 seconds; process end, restart and provider identity changes clear the stored observation until the next valid collection. Goal objectives are omitted from named shared-session cards; public browser links include only the short header projection described in Shared sessions. Collection never resumes a CLI, sends input, changes a goal or wakes an agent. Missing native sources remain unknown; Run goals, handoffs and prompts never serve as fallbacks.

Subagent goals

NativeSubagent.currentGoal tracks a child's own installed native goal. It is separate from the parent's goal and the child's task title or spawn prompt. The same goal renderer appears in the subagent details and the active-child Mosaic preview: an observed completed goal shows 100%; a confirmed child checklist shows its own completed/total percentage and native lifecycle state. Missing checklist data says progress not reported. Codex's native token spending and optional budget are a separate row. Even spending above the budget never means the work is complete. A replacement or clear replaces the prior observation and accounting.

Codex first verifies descendants through native session_meta parent links and successful native collaboration events. It then queries only the parent and those child thread IDs in one bounded, private goals_1.sqlite snapshot. This does not scan unrelated goals or copy the database once per child. Nested descendants retain their immediate parent identity while the goal observation also binds to the managed root conversation and generation. Native thread IDs without a goal return an empty goal; parent goals are never inherited.

Claude reads only native goal_status attachments on the exact child's isSidechain: true / agentId branch in its owned agent-<id>.jsonl file. Current-generation native start/stop markers establish that child's managed identity. Main-branch or sibling goals, prompt text, discarded branches, unresolved branches, symlinks and files owned by another UID cannot provide a child goal. This observes a goal only if that CLI actually writes a native child goal; it does not add /goal support to a subagent or claim that a prompt containing a goal installs one. Old/incomplete transcripts without that native evidence remain unavailable. Child goal scans share the existing two-second/8-MiB child-collection limits, with at most 512 KiB for one child.

The existing authenticated subagent endpoint carries these observations. Its contract, controller, Store and renderer check child ID, root native identity, account, provider, process generation and timestamps. Goals expire after 60 seconds without verified collection, disappear on identity/generation changes, and are omitted from other users' shared cards. Public link headers expose only the primary session's short goal, never child goal records. There is no extra prompt, paid model call or agent wake-up. Antigravity and other clients whose public telemetry does not expose installed child goals remain unsupported.