Bỏ qua tới nội dung
TakoAPI
Quay lại kỹ năng

hz-context-optimizer

bởi lidekahdjdhdhsjjs-lang

CLI Utilities
299Lượt tải do clawskills.sh công bố
2Lượt xem
0 lượt thíchĐăng nhập để thích kỹ năng này
—Chưa có đánh giá
Đánh giá của bạn

Tóm tắt

This skill should be used when the user asks to "compress context", "summarize conversation history", "implement.

Mô tả

Kỹ năng này làm gì

Techniques for compressing agent conversation history without losing critical information. Covers three production-ready approaches: anchored iterative summarization, opaque compression, and regenerative full summaries. The core insight is optimizing tokens-per-task rather than tokens-per-request, since overly aggressive compression forces costly re-fetching.

Targeting tokens-per-task instead of tokens-per-request avoids the hidden cost where compression that saves 0.5% more tokens causes 20% more re-fetching, resulting in higher total token spend.

Khi nào nên dùng

  • Compressing a 100+ message debugging session before hitting context limits
  • Tracking which files were modified across a multi-hour coding agent session
  • Designing summarization triggers for codebases over 5M tokens
  • Evaluating compression quality with probe-based recall tests
  • Reducing total token spend on long-running agentic workflows

Quy trình ví dụ

ĐẦU VÀO

User asks: Compress this 89,000-token debugging session so the agent can continue without losing context

AGENT
  1. 1

    Identify the compression trigger point at 70-80% context utilization

  2. 2

    Define structured summary sections: Session Intent, Files Modified, Decisions Made, Current State, Next Steps

  3. 3

    Summarize the truncated history span into each explicit section

  4. 4

    Merge the new summary into any existing structured summary rather than regenerating from scratch

  5. 5

    Validate retention by running probe questions against the compressed output

ĐẦU RA

A structured markdown summary preserving the original error, all modified file paths, root cause, test status, and next steps — compressing 89,000 tokens to roughly 300 words

Cài đặt

clawhub install lidekahdjdhdhsjjs-lang/hz-context-optimizer

Chạy lệnh CLI, hoặc dán prompt vào Claude Code, Cursor, Codex hay coding agent bạn đang dùng.

Liên kết