Agent skill

token-optimization

CRITICAL - Read FIRST before any work. Strategies to minimize token usage and reduce costs by 60-80%.

majiayu000534★ · 1 repos on radarProfile →
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill token-optimization --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 9 KB
Bundled scripts: none
Path: skills/ai-llm/token-optimization/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

// Project Autopilot - Token Cost Reduction Strategies // Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net> # Token Optimization Skill **READ THIS SKILL FIRST.** Apply these strategies to reduce token costs by 60-80%. --- ## Quick Reference Card | Strategy | Savings | Priority | |----------|---------|----------| | Read files partially | 40-60% | 🔴 Critical | | Use Haiku for simple tasks | 50-90% | 🔴 Critical | | Cache in learnings.md | 20-40% | 🔴 Critical | | Batch related work | 20-40% | 🟡 High | | Concise output | 20-30% | 🟡 High | | Skip re-validation | 10-20% | 🟢 Medium | --- ## 1. PARTIAL FILE READING ### The Problem Reading entire files wastes tokens. A 500-line file = ~5,000 tokens. ### The Solution ```bash # ❌ NEVER do this Read entire file: src/services/userService.ts # ✅ ALWAYS do this Read lines 1-30: src/services/userService.ts # imports + interface Read lines 45-60: src/services/userService.ts # specific function ``` ### Reading Strategies | Need | Strategy | Tokens | |------|----------|--------| | File exists? | `ls` or `find` | ~10 | | File structure | Read first 30 lines | ~300 | | Specific function | Search + read range | ~200 | | Full understanding |

What's inside
Steps it walks through
  1. Quick Reference Card
  2. 1. PARTIAL FILE READING
  3. The Problem
  4. The Solution
  5. Reading Strategies
  6. Commands
  7. Read Priority
  8. 2. MODEL SELECTION
  9. Cost Comparison (Claude 4.5)
  10. When to Use Each
  11. Decision Tree
  12. 3. CACHING IN LEARNINGS.MD
  13. What to Cache
  14. Before Reading Any File
Ships with 1 file
  • metadata.json
Commands it runs
Read entire file: src/services/userService.ts
Read lines 1-30: src/services/userService.ts  # imports + interface
Read lines 45-60: src/services/userService.ts  # specific function
List files (no content)
ls -la src/services/
Find specific file
find . -name "*.service.ts"
Read just imports
head -30 src/services/user.service.ts
Read specific lines
More from claude-skill-registry
All skills →
About this skill
What does the token-optimization skill do?

CRITICAL - Read FIRST before any work. Strategies to minimize token usage and reduce costs by 60-80%.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill token-optimization --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going