360 Secure SkillHub
360 安全技能中心

Token Efficiency

该 Skill 以文本规则形式指导代理节省上下文:用 grep/tail 等精准读取替代整文件读取,合并批量 API 调用,把重型检索交给子代理,避免重复读取与多余叙述,并在存储前先做摘要。内容以规则条目和正反例表格呈现,未包含可执行脚本或宿主专属配置。

nubzparmesan
nubzparmesan
热度 26.04
最近更新 2026-05-11 17:29:11
分类:效率依赖:纯提示词应用场景:工作流 / 研究 / 摘要总结

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add minnow-token-efficiency
Metadata
name
Token Efficiency
description
Avoid unnecessary context burn. Surgical file reads, batched commands, less narration. Every token read is a token taxed.

Token Efficiency - Avoiding Unnecessary Context Burn

Every token read is a token taxed. Be surgical.

Core Rules

  • grep/tail over full reads — need one section? grep -A 20 "## Section". Need the end? tail -50. Don't read 500 lines to find 5.
  • batch API calls — one curl with multiple params > three separate curls. Combine endpoint checks into single scripts.
  • sub-agents for heavy research — scraping a thread, summarizing 50 posts, reading a full repo? Spawn a sub-agent. Don't burn main context on bulk work.
  • don't re-read context — if a file was already read this session, use what you have. Never read it again "just to be sure."
  • summarize before storing — tool output going to a file? Strip it down first. Store the insight, not the raw dump.

Anti-Patterns (Observed)

Bad Good
Read full 3000-line comment thread grep -c "" for count, tail for recent, grep for keywords
4 separate curl calls to 4 endpoints One script, four curls, one python parse pass
Narrate every grep and read step Just do it, report the finding
Re-read SKILL.md to "refresh" mid-session Trust what's already in context
Store raw JSON API response Extract the 3 fields you care about, store those

When to Use Sub-Agents

  • Research tasks > ~10 tool calls
  • Bulk reading (threads, repos, feeds)
  • Tasks that can run in parallel with main work
  • Anything that would dominate your context window

Quick Heuristics

  • If you're about to read a file you've already read → stop
  • If you're about to make the same API call twice → cache the result
  • If narrating a step takes longer than doing it → just do it
  • If a task feels heavy → sub-agent it