Week 4 of 12 ⌨️

Slash Commands & Configuration

Slash Commands และการตั้งค่า

Slash Commands & Configuration

1. Introduction / บทนำ

Slash commands คือทางลัดที่เริ่มต้นด้วย / และควบคุมพฤติกรรมของ Claude Code ช่วยให้คุณจัดการเซสชัน เปลี่ยนโมเดล ดูค่าใช้จ่าย ตั้งค่า และอื่นๆ อีกมากมาย — โดยไม่ต้องออกจากการสนทนา
Slash commands are shortcuts that start with / and control Claude Code's behavior. They let you manage sessions, change models, view costs, configure settings, and much more — all without leaving the conversation.

Fun Facts / ข้อเท็จจริงที่น่าสนใจ

  • /compact can save 80% of your context window!
  • /model lets you switch between Opus, Sonnet, and Haiku.
  • /diff opens an interactive viewer for uncommitted changes.

2. Vocabulary / คำศัพท์

Click a card to flip it. คลิกการ์ดเพื่อพลิก

command
คำสั่ง
An instruction to the program
slash
สแลช / เครื่องหมาย /
The / character used before commands
clear
ล้าง
To remove all conversation history
compact
ย่อ
To compress conversation to save context
config
คอนฟิก / ตั้งค่า
To change program settings
model
โมเดล
The AI model being used
effort
ระดับความพยายาม
How hard the AI tries (low/medium/high)
diff
ดิฟฟ์
To show changes between file versions
status
สถานะ
Current state of the program
cost
ต้นทุน / ค่าใช้จ่าย
Token usage and billing
resume
กลับมาต่อ
To continue a previous session
export
ส่งออก
To save conversation as a file

3. Grammar Focus / ไวยากรณ์

Modal Verbs (can, should, must) / คำกริยาช่วย (can, should, must)

Thai:
คำกริยาช่วย (can, should, must) มาก่อนกริยาหลักและไม่เปลี่ยนรูป 'Can' = ความสามารถ 'Should' = คำแนะนำ 'Must' = ข้อบังคับ ตัวอย่าง: 'You can use /clear to reset.' 'You should save before exiting.'
English:
Modal verbs (can, should, must) come before the main verb and don't change form. 'Can' = ability/possibility. 'Should' = recommendation. 'Must' = obligation. Example: 'You can use /clear to reset.' 'You should save before exiting.'
คุณสามารถใช้ /compact เพื่อประหยัดบริบท
You can use /compact to save context.
คุณควรตรวจสอบ /cost ก่อนเซสชันยาว
You should check /cost before long sessions.
คุณต้องเข้าสู่ระบบก่อนใช้ Claude Code
You must login before using Claude Code.

Section Check 1

What does /compact do?

/compact ทำอะไร?

Section Check 2

Which modal means 'recommendation'?

คำกริยาช่วยตัวใดหมายถึง 'คำแนะนำ'?

Section Check 3

How do you change the AI model?

เปลี่ยนโมเดล AI ยังไง?

4. Tutorial Steps / ขั้นตอนการเรียนรู้

1
Type / to see all commands / พิมพ์ / เพื่อดูคำสั่งทั้งหมด
A menu appears showing all available slash commands.
2
Clear your conversation / ล้างการสนทนา
Type /clear to start fresh. Your files and project stay the same.
3
Change the AI model / เปลี่ยนโมเดล AI
Type /model and select from Opus (powerful), Sonnet (balanced), or Haiku (fast).
4
Check your costs / ตรวจสอบค่าใช้จ่าย
Type /cost to see how many tokens you've used in this session.
5
Configure settings / ตั้งค่า
Type /config to open the settings interface.

5. Hands-On Activity / กิจกรรมลงมือทำ

แบบฝึกหัด: ลอง /status, /cost และ /model ในเซสชัน Claude Code จดบันทึกว่าแต่ละคำสั่งแสดงอะไร
Practice: Try /status, /cost, and /model in a Claude Code session. Write down what each command shows you.

6. Reference Table / ตารางอ้างอิง

Command / ToolEnglishภาษาไทย
/clearReset conversationรีเซ็ตการสนทนา
/compactCompress contextบีบอัดบริบท
/modelChange AI modelเปลี่ยนโมเดล AI
/costShow token usageแสดงการใช้โทเค็น
/diffView file changesดูการเปลี่ยนแปลงไฟล์
/configOpen settingsเปิดการตั้งค่า

7. Summary / สรุป

Slash commands ควบคุมพฤติกรรมของ Claude Code คำสั่งสำคัญ ได้แก่ /clear (รีเซ็ต), /compact (ประหยัดบริบท), /model (สลับ AI) และ /config (ตั้งค่า) คำกริยาช่วย (can/should/must) แสดงความสามารถ คำแนะนำ และข้อบังคับ
Slash commands control Claude Code's behavior. Key commands include /clear (reset), /compact (save context), /model (switch AI), and /config (settings). Modal verbs (can/should/must) express ability, advice, and obligation.

Homework / การบ้าน

1. ระบุ slash commands 5 ตัวและวัตถุประสงค์
2. ใช้ /compact ในเซสชันและสังเกตความแตกต่าง
3. เขียนประโยค 3 ประโยคด้วย can, should และ must
1. List 5 slash commands and their purposes.
2. Use /compact in a session and note the difference.
3. Write 3 sentences each with can, should, and must.