recursive-context-pruning-token-budgeting
Skill này làm gì
Công cụ này giúp AI trực tiếp và hiệu quả hơn. Nó loại bỏ thông tin không cần thiết và tập trung vào câu trả lời chính xác bạn cần, không nói dài dòng.
Khi nào nên dùng
- ✓Khi xây dựng trợ lý AI cho các cuộc trò chuyện dài.
- ✓Khi làm việc với nhiều tài liệu hoặc code.
- ✓Khi bạn chỉ muốn kết quả cuối cùng, không cần các câu thừa.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/recursive-context-pruning-token-budgeting/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
“Đưa cho tôi code để kết nối với cơ sở dữ liệu.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI trước tiên xác định thông tin nào quan trọng. Sau đó, nó quyết định lượng dung lượng (token) dùng cho câu trả lời và loại bỏ các cụm từ thừa để đi thẳng vào vấn đề.
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.
Recursive Context Pruning & Token Budgeting
Overview
This skill implements a "Gatekeeper" logic to prevent context window bloat and unnecessary token expenditure. It ensures the agent only processes relevant data shards and adheres to an Atomic Precision protocol—delivering functional answers with zero conversational filler. By recursively summarizing state and stripping "bridge phrases," it maximizes the longevity and speed of long-running development workflows.
When to Use This Skill
- Use when building multi-step agents to prevent repetition and "memory drift" in long conversations.
- Use when working with large document sets or codebases to avoid dumping entire files into the prompt.
- Use when you need purely functional output (code/logic) without "Sure! Here is your..." intros.
How It Works
Step 1: Metadata Sharding
Scan the available data for headers, summaries, and key indicators. Create a "map" of the context rather than injecting the full source. Never pull the entire file into the prompt unless a specific, narrowed fragment is requested.
Step 2: Token Budget Allocation
Calculate a "Safe Response Limit" based on the current context window. Allocate 30% for current logic processing, 20% for immediate output, and 50% for a future context buffer.
Step 3: Atomic Output Filtering
Strip all "Bridge Phrases" (e.g., "I've updated the code," "Based on your request," "Sure"). Start the response immediately with the solution or the code block.
Step 4: Ambiguity Check
Before executing Step 3, scan for missing critical variables (e.g., specific file names or environment types). If the prompt is too ambiguous, bypass the atomic output and generate exactly one concise question to resolve the blocker.
Step 5: Abstractive Compression
Summarize the current turn into a "compressed state string" (e.g., [Project: Feasify | State: Auth-Fixed | Remaining-Tasks: 2]) to discard redundant conversational data before the next prompt.
Examples
Example 1: Filtered Code Output (No Filler)
User: "Update the Firebase config to use environment variables."
const firebaseConfig = {
apiKey: process.env.VITE_FIREBASE_API_KEY,
authDomain: process.env.VITE_FIREBASE_AUTH_DOMAIN,
projectId: process.env.VITE_FIREBASE_PROJECT_ID
};
Example 2: Essential Clarification
User: "Deploy the function."
"Specify environment: production or staging?"
Best Practices
- ✅ Direct Start: Place the code or answer at the very first character of the response.
- ✅ Summarize-as-you-go: Turn 10 pages of discussion into 5 bullet points for the next turn.
- ✅ Omit Signatures: Never end with "Let me know if you need more help."
- ❌ No Bridge Phrases: Avoid "Here is the code," "Sure," or "I can help with that."
- ❌ No Guessing: If input is missing, ask immediately rather than wasting tokens on a generic guess.
Limitations
- This skill does not replace environment-specific validation, testing, or expert review.
- Extreme brevity can occasionally hide important nuances; use concise inline comments (
// crucial step) for critical notes.
Security & Safety Notes
- Never prune safety headers, environment-specific security constraints, or system-level instructions during the compression stage.
- Maintain original system instructions at the "Root" of the context to prevent context-loss-based jailbreaks.
Common Pitfalls
Problem: The response is so brief it lacks the context needed for implementation. Solution: Use concise inline code comments instead of separate paragraphs of text.
Problem: The agent loses the overarching goal due to over-compression. Solution: Always pin the "Primary Objective" to the top of every pruned prompt.
Related Skills
@atomic-precision-response- Specifically for removing conversational filler.@context-sharding- For managing large-scale documentation mapping.
Câu hỏi thường gặp
Tại sao AI không nói “Được, đây là code”?
Để tiết kiệm thời gian và dung lượng, AI đi thẳng vào code hoặc câu trả lời, không có phần giới thiệu.
Điều gì xảy ra nếu AI không hiểu yêu cầu?
Thay vì đoán, AI sẽ hỏi một câu ngắn gọn để làm rõ điều bạn cần.
Công cụ này có thể khiến AI quên những điều quan trọng không?
Không, nó được thiết kế để giữ các hướng dẫn cốt lõi và thông tin an toàn, chỉ loại bỏ những gì không cần thiết cho câu trả lời trước mắt.
Chi tiết
Mô tả gốc của tác giả
Optimizes AI agent performance by pruning redundant context, managing token usage, and enforcing ultra-concise, direct-to-value responses.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #5593
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
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.