本文由 AI 分析生成
建立時間: 2026-01-09 來源: https://x.com/sitinme/status/2009448985753485357
Summary
Inspired by Claude Code creator Boris Cherny using a custom /commit-push-pr command dozens of times a day, the author argues Slash Commands are not a “trick” but an efficiency system. A Slash Command is just a Markdown file in .claude/commands/ whose name is the command and whose content is the prompt — turning a frequently-repeated instruction into a one-key action. You can encode full engineering processes (commit conventions, PR structure, refactoring principles) and parameterize them with $ARGUMENTS, and because they’re committed to Git, personal habits become shared team assets.
受 Claude Code 創造者 Boris Cherny 每天用 /commit-push-pr 自訂命令數十次的啟發,作者主張 Slash Commands 不是「技巧」而是效率體系。一個 Slash Command 就是 .claude/commands/ 下的一個 Markdown 檔,檔名即命令、內容即提示詞,把高頻重複的指令變成一鍵動作。你可以把整套工程流程(commit 規範、PR 結構、重構原則)寫進去,用 $ARGUMENTS 參數化,而且因為它們被提交到 Git,個人習慣會變成團隊共享資產。
Key Points
- A Slash Command = a Markdown file in .claude/commands/; filename is the command, content is the prompt.
- Collapse high-frequency, low-complexity instructions (review, commit-push-pr) into one keystroke.
- Encode full SOPs: commit message specs, PR structure, test-failure handling, refactoring principles.
- $ARGUMENTS enables parameterized commands like
/doc React hooksfor docs search and summary. - Slash Commands vs Subagents: shortcuts for repeated input vs independent-context, parallel complex tasks.
- Commands, CLAUDE.md, and permissions are version-controlled and team-shareable.
Insights
The reframe from “using AI to write code” to “using AI to execute your development SOP” is the load-bearing idea: the command files externalize tacit process knowledge into versioned, reviewable artifacts. The per-use saving is trivial (a few seconds) but the high daily frequency makes the aggregate gap large — and committing the commands to Git turns an individual’s efficiency habits into compounding team capital. The explicit Slash-Command-vs-Subagent distinction is a useful guardrail against over-engineering simple shortcuts.
Connections
Raw Excerpt
如果你发现自己经常在对 Claude 说同样的话,那这件事就值得被做成一个 Slash Command。