跳到正文
TakoAPI
返回技能列表

context-gatekeeper

由 davienzomq 提供

AI & LLMs
1.2k下载量由 clawskills.sh 提供
3星标
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Keeps the conversation token-friendly by summarizing recent exchanges, surfacing pending actions, and delivering.

描述

该技能的功能

Manages conversation token usage by summarizing history, extracting pending actions, and writing a compact briefing file before each model call. A Python script reads a plain-text exchange log and outputs a replacement context document. Run it before each prompt instead of resending the full thread.

Rather than trimming the raw conversation ad hoc, it produces a structured, size-bounded briefing that separates decisions, pending tasks, and recent turns into predictable sections.

何时使用

  • Pruning a bloated multi-turn agent thread before the next API call
  • Tracking open TODOs and follow-ups across a long session
  • Reducing token costs on repetitive agentic workflows
  • Injecting a one-page decision summary into a fresh prompt
  • Auditing what the model knew at each turn via versioned summary files

示例工作流

输入

User asks: Summarize our Q2 planning session and keep the next prompt lean

智能体
  1. 1

    Append the latest user and assistant messages to context/history.txt in ROLE: text format

  2. 2

    Run context_gatekeeper.py with --history and --summary flags

  3. 3

    Script produces context/current-summary.md with up to 6 summary sentences, open action items, and the last 4 turns

  4. 4

    Inject the summary file content at the top of the next prompt

  5. 5

    Proceed with the API call using only the briefing plus 2-3 recent messages if needed

输出

A context/current-summary.md file containing a condensed briefing, pending task list, and recent exchange snippet ready for injection

安装

clawhub install davienzomq/context-gatekeeper

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

链接