คู่มือ Commands
Catalog ครบถ้วนของ slash commands ทั้งหมดใน Claude Code
ภาพรวม
Commands คือ actions ที่ user เรียกใช้ผ่านคำนำหน้า / ใน REPL (เช่น /commit, /review) อยู่ใน src/commands/ และลงทะเบียนใน src/commands.ts
ประเภทของ Command
| ประเภท | คำอธิบาย | ตัวอย่าง |
|---|
| PromptCommand | ส่ง prompt ที่จัดรูปแบบไปยัง LLM พร้อม tools ที่ inject | /review, /commit |
| LocalCommand | ทำงานใน-process คืนค่า plain text | /cost, /version |
| LocalJSXCommand | ทำงานใน-process คืนค่า React JSX | /install, /doctor |
รูปแบบการนิยาม Command
const command = {
type: 'prompt',
name: 'my-command',
description: 'สิ่งที่ command นี้ทำ',
progressMessage: 'กำลังดำเนินการ...',
allowedTools: ['Bash(git *)', 'FileRead(*)'],
source: 'builtin',
async getPromptForCommand(args, context) {
return [{ type: 'text', text: '...' }]
},
} satisfies Command
Git & Version Control
| Command | Source | คำอธิบาย |
|---|
/commit | commit.ts | สร้าง git commit พร้อม message ที่ AI สร้างให้ |
/commit-push-pr | commit-push-pr.ts | Commit, push และสร้าง PR ในขั้นตอนเดียว |
/branch | branch/ | สร้างหรือสลับ git branches |
/diff | diff/ | ดูการเปลี่ยนแปลงไฟล์ (staged, unstaged หรือเทียบกับ ref) |
/pr_comments | pr_comments/ | ดูและแก้ไข PR review comments |
/rewind | rewind/ | ย้อนกลับไปยังสถานะก่อนหน้า |
Code Quality
| Command | Source | คำอธิบาย |
|---|
/review | review.ts | Code review ด้วย AI สำหรับ staged/unstaged changes |
/security-review | security-review.ts | Code review เน้นด้านความปลอดภัย |
/advisor | advisor.ts | รับคำแนะนำด้าน architecture หรือ design |
/bughunter | bughunter/ | ค้นหาบัคที่อาจเกิดขึ้นใน codebase |
Session & Context
| Command | Source | คำอธิบาย |
|---|
/compact | compact/ | บีบอัด conversation context เพื่อรองรับ history มากขึ้น |
/context | context/ | แสดง context ปัจจุบัน (files, memory ฯลฯ) |
/resume | resume/ | กู้คืน conversation session ก่อนหน้า |
/session | session/ | จัดการ sessions (list, switch, delete) |
/share | share/ | แชร์ session ผ่าน link |
/export | export/ | Export conversation ไปยังไฟล์ |
/summary | summary/ | สร้างสรุปของ session ปัจจุบัน |
/clear | clear/ | ล้าง conversation history |
Configuration & Settings
| Command | Source | คำอธิบาย |
|---|
/config | config/ | ดูหรือแก้ไข Claude Code settings |
/permissions | permissions/ | จัดการ tool permission rules |
/theme | theme/ | เปลี่ยน terminal color theme |
/output-style | output-style/ | เปลี่ยนรูปแบบการแสดงผล output |
/color | color/ | สลับการแสดงสี |
/keybindings | keybindings/ | ดูหรือปรับแต่ง keybindings |
/vim | vim/ | สลับ vim mode สำหรับ input |
/effort | effort/ | ปรับระดับความพยายามในการตอบ |
/model | model/ | เปลี่ยน model ที่ใช้งานอยู่ |
/privacy-settings | privacy-settings/ | จัดการการตั้งค่า privacy/ข้อมูล |
/fast | fast/ | สลับ fast mode (การตอบที่สั้นกว่า) |
/brief | brief.ts | สลับโหมด brief output |
Memory & Knowledge
| Command | Source | คำอธิบาย |
|---|
/memory | memory/ | จัดการ persistent memory (CLAUDE.md files) |
/add-dir | add-dir/ | เพิ่ม directory เข้าใน project context |
/files | files/ | แสดงไฟล์ใน context ปัจจุบัน |
MCP & Plugins
| Command | Source | คำอธิบาย |
|---|
/mcp | mcp/ | จัดการ MCP server connections |
/plugin | plugin/ | ติดตั้ง ลบ หรือจัดการ plugins |
/reload-plugins | reload-plugins/ | โหลด plugins ที่ติดตั้งทั้งหมดใหม่ |
/skills | skills/ | ดูและจัดการ skills |
Authentication
| Command | Source | คำอธิบาย |
|---|
/login | login/ | ยืนยันตัวตนกับ Anthropic |
/logout | logout/ | ออกจากระบบ |
/oauth-refresh | oauth-refresh/ | รีเฟรช OAuth tokens |
Tasks & Agents
| Command | Source | คำอธิบาย |
|---|
/tasks | tasks/ | จัดการ background tasks |
/agents | agents/ | จัดการ sub-agents |
/ultraplan | ultraplan.tsx | สร้าง execution plan ที่ละเอียด |
/plan | plan/ | เข้าสู่ planning mode |
Diagnostics & Status
| Command | Source | คำอธิบาย |
|---|
/doctor | doctor/ | ทำการตรวจสอบ environment |
/status | status/ | แสดงสถานะระบบและ session |
/stats | stats/ | แสดงสถิติ session |
/cost | cost/ | แสดง token usage และค่าใช้จ่ายโดยประมาณ |
/version | version.ts | แสดงเวอร์ชัน Claude Code |
/usage | usage/ | แสดงรายละเอียด API usage |
/extra-usage | extra-usage/ | แสดงรายละเอียด usage เพิ่มเติม |
/rate-limit-options | rate-limit-options/ | ดูการตั้งค่า rate limit |
Installation & Setup
| Command | Source | คำอธิบาย |
|---|
/install | install.tsx | ติดตั้งหรืออัปเดต Claude Code |
/upgrade | upgrade/ | อัปเกรดเป็นเวอร์ชันล่าสุด |
/init | init.ts | เริ่มต้น project (สร้าง CLAUDE.md) |
/init-verifiers | init-verifiers.ts | ตั้งค่า verifier hooks |
/onboarding | onboarding/ | เรียกใช้ setup wizard ครั้งแรก |
/terminalSetup | terminalSetup/ | ตั้งค่า terminal integration |
IDE & Desktop Integration
| Command | Source | คำอธิบาย |
|---|
/bridge | bridge/ | จัดการ IDE bridge connections |
/bridge-kick | bridge-kick.ts | บังคับ restart IDE bridge |
/ide | ide/ | เปิดใน IDE |
/desktop | desktop/ | ส่งต่อไปยัง desktop app |
/mobile | mobile/ | ส่งต่อไปยัง mobile app |
/teleport | teleport/ | ย้าย session ไปยังอุปกรณ์อื่น |
Remote & Environment
| Command | Source | คำอธิบาย |
|---|
/remote-env | remote-env/ | ตั้งค่า remote environment |
/remote-setup | remote-setup/ | ตั้งค่า remote session |
/env | env/ | ดู environment variables |
/sandbox-toggle | sandbox-toggle/ | สลับ sandbox mode |
เบ็ดเตล็ด
| Command | Source | คำอธิบาย |
|---|
/help | help/ | แสดงความช่วยเหลือและ commands ที่มี |
/exit | exit/ | ออกจาก Claude Code |
/copy | copy/ | คัดลอกเนื้อหาไปยัง clipboard |
/feedback | feedback/ | ส่ง feedback ไปยัง Anthropic |
/release-notes | release-notes/ | ดู release notes |
/rename | rename/ | เปลี่ยนชื่อ session ปัจจุบัน |
/tag | tag/ | แท็ก session ปัจจุบัน |
/insights | insights.ts | แสดง codebase insights |
/stickers | stickers/ | Easter egg — stickers |
/good-claude | good-claude/ | Easter egg — ชมเชย Claude |
/voice | voice/ | สลับโหมด voice input |
/chrome | chrome/ | Chrome extension integration |
/issue | issue/ | ยื่น GitHub issue |
/statusline | statusline.tsx | ปรับแต่ง status line |
/thinkback | thinkback/ | เล่นซ้ำกระบวนการคิดของ Claude |
/thinkback-play | thinkback-play/ | เล่นซ้ำการคิดแบบ animated |
/passes | passes/ | Multi-pass execution |
/x402 | x402/ | x402 payment protocol integration |
Internal / Debug Commands
| Command | Source | คำอธิบาย |
|---|
/ant-trace | ant-trace/ | Anthropic-internal tracing |
/autofix-pr | autofix-pr/ | แก้ไข PR issues อัตโนมัติ |
/backfill-sessions | backfill-sessions/ | Backfill session data |
/break-cache | break-cache/ | ทำให้ cache ไม่ valid |
/btw | btw/ | การขัดจังหวะ “By the way” |
/ctx_viz | ctx_viz/ | Context visualization (debug) |
/debug-tool-call | debug-tool-call/ | Debug tool call เฉพาะ |
/heapdump | heapdump/ | Dump heap สำหรับวิเคราะห์ memory |
/hooks | hooks/ | จัดการ hook scripts |
/mock-limits | mock-limits/ | Mock rate limits สำหรับทดสอบ |
/perf-issue | perf-issue/ | รายงานปัญหาด้าน performance |
/reset-limits | reset-limits/ | Reset rate limit counters |
ดูเพิ่มเติม