Skip to content
Skillpedia
Agents7.6k · #13149

context-xray

What it does

This skill shows the parts of an agent's current chat context, with how much space each part uses. It lets you or the agent keep important pieces and hide stale ones. It is for people whose long chats are getting slow or confused.

When to use it

  • ✓When a long chat is getting large and you want to see what is taking up space.
  • ✓When an old tool result or file is no longer relevant and should be left out.
  • ✓When an important task spec or constraint needs to be kept across the whole chat.

Skill link

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/context-xray/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/context-xray/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“This chat has gotten very long. Can you show me what is taking up the most space and keep my project requirements?”

5 new skills a week. 1 minute to read.

How it works

The agent lists the chat's parts with their sizes. You or the agent can pin a part to keep it, or hide a part from future replies. Hiding never deletes the chat history.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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.
context-compact Compact the thread now: fold every not-yet-compacted message into observational memory instead of waiting for the post-turn threshold. Takes effect on the next model call; the transcript is unchanged.

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

  1. Call context-manifest-get with the active threadId.
  2. Sort segments by tokenCount and inspect large stale Tool results or Files read entries.
  3. Call context-pin for essential specs or user instructions.
  4. Call context-evict for large irrelevant segments.
  5. Offer context-restore if the user wants undo.
FAQ

Does hiding a part delete the chat?

No. Hiding is reversible, and the chat history is never deleted.

What does pinning do?

It keeps a part of the context across later replies, so it is not dropped when the chat is compacted.

Can I undo a change?

Yes. Restoring a segment undoes a pin, hide or summary change.

Details

Original description by the author

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.

repo: BuilderIO/agent-native

Popularity

GitHub stars
7.6k
Ranking position
#13149
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills