← 返回 Skills 市场
certainlogicai

CertainLogic Context Manager

作者 CertainLogicAI · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
81
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install certainlogic-context-tokenreducer
功能描述
Prevent AI session token bloat and runaway costs. Tracks query count per session, warns at a configurable threshold, auto-writes a dense handoff summary befo...
使用说明 (SKILL.md)

Context Manager

Keeps sessions lean. Tracks query count, warns before context bloats, saves a handoff summary so work continues cleanly in the next session.

How It Works

  1. Counter — Increment session_query_count.txt every turn
  2. Warn — At threshold, write handoff.md and alert the user
  3. Reset — User runs /new; next session reads and deletes handoff.md

Files

File Purpose
session_query_count.txt Integer. Increment each turn. Create if missing (default 0).
handoff.md Workspace root. Written at threshold. Read + deleted on next session start.

Every Turn (mandatory)

1. Read session_query_count.txt (default 0 if missing)
2. Increment by 1
3. Write back
4. If count == THRESHOLD: trigger handoff flow

Default threshold: 10. Configurable per deployment.

Handoff Flow (at threshold)

  1. Write handoff.md — see handoff-format.md for exact spec
  2. Tell the user:

    ⚠️ 10 queries in — context is getting heavy. Handoff saved. Run /new when ready to continue.

  3. Do NOT auto-reset. User controls the reset.

Session Start Flow

1. Check if handoff.md exists
2. If exists AND file is \x3C 3 hours old:
   a. Read it
   b. Apply context to current session
   c. Delete handoff.md
3. Reset session_query_count.txt to 0

Topic Switch Detection

When the user says "BTW", "switching gears", "new topic", or starts a clearly unrelated task:

  1. Write/overwrite handoff.md immediately (don't wait for threshold)
  2. Tell the user: "Handoff saved — /new when ready"
  3. Resume or continue current task

Why This Matters

Session context is cumulative. Every prior message, tool call, and assistant response is re-sent on every new query. Without resets, a lean 18K-token session becomes 50K–400K+ within hours.

See token-math.md for cost impact data and reset savings estimates.

Commands

Command Behavior
/new or /reset User-triggered. New session starts; skill reads handoff.md if present.
/handoff Explicit handoff write. Same as threshold flow, on demand.
/counter Report current query count and threshold.

Configuration

Override defaults in AGENTS.md or equivalent workspace config:

- CONTEXT_THRESHOLD: 10        # Queries before warning (default: 10)
- HANDOFF_TTL_HOURS: 3         # Hours before handoff.md is considered stale (default: 3)

Reliability Rules

  • Never skip the counter increment — even for one-liner responses
  • Never auto-reset — the user owns the session lifecycle
  • Handoff must be written before warning — never warn without saving state first
  • Counter file is source of truth — do not track in memory

What This Saves You

Without this skill With this skill
Sessions balloon to 400K+ tokens Sessions stay under 25K
Cost multiplies 22x over a day Cost stays near baseline
Work lost on manual /new resets Handoff auto-saved, resumed next session
No signal before context degrades Warning fires before quality drops

See token-math.md for the full cost breakdown.


Built by CertainLogic — trusted fact infrastructure for AI agents.

安全使用建议
This skill appears coherent and limited in scope: it only increments a counter and writes/reads a small handoff file in the workspace to prevent token bloat. Before installing, consider: (1) handoff.md will persist summary data in your workspace root — avoid letting it store secrets or PHI, and ensure workspace access is trusted; (2) confirm your agent actually deletes stale handoffs as specified (the SKILL.md says delete after reading); (3) review and possibly raise the default threshold (10) or the HANDOFF_TTL_HOURS if your workflows differ; and (4) if you need stricter privacy, require the handoff be anonymized or encrypted instead of written in plaintext.
功能分析
Type: OpenClaw Skill Name: certainlogic-context-manager Version: 1.0.1 The skill is a utility designed to manage AI session context and reduce token costs by tracking query counts and generating handoff summaries. It operates locally within the workspace using 'session_query_count.txt' and 'handoff.md', and its instructions in SKILL.md are transparently aligned with its stated purpose of session hygiene. No evidence of data exfiltration, malicious execution, or harmful prompt injection was found.
能力评估
Purpose & Capability
The name and description claim session/query counting, threshold warnings, and a handoff summary — and the SKILL.md only requires reading/writing session_query_count.txt and handoff.md. Those file operations are exactly what you'd expect for this feature.
Instruction Scope
All runtime instructions are local file operations and conversational behavior (increment counter, write a dense handoff, read it back at session start). This stays within the stated scope. Note: the skill persists conversational context into handoff.md; users should be aware that sensitive conversation content will be written to disk in workspace root per the spec.
Install Mechanism
Instruction-only skill with no install spec and no code files. Nothing is downloaded or written to disk by an installer, which minimizes risk.
Credentials
No environment variables, credentials, or external endpoints are required. The configuration is described as workspace config (AGENTS.md), which is proportionate to the feature.
Persistence & Privilege
Skill is not always-on, does not request elevated privileges, and does not modify other skills or system-wide settings. Its persistence is limited to two workspace files it creates/reads/deletes.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install certainlogic-context-tokenreducer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /certainlogic-context-tokenreducer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
License updated to MIT (attribution required).
v1.0.0
Initial release — proactive query counter, auto-handoff writer, session start recovery, and token cost reference. Built by CertainLogic.
元数据
Slug certainlogic-context-tokenreducer
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

CertainLogic Context Manager 是什么?

Prevent AI session token bloat and runaway costs. Tracks query count per session, warns at a configurable threshold, auto-writes a dense handoff summary befo... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 81 次。

如何安装 CertainLogic Context Manager?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install certainlogic-context-tokenreducer」即可一键安装,无需额外配置。

CertainLogic Context Manager 是免费的吗?

是的,CertainLogic Context Manager 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

CertainLogic Context Manager 支持哪些平台?

CertainLogic Context Manager 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 CertainLogic Context Manager?

由 CertainLogicAI(@certainlogicai)开发并维护,当前版本 v1.0.1。

💬 留言讨论