Token Saver 中文版 — 压缩 AI 常驻上下文与 token 成本
Reduce AI costs and prevent context overflow by auditing resident instructions and throttling runtime token usage.
$6.99
Works with the AI Agents you already use
Token Saver 中文版 — 压缩 AI 常驻上下文与 token 成本
Example session with this skill installed
My CLAUDE.md is getting huge and I'm hitting context limits. Can you audit it and suggest ways to save tokens?
- Read your context and instructions
- Compiled the token saver
I have audited your resident context files using the token_meter.py script. Your current configuration is approaching the limits for the Codex harness.
Resident Context Audit
Current Harness: Codex
Budget: 32,768 bytes
| File | Bytes | Estimated Tokens | Budget % | Risk |
|---|---|---|---|---|
CLAUDE.md | 24,150 | ~6,100 | 73.7% | High |
AGENTS.md | 4,200 | ~1,050 | 12.8% | Low |
| Total | 28,350 | ~7,150 | 86.5% | Warning |
Estimated after optimization: 28,350 → 12,400 bytes.
Proposed Modifications
CLAUDE.md (Lines 80-150): Move the detailed React component styling guide to docs/style-guide.md. Replace with a single-line reference.
- Impact: -8,400 bytes.
- CLAUDE.md (Lines 200-230): Remove redundant environment setup commands already covered by the
setupMCP tool.- Impact: -1,200 bytes.
- AGENTS.md: Consolidate multiple project-specific rules into concise imperative statements.
- Impact: -6,350 bytes.
Next steps
- Run
python3 scripts/token_meter.py count --path CLAUDE.mdto verify these specific segments. - Review the suggested diffs; say "Apply CLAUDE.md diff" to proceed with the migration to reference files.
- Consider starting a new session to clear the accumulated history now that the base context is leaner.
Connects securely to your tools. The creator never sees your data.
About this skill
The problem
Large project files and bloated instruction documents (CLAUDE.md/AGENTS.md) drain context windows and drive up API costs. Developers often pay for thousands of tokens of redundant history or unread logs that never needed to be in the prompt.
What it does
- Enforces "Read-on-Demand" patterns, using grep and line offsets to avoid reading entire large source files.
- Cuts log bloat by redirecting command outputs to disk and only extracting relevant error traces or tail segments.
- Audits resident context files (AGENTS.md, CLAUDE.md) against specific harness budgets like Codex (32KB) and DeepSeek (64KB).
- Generates diff-based compression proposals to move verbose instructions into reference files while keeping active context lean.
- Calculates real-time token usage via a standalone Python script, using
tiktokenfor precision or weighted estimation as a fallback.
Frameworks & tools
Compatible with Claude Code, Codex, DeepSeek Harness, and WorkBuddy. Uses Python 3.10+ standard library, grep, and optional tiktoken.
Why this beats prompting it yourself
Generic "be concise" prompts fail because LLMs naturally want to read more to be sure. This skill enforces technical constraints like shell-level piping, file indexing, and specific byte-limit audits that a standard prompt cannot consistently execute across long sessions.
Use cases
- Reducing session costs when debugging long stack traces or build logs.
- Optimizing CLAUDE.md or AGENTS.md files that have grown past harness budget limits.
- Detecting session fatigue to signal when to start a fresh conversation.
- Auditing MCP tool definitions and skill descriptions for hidden context overhead.
Known limitations
Does not modify session history files. Resident file optimizations require manual user confirmation of generated diffs. Precision counting requires tiktoken installation.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.
Does not modify session history. Resident file optimizations require manual user confirmation of diffs. Precision counting requires tiktoken; otherwise, it falls back to weighted estimation.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 months ago