← 返回
未分类 中文

Nm Conserve Token Conservation

Enforces token quota management at session start with conservation and compression checks. Use at the start of every session or before large context loads
在会话启动时强制执行令牌配额管理,并进行保存和压缩检查。请在每个会话开始或加载大上下文之前使用。
athola athola 来源
未分类 clawhub v1.9.12 4 版本 100000 Key: 无需
★ 0
Stars
📥 484
下载
💾 1
安装
4
版本
#latest

概述

> Night Market Skill — ported from claude-night-market/conserve. For the full experience with agents, hooks, and commands, install the Claude Code plugin.

Token Conservation Workflow

When To Use

  • Run at the start of every session and whenever prompt sizes or tool calls begin to spike.
  • Mandatory before launching long-running analyses, wide diffs, or massive context loads.

When NOT To Use

  • Context-optimization already handles the scenario
  • Simple queries with minimal context

Required TodoWrite Items

  1. token-conservation:quota-check
  2. token-conservation:context-plan
  3. token-conservation:delegation-check
  4. token-conservation:compression-review
  5. token-conservation:logging

Step 1 – Quota Check (quota-check)

  • Record current session duration and weekly usage (from /status or notebook).

Note the 5-hour rolling cap and weekly cap highlighted in the Claude community notice.

  • Capture remaining budget and set a max token target for this task.

Step 2 – Context Plan (context-plan)

  • Set a discovery read budget BEFORE reading any files. Count each Read call

and each content-mode Grep as one read. Glob and files-with-matches Grep are free.

  • Implement from spec/requirements: max 8 reads
  • Bug fix at known location: max 5 reads
  • Refactor with known scope: max 1 read per file being changed
  • Open exploration: max 15 reads
  • Read order (most valuable first): spec/requirements, files to modify,

imports/interfaces, then stop and start writing.

  • When budget is spent: ask the user if more context is needed. Do NOT

self-authorize additional reads. Only explicit user approval overrides the budget.

  • Prefer Read with offset/limit params or Grep tool over loading whole files.

A Read targeting <50 lines counts as 0.5 reads. Avoid cat/sed/awk via Bash

— Claude Code 2.1.21+ steers toward native file tools (Read, Edit, Write, Grep, Glob).

  • PDFs (Claude Code 2.1.30+): Use Read with pages: "1-5" for targeted PDF reading

instead of loading entire documents. Large PDFs (>10 pages) return a lightweight

reference when @-mentioned — use the pages parameter to read specific sections.

Hard limits: 100 pages max, 20MB max per PDF. Exceeding these previously locked

sessions permanently (fixed in 2.1.31).

  • Convert prose instructions into bullet lists before prompting so only essential

info hits the model.

Step 3 – Delegation Check (delegation-check)

  • Evaluate whether compute-intensive tasks can go to Qwen MCP or other external

tooling (use qwen-delegation skill if needed).

  • For local work, favor deterministic scripts (formatters, analyzers) instead

of LLM reasoning when possible.

Step 4 – Compression Review (compression-review)

  • Summarize prior steps/results before adding new context.

Remove redundant history, collapse logs, and avoid reposting identical code.

  • Use prompt caching ideas: reference prior outputs instead of restating them

when the model has already processed the information (cite snippet IDs).

  • Decide whether the current thread should be compacted:
  • If only recent context is stale, use "Summarize from here" (Claude Code 2.1.32+)

via the message selector to partially summarize the conversation — this preserves

recent context while compressing older portions

  • If the active workflow is finished and earlier context will not be reused,

instruct the user to run /new

  • If progress requires the existing thread but the window is bloated,

prompt them to run /compact before continuing

  • Automatic memory (Claude Code 2.1.32+): Claude now records and recalls session

memories automatically. This adds minor token overhead but improves cross-session

continuity. No action needed — be aware it contributes to baseline context usage.

Step 5 – Logging (logging)

Document the conservation tactics that were applied and note the remaining

token budget. If the budget is low, explicitly warn the user and propose secondary

plans. Record any recommendations made regarding the use of /new or /compact,

or justify why neither was necessary, to inform future context-handling decisions.

Output Expectations

  • A short explanation of token-saving steps, delegated tasks, and remaining runway.
  • Concrete next-action list that keeps the conversation lean (e.g.):
  • "next turn: provide only failing test output lines 40-60"
  • Explicit reminder about /new or /compact whenever you determine it would save

tokens (otherwise state that no reset/compaction is needed yet).

版本历史

共 4 个版本

  • v1.9.12 当前
    2026-06-19 19:51 安全 安全
  • v1.0.3
    2026-06-09 17:48 安全 安全
  • v1.0.2
    2026-05-09 16:37 安全 安全
  • v1.0.1
    2026-05-07 11:37 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 851 📥 332,955
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,423 📥 326,440
ai-agent

self-improving agent

pskoett
记录自身发现以实现自我改进的技能
★ 4,132 📥 908,026