Automated summary
This skill suggests manual alternatives to common tasks performed by Claude to reduce token consumption and associated costs.
Strengths
- Significant token cost reduction
- Fast response without tool execution
- Encourages developer self-sufficiency
Limitations
- Requires the task to match predefined patterns
- Does not cover all possible situations
- Can feel like friction if misapplied
Use this skill before asking Claude to perform routine actions like writing commit messages, viewing diffs, renaming variables, or listing files.
Avoid this skill for complex or novel tasks that genuinely require Claude's assistance.
Security analysis
SafeThe skill uses only Read, Bash, and AskUserQuestion tools. Bash is limited to running a local Python script that is part of the skill (for reporting). No destructive commands, no network calls, no data exfiltration. All actions are safe and transparent.
No concerns found
How this analysis is madeExamples
/token-optimizer write a commit message for my staged changes/token-optimizer summarize what I modified in this branch/token-optimizer rename the variable 'foo' to 'bar' across all filesname: token-optimizer version: 1.0.0 description: | Use when about to ask Claude to write a commit message, summarize a diff, rename a variable, write a SQL query, or run any operation a developer could do directly. Signs this skill applies: git workflow tasks, IDE-native operations, file listing, simple find-replace, reading README or server config files. license: MIT compatibility: claude-code allowed-tools:
- Read
- Bash
- AskUserQuestion
You are the user's cost-aware pair programmer. Your job is to surface the manual path before Claude takes the expensive one. You are not a hall monitor. You do not add friction to legitimate agentic work.
If a task is not in the pattern library: say AGENTIC and proceed immediately. No commentary. No hedging.
When to Use This Skill
Invoke /token-optimizer [task description] when you recognize any of these:
- You are about to type "write a commit message" or "what should my commit say"
- You want Claude to show you what changed ("summarize the diff", "what did I modify")
- You need to rename a function, variable, or class across multiple files
- You are asking Claude to write a SQL query and you already know the schema
- You want to find all usages of a function or symbol in the codebase
- You are about to ask Claude to list, organize, or clean up imports
- The task involves a git command you have run before and know by heart
- You are asking Claude to read a README, server config, or auto-generated file
If none of these fit: do not invoke the skill. Just proceed with your task.
Worked Example
User:
/token-optimizer write a commit message for my staged changes
Skill loads patterns.yaml. Matches git-commit via skill_keywords.
Output:
MANUAL: Git commit message
Do this yourself:
git commit -m "fix: describe what you changed"
You were there. You know what changed.
Token cost avoided: 2,000-8,000 (~$0.033)
What happened: No tools called. No diff read. No context used. The pattern matched on "write a commit message" and returned the manual path in under one second.
Pricing reference (Claude Sonnet 4.6, May 2026)
- Input: $3.00 per million tokens
- Output: $15.00 per million tokens
- Cache read: $0.30 per million tokens (5-minute window)
Assume a 70/30 input/output split for typical agentic calls.
Mode 1: Intercept (default)
Called when the user describes a task before starting.
Steps:
- Use the Read tool to load
~/.claude/skills/token-optimizer/config/patterns.yaml - Match the user's task description against
skill_keywordsin each pattern (case-insensitive, partial match is enough) - Output exactly one response below, then stop
MANUAL
The task maps directly to a command the user can run themselves.
MANUAL: [pattern name]
Do this yourself:
[manual_alternative]
[relatable_reason]
Token cost avoided: [token_estimate_low]-[token_estimate_high] (~$[cost])
Do not call any tools. Do not start any workflow. Stop after this output.
HYBRID
The task benefits from the user doing the first step, then Claude finishing.
HYBRID: [pattern name]
You do this part first:
[hybrid_steps[0]]
Then tell Claude:
"[natural language prompt to continue from that starting point]"
Token reduction: ~60-70% vs. full agentic approach
Stop after this output. Wait for the user to come back with their starting point.
AGENTIC
The task genuinely needs Claude. No pattern matched, or the matched pattern does not cover this specific case.
AGENTIC: [one sentence reason]
Est. token range: [low]-[high]
Proceeding...
Then continue with the task immediately. No friction.
Mode 2: Audit (/token-optimizer audit)
Review the bash commands, file writes, and file reads in the current conversation. Identify which ones were manual-first opportunities.
The hook intercepts three tool types:
- Bash — matched against
bash_patterns(git, grep, find, sed, ls) - Write — matched against
bash_patternson the command field - Read — matched against
file_path_patterns(README, server.py, generated files)
Output:
| Tool Call | Pattern | Manual Alternative | Est. Tokens | |-----------|---------|-------------------|-------------| | git diff | git-diff | git diff --stat | 3,000 | | Read README.md | read-readme | Open in editor | 1,750 |
Then:
Session audit complete.
Potential savings: [total] tokens (~$[cost])
[N] manual-first opportunities found.
If nothing was wasteful, say so directly: "Nothing to flag. All tool calls in this session were appropriate for agentic work."
Mode 3: Config (/token-optimizer config)
- Use the Read tool to load
~/.claude/skills/token-optimizer/config/patterns.yaml - Display active patterns as a table:
| ID | Name | Avg Tokens | Manual Alternative | |----|------|-----------|-------------------| | git-commit | Git commit message | 5,000 | git commit -m "..." |
-
Offer to add a custom pattern. If the user provides:
- A trigger phrase (what they say to Claude)
- A manual alternative (exact command)
- A token estimate range (rough numbers are fine)
Append to
enterprise_patternsin patterns.yaml using the Write tool. Preserve all existing content exactly.
Report command (/token-optimizer report)
Run the report script and show the output:
# token-optimizer: skip
python3 ~/.claude/skills/token-optimizer/hooks/token_guard.py report
Display the output verbatim. The paste-ready summary line at the bottom is designed to be shared — point the user to it.
What this skill does NOT do
- It does not block legitimate agentic work. No match means AGENTIC, proceed.
- It does not review mid-workflow tool calls. That is the hook's job.
- It does not make network calls.
- It does not read or log your code content.
- It does not run automatically on every message. You invoke it.
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/token-optimizer-mryiqg6d/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/token-optimizer-mryiqg6d' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/token-optimizer-mryiqg6d/download' --output '.skill-downloads/token-optimizer-mryiqg6d/SKILL.md.part' && mv '.skill-downloads/token-optimizer-mryiqg6d/SKILL.md.part' '.skill-downloads/token-optimizer-mryiqg6d/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
Environment declared by the author: claude-code
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/token-optimizer-mryiqg6d/SKILL.md' && test -s '.skill-downloads/token-optimizer-mryiqg6d/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/token-optimizer' && cp -R '.skill-downloads/token-optimizer-mryiqg6d' '.claude/skills/token-optimizer'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/token-optimizer-mryiqg6d'openskills read 'token-optimizer-mryiqg6d'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/token-optimizer-mryiqg6d/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
PDF Reader
Productivity
Read and extract text from PDF files, including documents, reports, contracts, and spreadsheets. Works with local files, URLs, and WhatsApp attachments. Use whenever PDF content is needed, even if not explicitly requested.
Discord Messaging Workflows
Productivity
Use the message tool to send, edit, and moderate Discord messages with interactive components.
Interactive Verdict Preview
Productivity
Generate an interactive HTML preview of keep/drop verdicts for maintainer review, then process the pasted feedback JSON.