Chapter 14: Controls and Modes
Working Modes
Interactive Mode
14.1 工作模式
bash
# Start interactive mode
claude
# Features
- Continuous dialogue
- Context preservation
- Session managementSingle Command Mode
bash
# Execute single task
claude "create a hello.js file"
# Features
- Quick execution
- Independent tasks
- StatelessPlan Mode
bash
# Plan mode
You: implement user authentication
Claude: Let me enter Plan Mode to design the implementation.
[Plan Mode]
1. Analyzing requirements...
2. Creating implementation plan...
3. Presenting plan for approval...
Proceed with implementation? (yes/no)Permission Controls
Configure Permissions
14.2 权限控制
json
{
"permissions": {
"fileOperations": {
"read": true,
"write": "prompt",
"delete": "deny"
},
"commandExecution": {
"bash": "prompt",
"system": "deny"
},
"networkAccess": {
"http": true,
"external": "prompt"
}
}
}Permission Levels:
true/allow: Auto-allowprompt: Ask each timefalse/deny: Deny
Session Controls
14.3 会话控制
bash
# Suspend session
Ctrl + Z
# Resume session
fg
# Interrupt operation
Ctrl + C
# Exit
Ctrl + D
exit
/quitSummary
In this chapter, we learned:
- ✅ Three working modes (Interactive, Single Command, Plan)
- ✅ Permission control configuration
- ✅ Session control commands
Next Step: Chapter 15 introduces slash commands!