#tech#learning

CLI Commands & Flags
Session Management
| Command | Description |
|---|
claude / claude "my prompt" | Start a new session, optionally with an initial prompt |
claude -p "my prompt" | Query with prompt and quit (no ongoing session) |
claude -c | Continue most recent session |
claude --agent DocsExplorer | Start session with a custom agent |
| Command | Description |
|---|
claude --allowedTools "Read" "Write" | Skip permission confirmation for specified tools |
claude --disallowedTools "Write" | Disallow certain tools from context |
claude --dangerously-skip-permissions | ⚠️ Skip ALL permissions confirmations — use with caution |
claude --permission-mode plan | Start in plan mode |
Model & System
| Command | Description |
|---|
claude --model opus | Set default model for current session |
claude --system-prompt "..." | Replace entire default system prompt |
claude --append-system-prompt "..." | Append instruction to default system prompt |
Remote & Other
| Command | Description |
|---|
claude --remote "Add dark mode" | Start a remote (web) session |
Claude Code Interaction
| Shortcut | Action |
|---|
SHIFT + ENTER / OPTION + ENTER / CTRL + J | Enter new line |
SHIFT + TAB | Switch through different modes |
CTRL + C | Cancel current input or generation |
ESC + ESC | Restore code prior to last action |
OPTION + P / ALT + P | Switch model |
ARROW keys | Cycle through options, questions, or past messages |
CTRL + O | Toggle verbose output |
CTRL + B | Move task to background |
CTRL + V / CMD + V / ALT + V | Insert text or image |
Crucial Commands
| Command | Description |
|---|
/help | List available commands and get usage help |
/model | Choose active model for current session |
/clear | Clear session context window |
/compact | Compact and clear session context history |
/config | Open interactive settings menu |
/context | View statistics about current context window & usage |
/usage | View current usage for active plan |
/init | Analyze project and create initial CLAUDE.MD file |
/mcp | View and manage installed MCP servers |
/permissions | View and update / change permissions |
/rewind | Rewind (undo) to earlier point (same as ESC + ESC) |
/teleport | Resume a remote Claude Code session |
Settings
{"permissions": {...}}
Manage permissions for all sessions.
{"model": "opus"}
Manage default AI model for new sessions.
{"alwaysThinkingEnabled": true}
Enable/disable advanced thinking mode.
{"hooks": []}
Manage hooks.
{"env": {"IS_DEMO": "1"}}
Environment variables applied to every session.