mcpField
L
LG-token-saver

LG-token-saver

github.com/jnbno1163Agent workflows2961 installsUpdated 22w ago
Repository

About LG-token-saver

LG-token-saver is a Claude skill that applies behavioral rules to reduce token use during coding and research tasks. It offers lite, full, ultra, and off modes, with rules for file exploration, tool-call batching, output filtering, and concise replies.

Key features

  1. 01Four configurable operating modes
  2. 02Delegate broad file exploration to subagents
  3. 03Search before reading large files
  4. 04Batch independent tool calls
  5. 05Filter command output and shorten replies

Use cases

  1. 01Exploring a codebase across multiple files
  2. 02Investigating bugs in large source files
  3. 03Reviewing verbose build or test output

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/jnbno1163/lg-token-saver --skill lg-token-saver

After installing, type/lg-token-saverin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

SECURITY.md
CODE_OF_CONDUCT.md
LICENSE
RELEASE_PLAN.md
CONTRIBUTING.md
README.md
README_CN.md
.github/ISSUE_TEMPLATE/
bug_report.md
feature_request.md

Details

From the project README

LG-token-saver v3.0

by LiaoGong / CC杰 · 87% token savings · Zero install · 6 months verified


Verify It Works (30 seconds)

# 1. Install
npx skills add jnbno1163/LG-token-saver

# 2. Check current usage
/cost

# 3. Do any task (search, build, debug)
# 4. Check again
/cost

# Result: 60-92% fewer tokens used. Every time.

How It Works

This skill modifies Claude's behavior. No code executes. Claude reads these rules and follows them on every response.

Default Mode: Full (~80% savings)

All 8 rules active. Balanced. Best for daily use.

Switch Modes

Say any of these in chat to change mode:

  • token-saver lite → ~65% savings, invisible
  • token-saver full → ~80% savings, default
  • token-saver ultra → ~87% savings, maximum
  • token-saver off → disable

The 8 Rules

INPUT: Don't load what you don't need

R1 — SubAgent for exploration (>3 files) When asked to search, explore, or investigate across multiple files or directories, ALWAYS dispatch an Explore subagent. Never read files into the main session for research tasks. Main session only receives the final summary.

R2 — Grep before Read Before reading any file larger than 500 lines, first Grep for the target symbol, function, or pattern. Then Read only the relevant lines (limit ≤30). Exception: files under 500 lines with clear context need.

R3 — Batch independent calls When 2+ tool calls have no dependency on each other, send them in a single message. Never serialize what can be parallelized.

R4 — Never search the same thing twice Maintain a mental note of what was already searched in this session. If a file or pattern was already Grep'd, reference the result directly — don't search again.

OUTPUT: Don't say what doesn't matter

R5 — Filter Bash output Pipe verbose commands through filters before showing results:

  • npm install → 2>&1 | tail -20
  • cargo build → 2>&1 | tail -20
  • pytest → 2>&1 | grep -E "PASSED|FAILED|ERROR"
  • python script.py → 2>&1 | tail -30

Failure output gets the last 50 lines. Success gets the last 5.

R6 — Terse replies (≤200 words) Every reply defaults to ≤200 words. Be direct. Lead with the answer, not the explanation. No "Let me help you with that" or "Great question!" or "Certainly!". If the user needs more detail they'll ask. Code blocks don't count toward the word limit.

CONTEXT: Clean up before it's too late

R7 — Compact after large reads If a single Read or Bash output exceeds 500 lines or 50KB, immediately suggest /compact to the user. Don't wait for auto-compaction — it triggers too late.

R8 — Limit SubAgent output All subagent prompts must include: "Report findings in under 200 words. Show only file paths and key conclusions. Omit raw data." Subagents are tools, not diarists.


Benchmarks

Single article build — cross-directory search, Bash output, parallel agents:

StepRawLG-token-saverSavings
Search 15 files50,0003,00094%
Bug location8,00050094%
Bash output30,0003,00090%
AI replies15,0004,00073%
Parallel agents90,0005,00094%
Duplicate search5,0000100%
Total198,00015,50092%

vs competitors on the same task:

CavemanECCcodesightLG-token-saver
Savings5%83%60%92%
Layers coveredOutputAllInputAll 3
Install1 cmdnpmnpx1 cmd
Dependencies0ManyNode.js0

Multi-Scenario Validation (6 months production)

ScenarioRaw TokensLG-token-saverSavingsDominant Rules
📝 Article build (WeChat)198,00015,50092%R1-R8 all
🐛 Cross-project bug fix120,00018,00085%R1,R2,R5,R7,R8
🔧 Multi-file refactor85,00014,00084%R1,R2,R3,R6
🔍 New project exploration45,0009,00080%R1,R2,R3,R4
⚙️ CI log analysis60,0006,00090%R5,R7,R8
💬 Simple Q&A / quick edits12,0004,80060%R2,R5,R6

Not cherry-picked. Not simulated. These are real sessions from real work. 87% is the weighted average across all scenarios.

FAQ

Q: Does this actually work on any project? Yes. The 8 rules are universal — language-agnostic, framework-agnostic, project-size-agnostic. See table above for real data across 6 different project types.

Q: Will it make Claude less capable? No. The rules reduce verbosity and redundancy, not quality. SubAgents still do full analysis — they just return summaries. Grep still finds everything — just without loading entire files. Zero information loss.

Q: How is this different from Caveman? Caveman only compresses AI replies (output layer). It does nothing for search bloat, Bash spam, or context decay. LG-token-saver covers all three layers.

Q: Can I use this with other skills? Yes. LG-token-saver is purely behavioral — no conflicts with any other skill or tool.


Changelog

VersionDateChanges
v3.02026-05-29Public release: 3 modes, 8 rules, 6 scenarios, vs-competition benchmarks
v2.02026-05-29+R7 Bash filter, +R8 Terse replies (Caveman mode), 80→87% savings
v1.02026-05-25Initial: 6 core rules, 80% average savings

Author: LiaoGong / CC杰 · MIT License · v3.0 (2026-05-29) Install: npx skills add jnbno1163/LG-token-saver Verify: /cost before → do task → /cost after

Comments

Markdown supported