token-optimization
CRITICAL - Read FIRST before any work. Strategies to minimize token usage and reduce costs by 60-80%.
Profile →npx skills add majiayu000/claude-skill-registry --skill token-optimization --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
// 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 |
- Quick Reference Card
- 1. PARTIAL FILE READING
- The Problem
- The Solution
- Reading Strategies
- Commands
- Read Priority
- 2. MODEL SELECTION
- Cost Comparison (Claude 4.5)
- When to Use Each
- Decision Tree
- 3. CACHING IN LEARNINGS.MD
- What to Cache
- Before Reading Any File
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
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.