A Claude Skill for diagnosing abnormal token usage in Claude + DeepSeek / Claude Code workflows.
It is designed for fuzzy triggering. Users should not have to say the exact skill name. Phrases like token 消耗很高, 额度掉得很快, 缓存命中率低, Claude Code 很费 token, or claude-mem 报错 should all route to this skill.
It supports two modes:
- Manual diagnosis: ask Claude to use the skill when token usage spikes.
- Maintenance cleanup: run a safe dry-run cleanup script for rebuildable cache/log folders.
- Mem switch: check, disable, or re-enable claude-mem if cleanup does not fix repeated errors.
- Mem scan: show database/log/cache sizes in KB/MB/GB before taking action.
The skill checks:
- Cache hit/miss changes
- Repeated project/context loading
- Plugin or memory error loops
- Context hygiene problems
It then returns:
- Most likely cause
- Evidence
- Fix now
- Prevent next time
- Missing data to verify
save-token-skill/
├── SKILL.md
├── README.md
└── scripts/
├── cleanup_claude_mem.sh
└── claude_mem_switch.sh
Use the Save Token Skill.
Current workflow:
Claude Code + DeepSeek.
Problem:
Token usage suddenly increased and cache hit rate dropped.
Please diagnose the most likely cause and give me three safe fixes.
Scan first:
bash scripts/claude_mem_switch.sh scanAlways run dry-run first:
bash scripts/cleanup_claude_mem.sh --dry-runApply only after reviewing the paths:
bash scripts/cleanup_claude_mem.sh --applyThis skill is not itself a scheduler. If you want periodic cleanup, schedule the script with cron or launchd after reviewing dry-run output.
Example weekly cron entry:
0 9 * * 1 /bin/bash /absolute/path/to/save-token-skill/scripts/cleanup_claude_mem.sh --applyPrefer weekly cleanup over daily cleanup unless you have a confirmed recurring cache/log issue.
If cleanup does not help and claude-mem keeps erroring, check the plugin flag:
bash scripts/claude_mem_switch.sh statusstatus also prints a visual size scan for the mem directory.
Temporarily disable it:
bash scripts/claude_mem_switch.sh disableRe-enable it later:
bash scripts/claude_mem_switch.sh enableIf status shows disabled and Claude + DeepSeek works better with mem off, keep it disabled. Re-enable only when you explicitly need memory again and are ready to test whether the issue returns.
The switch script:
- Creates a timestamped backup before editing settings.
- Only changes
enabledPlugins["claude-mem@thedotmack"]. - Does not delete memory data, logs, API keys,
.envfiles, or project files.
Restart Claude / Claude Code after changing plugin state.
The script is conservative by default:
- It uses
--dry-rununless--applyis provided. - It only targets known cache/log/temp paths.
- It does not delete source code, project folders,
.envfiles, API keys, or user notes. - The mem switch only changes the plugin enabled flag and creates a backup first.
- Do not automatically re-enable mem after stability improves with mem disabled.