context-xray
Skill này làm gì
Skill này hiển thị các phần trong ngữ cảnh chat hiện tại của agent, cùng lượng không gian mỗi phần chiếm. Nó cho phép bạn hoặc agent giữ lại những phần quan trọng và ẩn những phần đã cũ. Skill dành cho người có cuộc chat dài bắt đầu chậm hoặc rối.
Khi nào nên dùng
- ✓Khi một cuộc chat dài trở nên lớn và bạn muốn xem điều gì đang chiếm chỗ.
- ✓Khi một kết quả công cụ hoặc file cũ không còn liên quan và nên bị bỏ qua.
- ✓Khi một đặc tả tác vụ hoặc ràng buộc quan trọng cần được giữ xuyên suốt cuộc chat.
Liên kết skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/context-xray/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Cuộc chat này đã rất dài. Bạn có thể cho tôi thấy điều gì đang chiếm nhiều chỗ nhất và giữ lại yêu cầu dự án của tôi không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent liệt kê các phần của cuộc chat cùng kích thước. Bạn hoặc agent có thể ghim một phần để giữ lại, hoặc ẩn một phần khỏi các câu trả lời sau. Việc ẩn không bao giờ xóa lịch sử chat.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
- Call
context-manifest-getwith the activethreadId. - Sort segments by
tokenCountand inspect large staleTool resultsorFiles readentries. - Call
context-pinfor essential specs or user instructions. - Call
context-evictfor large irrelevant segments. - Offer
context-restoreif the user wants undo.
Câu hỏi thường gặp
Ẩn một phần có xóa cuộc chat không?
Không. Việc ẩn có thể hoàn tác, và lịch sử chat không bao giờ bị xóa.
Ghim có tác dụng gì?
Nó giữ một phần ngữ cảnh qua các câu trả lời sau, nên nó không bị loại bỏ khi cuộc chat được nén.
Tôi có thể hoàn tác một thay đổi không?
Có. Khôi phục một đoạn sẽ hoàn tác việc ghim, ẩn hoặc thay đổi tóm tắt.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 7.6k
- Vị trí xếp hạng
- #13149
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
design-exploration
7.6kGiúp agent của bạn khám phá nhiều hướng thiết kế giao diện song song, để bạn chọn một hướng rồi tinh chỉnh thiết kế đã chọn.
visual-edit
7.6kGiúp agent của bạn mở một ứng dụng cục bộ đang chạy trong trình chỉnh sửa trực quan, để bạn xem và sửa các màn hình thật cùng nhau.
turn-into-app
7.6kBiến quy trình, bảng tính hoặc dự án thành ứng dụng trực quan có màn hình đầy đủ dữ liệu, với agent làm việc phía sau các điều khiển.
visual-plan
7.6kBiến một kế hoạch viết bằng văn bản thuần thành kế hoạch trực quan tương tác, có sơ đồ, bản đồ file, đoạn code và các câu hỏi còn mở.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.