Context X-Ray
Context X-Ray is the framework's context garbage-collection surface. It shows
the current thread's model-bound context as content-derived segments with token
counts, then lets the user or agent pin, evict, or restore individual segments.
Actions
| Action |
When to use |
context-manifest-get |
Read the current manifest for a thread. Returns token totals, segment status, source, and whether changes are enforceable. |
context-preview-get |
Compose the would-be system context for the current user/org/app without a live thread. Returns labeled system sections with provenance, governance tier, token counts, and bounded previews. Backs the Agent page Context tab. |
context-pin |
Preserve a segment across future compaction/model calls. Use for task specs, acceptance criteria, user constraints, and other durable context. |
context-evict |
Exclude a stale or irrelevant segment from future model calls. Eviction is reversible and never deletes chat history. |
context-restore |
Undo a pin, evict, or summarize directive for a segment. |
context-report |
External hosts can report their visible context inventory. These manifests are advisory unless Agent-Native owns the emitted content. |
System Sections
Manifests now cover the system-prompt half of context, not just conversation
segments. Each system section carries a provenance label (framework-core,
actions-prompt, template, enterprise-workspace-core, sql-workspace,
legacy-app-default, organization, personal, memory, db-schema, tools,
model-overlay, runtime-context) and a governance tier:
required — framework/enterprise policy; can never be altered by the user.
inherited — template/org/workspace instructions; managed elsewhere,
visible here.
user — personal instructions and memory; editable through Files.
System sections are display-only provenance: they cannot be pinned, evicted,
or summarized. The persisted manifest stores source refs, scope, content
hashes, token counts, and bounded previews (~200 chars) — never raw prompt
bodies; full content stays behind the resource/access model. The in-chat
X-Ray panel groups these under "System", and the Agent page Context tab
renders the full breakdown (via context-preview-get) with a
system-vs-conversation split meter. Manifests are the latest snapshot per
thread; there is no per-iteration history.
Rules
- Never evict or summarize protected segments. The manifest marks active-turn
user/tool/thinking context as
protected.
- System sections are never evictable; required/inherited tiers are locked by
design — do not present controls that imply otherwise.
- Prefer pinning the user's task, requirements, and decisions before evicting
large stale tool results.
- Eviction excludes content from future model calls; it does not delete the
canonical transcript or files.
- In external/advisory mode, be honest: recorded directives are intent for the
host except for Agent-Native-originated content we can actually withhold.
- If token counts are estimated, describe reclaim as approximate.
Typical Flow
- Call
context-manifest-get with the active threadId.
- Sort segments by
tokenCount and inspect large stale Tool results or
Files read entries.
- Call
context-pin for essential specs or user instructions.
- Call
context-evict for large irrelevant segments.
- Offer
context-restore if the user wants undo.
1---2name: context-xray-23description: Inspect and manage the live agent context window with Context X-Ray. Use when context is getting large, the user asks what is in context, or stale tool results/files should be pinned, evicted, restored, or reported by an external host.4---56# Context X-Ray78Context X-Ray is the framework's context garbage-collection surface. It shows9the current thread's model-bound context as content-derived segments with token10counts, then lets the user or agent pin, evict, or restore individual segments.1112## Actions1314| Action | When to use |15| --- | --- |16| `context-manifest-get` | Read the current manifest for a thread. Returns token totals, segment status, source, and whether changes are enforceable. |17| `context-preview-get` | Compose the would-be system context for the current user/org/app without a live thread. Returns labeled system sections with provenance, governance tier, token counts, and bounded previews. Backs the Agent page Context tab. |18| `context-pin` | Preserve a segment across future compaction/model calls. Use for task specs, acceptance criteria, user constraints, and other durable context. |19| `context-evict` | Exclude a stale or irrelevant segment from future model calls. Eviction is reversible and never deletes chat history. |20| `context-restore` | Undo a pin, evict, or summarize directive for a segment. |21| `context-report` | External hosts can report their visible context inventory. These manifests are advisory unless Agent-Native owns the emitted content. |2223## System Sections2425Manifests now cover the system-prompt half of context, not just conversation26segments. Each system section carries a `provenance` label (framework-core,27actions-prompt, template, enterprise-workspace-core, sql-workspace,28legacy-app-default, organization, personal, memory, db-schema, tools,29model-overlay, runtime-context) and a `governance` tier:3031- `required` — framework/enterprise policy; can never be altered by the user.32- `inherited` — template/org/workspace instructions; managed elsewhere,33 visible here.34- `user` — personal instructions and memory; editable through Files.3536System sections are display-only provenance: they cannot be pinned, evicted,37or summarized. The persisted manifest stores source refs, scope, content38hashes, token counts, and bounded previews (~200 chars) — never raw prompt39bodies; full content stays behind the resource/access model. The in-chat40X-Ray panel groups these under "System", and the Agent page Context tab41renders the full breakdown (via `context-preview-get`) with a42system-vs-conversation split meter. Manifests are the latest snapshot per43thread; there is no per-iteration history.4445## Rules4647- Never evict or summarize protected segments. The manifest marks active-turn48 user/tool/thinking context as `protected`.49- System sections are never evictable; required/inherited tiers are locked by50 design — do not present controls that imply otherwise.51- Prefer pinning the user's task, requirements, and decisions before evicting52 large stale tool results.53- Eviction excludes content from future model calls; it does not delete the54 canonical transcript or files.55- In external/advisory mode, be honest: recorded directives are intent for the56 host except for Agent-Native-originated content we can actually withhold.57- If token counts are estimated, describe reclaim as approximate.5859## Typical Flow60611. Call `context-manifest-get` with the active `threadId`.622. Sort segments by `tokenCount` and inspect large stale `Tool results` or63 `Files read` entries.643. Call `context-pin` for essential specs or user instructions.654. Call `context-evict` for large irrelevant segments.665. Offer `context-restore` if the user wants undo.