跳到正文
TakoAPI
返回技能列表

hz-context-optimizer

由 lidekahdjdhdhsjjs-lang 提供

CLI Utilities
299下载量由 clawskills.sh 提供
2浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

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

描述

该技能的功能

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.

何时使用

  • 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

示例工作流

输入

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

智能体
  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

输出

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

安装

clawhub install lidekahdjdhdhsjjs-lang/hz-context-optimizer

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接