Loading...
Loading...
Compare original and translation side by side
claude --versionnpm install -g @anthropic-ai/claude-codeclaude --versionnpm install -g @anthropic-ai/claude-code--permission-mode| Mode | Description |
|---|---|
| Standard behavior - prompts for permission on first use of each tool |
| Automatically accepts file edit permissions for the session (Default for this skill) |
| Plan Mode - Claude can analyze but not modify files or execute commands |
| Skips all permission prompts (requires safe environment - see warning below) |
--permission-mode acceptEdits--permission-mode default--permission-mode plan--permission-mode bypassPermissions--allowedTools--permission-mode| 模式 | 描述 |
|---|---|
| 标准行为——首次使用每个工具时会提示获取权限 |
| 自动接受会话中的文件编辑权限 (此技能的默认模式) |
| 规划模式——Claude可以分析但不能修改文件或执行命令 |
| 跳过所有权限提示(需要安全环境——见下方警告) |
--permission-mode acceptEdits--permission-mode default--permission-mode plan--permission-mode bypassPermissions--allowedTools--print-pclaude -p "analyze the codebase structure and explain the architecture"--print-pclaude -p "analyze the codebase structure and explain the architecture"--allowedTools--disallowedToolsundefined--allowedTools--disallowedToolsundefinedundefinedundefinedundefinedundefinedundefinedundefinedclaude -p "explain file src/components/Header.tsx"claude -p "explain file src/components/Header.tsx"undefinedundefinedclaude -p "how does the data layer work?" --output-format json{
"type": "result",
"subtype": "success",
"total_cost_usd": 0.003,
"is_error": false,
"duration_ms": 1234,
"duration_api_ms": 800,
"num_turns": 6,
"result": "The response text here...",
"session_id": "abc123"
}claude -p "how does the data layer work?" --output-format json{
"type": "result",
"subtype": "success",
"total_cost_usd": 0.003,
"is_error": false,
"duration_ms": 1234,
"duration_api_ms": 800,
"num_turns": 6,
"result": "The response text here...",
"session_id": "abc123"
}claude -p "build an application" \
--permission-mode acceptEdits \
--output-format stream-jsoninitresultclaude -p "build an application" \
--permission-mode acceptEdits \
--output-format stream-jsoninitresultundefinedundefinedundefinedundefinedclaude -p "review this code" \
--append-system-prompt "Focus on security vulnerabilities and performance issues"claude -p "review this code" \
--append-system-prompt "Focus on security vulnerabilities and performance issues"claude -p "analyze the metrics" \
--mcp-config monitoring-tools.json \
--allowedTools "mcp__datadog,mcp__prometheus"claude -p "analyze the metrics" \
--mcp-config monitoring-tools.json \
--allowedTools "mcp__datadog,mcp__prometheus"claude -p "debug this issue" --verboseclaude -p "debug this issue" --verboseundefinedundefinedundefinedundefinedtimeout 300 claude -p "$complex_prompt" --permission-mode acceptEdits || echo "Timed out after 5 minutes"timeout 300 claude -p "$complex_prompt" --permission-mode acceptEdits || echo "Timed out after 5 minutes"✓ Task completed successfully
Changes made:
- [List of files modified/created]
- [Key code changes]
Results:
- [Metrics: lines changed, files affected, tests run]
- [What now works that didn't before]
Verification:
- [Tests run, checks performed]
Next steps (if applicable):
- [Suggestions for follow-up tasks]✓ 任务成功完成
已做更改:
- [修改/创建的文件列表]
- [关键代码变更]
结果:
- [指标:更改的行数、受影响的文件、运行的测试]
- [之前无法工作现在已修复的内容]
验证:
- [运行的测试、执行的检查]
后续步骤(如适用):
- [后续任务建议]claude -p "count the total number of lines of code in this project, broken down by language" \
--allowedTools "Read,Bash(find),Bash(wc)"claude -p "count the total number of lines of code in this project, broken down by language" \
--allowedTools "Read,Bash(find),Bash(wc)"claude -p "fix the authentication bug in the login flow" \
--permission-mode acceptEdits \
--allowedTools "Bash,Read,Write,Edit"claude -p "fix the authentication bug in the login flow" \
--permission-mode acceptEdits \
--allowedTools "Bash,Read,Write,Edit"claude -p "add dark mode support to the UI with theme context and style updates" \
--permission-mode acceptEdits \
--allowedTools "Bash,Read,Write,Edit"claude -p "add dark mode support to the UI with theme context and style updates" \
--permission-mode acceptEdits \
--allowedTools "Bash,Read,Write,Edit"claude -p "update all imports from old-lib to new-lib across the entire codebase" \
--permission-mode acceptEdits \
--allowedTools "Read,Write,Edit,Bash(npm test)"claude -p "update all imports from old-lib to new-lib across the entire codebase" \
--permission-mode acceptEdits \
--allowedTools "Read,Write,Edit,Bash(npm test)"claude -p "analyze the codebase for security vulnerabilities and provide a detailed report" \
--allowedTools "Read,Grep" \
--output-format jsonclaude -p "analyze the codebase for security vulnerabilities and provide a detailed report" \
--allowedTools "Read,Grep" \
--output-format jsonclaude -p "Incident: Payment API returning 500 errors (Severity: high)" \
--append-system-prompt "You are an SRE expert. Diagnose the issue, assess impact, and provide immediate action items." \
--output-format json \
--allowedTools "Bash,Read,mcp__datadog" \
--mcp-config monitoring-tools.jsonclaude -p "Incident: Payment API returning 500 errors (Severity: high)" \
--append-system-prompt "You are an SRE expert. Diagnose the issue, assess impact, and provide immediate action items." \
--output-format json \
--allowedTools "Bash,Read,mcp__datadog" \
--mcp-config monitoring-tools.jsongh pr diff | claude -p \
--append-system-prompt "You are a security engineer. Review this PR for vulnerabilities, insecure patterns, and compliance issues." \
--output-format json \
--allowedTools "Read,Grep"gh pr diff | claude -p \
--append-system-prompt "You are a security engineer. Review this PR for vulnerabilities, insecure patterns, and compliance issues." \
--output-format json \
--allowedTools "Read,Grep"undefinedundefined
**Action**: Multi-turn analysis with context preservation
**操作**:多轮分析,保留上下文claude --resume <session_id> -p "continue" --permission-mode acceptEditsclaude --resume <session_id> -p "continue" --permission-mode acceptEdits