smart-commands
Decision guide for when to proactively use Claude Code slash commands — /think, /model, /compact, /clear. Use when choosing whether to invoke a command before or during a task, or when a complexity-classifier hook has flagged a task as high or critical. Pairs with the complexity-classifier UserPromptSubmit hook. Answers when to compact, should I switch models, and whether to use extended thinking. Use to pick the right /model command and switch model.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 1
- Forks
- 1
01 前言 Front Matter
- name
- smart-commands
- triggers
- [ "smart commands", "when to use /think", "when to compact", "should I switch models", "use extended thinking", "/think", "/compact", "/model", "/clear", "slash commands" ]
- description
- Decision guide for when to proactively use Claude Code slash commands — /think, /model, /compact, /clear. Use when choosing whether to invoke a command before or during a task, or when a complexity-classifier hook has flagged a task as high or critical. Pairs with the complexity-classifier UserPromptSubmit hook. Answers when to compact, should I switch models, and whether to use extended thinking. Use to pick the right /model command and switch model.
02 资源文件 1
- 参考文档manifest.json1.2 KB
03 SKILL.md 正文
smart-commands
When to invoke Claude Code slash commands — and when not to.
/think — Extended reasoning
Use before:
- Designing something you'll have to live with (API contracts, schema, auth flow)
- Debugging a non-obvious issue where first guess is likely wrong
- Security-sensitive decisions (anything touching auth, secrets, permissions)
- When the complexity-classifier fires
[AUTO] CRITICAL
Skip when:
- The task is mechanical (rename, format, add field)
- You already know the answer with high confidence
- It's a lookup or grep task
How: Type /think before your first action on the task.
/model — Switch model
| Switch to | When |
|---|---|
/model claude-opus-4-7 |
Sustained security/architecture work (>5 turns), incident response, risky migrations |
/model claude-sonnet-4-6 |
Normal coding work (default) |
/model claude-haiku-4-5 |
Repetitive formatting, bulk triage, quick lookups across many files |
Rules:
- Switch back to Sonnet after finishing a critical section — Opus is expensive
- For Agent tool calls, always set
model:explicitly; the session model is independent CLAUDE_CODE_SUBAGENT_MODEL=claude-haiku-4-5-20251001is the default for subagents
/compact — Context compression
Use when:
- Switching to a different feature or codebase area
- Context is at 50%+ and the current task is logically complete
- You're about to start a long phase and want a clean baseline
Don't use when:
- Mid-task — compaction may lose intermediate reasoning you need
- The previous turns contain decisions you'll need to defend in the next turn
/clear — Full reset
Rarely needed. Use only when:
- Starting a completely unrelated task after a compact is insufficient
- The session has persistent tool failures and state is corrupt
Never use mid-task — you'll lose all accumulated context.
Decision tree (quick)
Is this security/arch/migration/production?
YES → /think first, consider /model opus
NO → Is this >3 phases or complex debugging?
YES → /think at key decision points
NO → Is context >50% and task is done?
YES → /compact before next task
NO → proceed normally
Installation
This skill is paired with a zero-cost complexity-classifier.sh hook that auto-injects guidance.
- Copy
complexity-classifier.shto~/.claude/hooks/ - Make it executable:
chmod +x ~/.claude/hooks/complexity-classifier.sh - Add to
settings.json:
"UserPromptSubmit": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "~/.claude/hooks/complexity-classifier.sh",
"timeout": 5
}]
}]
The hook fires on every prompt, classifies low/medium/high/critical, and injects [AUTO] guidance into systemMessage. No API calls, zero cost.
04 同仓库更多 Skills
token-audit
Audit historical Claude Code token usage from JSONL session files — shows total spend, cache hit rates, top costly sessions, weekly trends, and where tokens are going. Run after heavy sessions or weekly to measure optimization impact. Answers how many tokens a session used, how expensive was that session, session cost, and token usage report.
smart-model-route
Auto-classify prompt complexity via Haiku (with heuristic fallback) and inject model routing hints for Agent tool calls. Wired as a UserPromptSubmit hook — fires on every prompt, routes low tasks to Haiku, standard to Sonnet, complex to Sonnet with thorough reasoning, and critical (security/arch/migrations) to Opus. Handles model selection, for example choose model by task complexity.
spec-ship
暂无简介
spec-new
Create a committed per-feature spec under `docs/specs/YYYY-MM-DD-<slug>/{spec,tasks}.md` with frontmatter (status, created, owner, pr, tags). Promotes an ephemeral `.claude/plans/<name>.md` into a persistent, searchable artifact. Use when starting a feature that's larger than a one-shot PR.
roadmap-refresh
Regenerate `docs/roadmap.md` for a repo from all specs under `docs/specs/` + their frontmatter (status, tags, pr). Produces Now/Next/Recently-shipped sections. Run after creating / shipping a spec, or at the start of a new session for orientation.
aggregate-roadmap
Regenerate the cross-repo roadmap aggregate in your Claude memory directory by walking every curated repo's `docs/specs/**` frontmatter. Run at session start for cross-repo orientation or after any `spec-new`/`spec-ship` in any repo.