token-slim

SKILLAI 工具
AI 工具 未标注权限 许可证不明确 已核验
安装这个技能

针对AI代理工作区的引导式Token优化。触发于“save tokens”、“optimize tokens”、“context windowtoo large”、“memory files too b...”等短语。

一句话选型结论

按资料字段整理

token-slim是AI 工具类的 Agent Skill,安装方式:ClawHub 市场,权限级别未标注,许可证不明确,有可直接复制的安装命令。技能本质是给模型读的说明书,效果取决于模型与客户端;装完先用一个小任务验证,再放进正式流程。

分类AI 工具 安装方式ClawHub 市场 权限级别未标注权限 许可证许可证不明确
累计安装 未标注 本周 未标注
GitHub 星标 未标注 仓库 未标注
下载量 未标注 技能市场下载数
权限级别 未标注权限 安装前请确认风险范围
许可证 许可证不明确 未说明

安装

ClawHub 市场
在支持 Skills 的客户端里执行,装完问一句「你有哪些技能」验证
skillhub install user_2a52e6b3/token-slim
  1. 1
    确认客户端支持

    确认你的客户端支持 Skills(Claude、Codex、Cursor 等),并升级到较新的版本。

  2. 2
    拿到技能文件

    执行上面的命令安装;也可以把仓库里的 SKILL.md 手动放进客户端的 skills 目录。

  3. 3
    刷新技能列表

    重新打开客户端,或刷新技能列表,让新放进来的技能被加载。

  4. 4
    验证是否生效

    问一句「你有哪些技能」,确认列表里出现它,再拿一个小任务试跑。

技能档案

AI 工具
字段来自技能仓库与公开索引,中文说明由本站标注
作者 / 维护方user_2a52e6b3仓库 未标注 · 版本 未标注
宿主客户端未标注技能可被这些客户端加载
安装方式ClawHub 市场安装包 clawhub
权限级别未标注权限安装前请确认风险范围
许可证未说明许可证不明确,商用前请自行确认条款
仓库可用性available技能仓库当前是否可访问
最近核验未标注上游最后核验时间 · 数据更新 1791621952
正文体量7.7 KBSKILL.md 原文大小,越大说明说明书写得越细

典型使用场景

3 类
按分类整理的常见用法,具体以 SKILL.md 为准
组合多个 AI 能力

把写作、检索、总结串成一条流程。

搭工作流

把固定流程做成可重复调用的步骤。

做提示词与评测

整理提示词并对比输出效果。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 已做过站内核验,页面字段与仓库对得上。
  • 有可直接复制的安装命令,不用自己翻文档找入口。

先想清楚的地方

  • 没有标注权限级别,实际能做什么要装好后确认。
  • 许可证不明确,商用或二次分发前先到仓库确认条款。
  • 技能只是说明书,实际效果取决于模型与客户端,装完先用小任务试一遍。

更适合

  • 需要在AI 工具场景里给模型补一套做法的人。
  • 愿意先读一遍 SKILL.md、确认它会让模型做什么的人。

不太适合

  • 对许可证要求很严、必须明确可商用的人。
  • 只想装完就自动变强、不打算看说明书的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
技能权限级别安装方式累计安装宿主客户端安装命令
token-slim当前 未标注权限 ClawHub 市场 未标注 未标注 有
执行计划 只读 GitHub 仓库 151.5 万 Codex、Claude、Cursor 有
Playwright MCP 测试 浏览器控制 ClawHub 市场 136.5 万 OpenClaw 有
完成前的验证 未标注权限 GitHub 仓库 131.9 万 Codex、Claude、Cursor 有
子 Agent 驱动开发 只读 GitHub 仓库 131.2 万 Codex、Claude、Cursor 有
前端设计 执行命令 GitHub 仓库 125.6 万 Codex、Claude、Cursor 有

SKILL.md 全文

7.7 KB
模型实际读到的说明书原文,来自技能仓库

Token Saver (token-slim)

  • Author: Evan Song · github.com/Songhonglei
  • Repository: https://github.com/Songhonglei/better-agent-skills
  • License: MIT

Helps AI agents and their users reduce token consumption by auditing workspace
files, identifying bloat, and guiding targeted cleanup.

Core Concept

Every project-context file (memory index, agent config, heartbeat, etc.) is
injected into every single session. Keeping them lean = direct,
compounding savings. The goal is a three-tier memory layout:

memory index        ← always loaded, < 150 lines — pointers + essentials only
memoryres/*.md      ← loaded on demand — reference tables, specs, backlogs
memory/YYYY-MM-DD.md ← raw daily log — rarely loaded

For full strategy details: see references/strategies.md


Mode Routing

After matching a mode, first read the corresponding reference file, then
follow that flow. Do not rely on memory.

User intent Mode Must read first
First-time setup / "save tokens" Mode A references/mode-a-onboarding.md
Re-scan / "scan again" / "what else can I optimize" Mode B references/mode-b-rescan.md
Toggle brutal mode Brutal Mode see section below

Execution Modes

Confirm mode (default)

Show each proposed change, wait for user approval before modifying.

Batch mode

Triggered when the user says "just do it" / "按你说的来" / "全部做". Execute all
changes without per-item confirmation; deliver a unified summary at the end.

Dry-run mode

Preview without modifying any files:

SKILL_DIR="$(dirname "$(readlink -f "$0")")/skills/token-slim" 2>/dev/null \
  || SKILL_DIR=./skills/token-slim
python3 "$SKILL_DIR/scripts/scan_workspace.py" --workspace . --dry-run

Or simply, from the workspace root:

python3 <skill-install-path>/scripts/scan_workspace.py --workspace . --dry-run

🔥 Brutal Mode — Toggle

Triggers:
- Enable: "enable brutal mode" / "开启狂暴模式" / "打开狂暴模式"
- Disable: "disable brutal mode" / "关闭狂暴模式" / "退出狂暴模式"

Enable flow:
1. Check the workspace agent config file for <!-- token-slim:token-habits-start --> anchor
2. If absent → append the full template (incl. brutal mode section — see references/mode-a-onboarding.md Step 8)
3. If present → replace the whole block with the full template
4. Reply: "🔥 Brutal mode enabled — concise outputs, no preamble."

Disable flow:
1. Find the block <!-- token-slim:token-habits-start --> … <!-- token-slim:token-habits-end --> in the agent config
2. Replace the brutal-mode section with just a header placeholder:
### 🔥 Brutal Mode (max output efficiency) <!-- Brutal mode: disabled -->
3. Reply: "✅ Brutal mode disabled — back to normal."

First-time use (after Mode A Step 8 completes):
Proactively offer:
> "🔥 Want to enable brutal mode? When on, the agent gives results only — no
> step-by-step narration. Saves tokens and reading time. Say 'enable brutal mode'
> to toggle (can be turned off anytime)."


Undo (rollback)

scan_workspace.py itself does not modify files and does not auto-backup.

Before any file modification the agent must:
1. Tell the user which files will be modified
2. Ask "Do you want me to back these up first?"
3. On confirmation, copy the soon-to-be-modified files to a timestamped dir:
<workspace>/.token-slim/undo-<YYYYMMDD-HHMMSS>/
4. Report the backup path so the user can restore later.

See references/mode-a-onboarding.md Step 3 for the canonical recipe.


tiktoken installation

token-slim uses tiktoken for accurate token counting (vs ~40-60% heuristic
error). Install attempts run in this order with automatic fallback:

python3 <skill-install-path>/scripts/install_tiktoken.py --workspace .
Step Source Notes
1 PyPI official (pypi.org) 2 retries
2 Tsinghua mirror China-region acceleration
3 Aliyun mirror China-region acceleration
4 Heuristic fallback CJK/ASCII split, ~40-60% error

BPE vocabulary cache is fetched automatically by tiktoken on first encode
from the OpenAI public blob (openaipublic.blob.core.windows.net) and stored
under <workspace>/.cache/tiktoken/ (CWD-anchored — survives $HOME wipes on
container/VM environments where only the working directory is persistent).

Check current state:

python3 <skill-install-path>/scripts/install_tiktoken.py --check --workspace .

scan_workspace.py auto-detects tiktoken at runtime; no manual setup needed
after installation.


Dependencies

Required:
- Python 3.8+ (python3 available on PATH)

Optional:
- tiktoken for precise token counting (install via the script above). Without
it, the scanner uses a CJK/ASCII heuristic with ~40-60% error.

Everything else uses the Python standard library.


What NOT to move

Never suggest moving:
- Behavioural rules, safety constraints, must/never guidelines
- Cron job configurations and failure protocols
- Active heartbeat tasks and retry queues
- Identity / persona core (soul/identity config content)
- Anything with ⚠️ or explicit "always loaded" markers

When in doubt, ask the user.


Key files

File Purpose
scripts/scan_workspace.py Scanner — detects bloat, scores findings, supports --dry-run
scripts/install_tiktoken.py tiktoken installer (PyPI → Tsinghua → Aliyun → heuristic)
references/strategies.md Full strategy reference (7 strategies + scoring rubric)
references/mode-a-onboarding.md Mode A: first-time setup workflow
references/mode-b-rescan.md Mode B: on-demand re-scan workflow

CLI reference

scan_workspace.py

python3 scan_workspace.py [--workspace <path>] [--json] [--dry-run]
Flag Default Description
--workspace $TOKEN_SLIM_WORKSPACE or current directory Workspace root to scan
--json off Output raw JSON instead of human-readable report
--dry-run off Preview mode: show what would change, modify nothing

install_tiktoken.py

python3 install_tiktoken.py [--check] [--workspace <path>]
Flag Default Description
--check off Only report install/cache status; do not install
--workspace current directory Cache goes to <workspace>/.cache/tiktoken. Honoured only if TIKTOKEN_CACHE_DIR is unset

⚠️ Skills vs workspace-file tokens

Skills (SKILL.md): each skill injects only its name + description + location
per session — around 24 tokens. The full body is only loaded when the agent
explicitly reads it. Large SKILL.md files affect call latency, not per-session
baseline.

Workspace files (memory index, agent config, etc.): injected verbatim every
session — these are the real optimisation target.

常见问题

5 问
答案由本站依据条目字段整理
token-slim怎么安装?

在支持 Skills 的客户端里执行:skillhub install user_2a52e6b3/token-slim。安装方式为ClawHub 市场。装完刷新技能列表或重开客户端。

token-slim支持哪些客户端?

资料没有标注宿主客户端,但只要客户端支持 Skills(Claude、Codex、Cursor 等),一般都能加载。

token-slim权限高吗,安全吗?

权限级别为未标注权限。安装前先看它会读取或写入哪些内容。

token-slim收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于技能本身和所用的模型或客户端,正式使用前按作者说明确认。

token-slim用什么许可证?

许可证标注为 未说明(许可证不明确)。商用或二次分发前请到仓库确认条款原文。

热门专题

按场景挑技能
全部专题 →

技能内容以作者仓库为准;分类、权限级别与许可证状态的中文说明为中文整理,最近核验 未标注。