Claude Code Basics
This chapter covers Claude Code's everyday high-frequency operations: how to launch it, how to resume sessions, and which shortcuts matter most. Master this chapter and daily use becomes much smoother.
Launching
1. Interactive Mode
The most common way to start — jump straight into the Claude Code interactive interface:
bash
claude2. Start with an Initial Prompt
Hand your first task to Claude right at launch — great for quickly analyzing a project:
bash
claude "explain this project"3. Non-Interactive Mode
Runs a single query and exits — ideal for scripts, CI, or quick Q&A:
bash
claude -p "explain this function"4. Handle Piped Input
Pipe logs, build output, or other command results straight to Claude for analysis:
bash
cat logs.txt | claude -p "explain"
cat build-error.txt | claude -p "summarize the root cause"Common Commands
| Command | Description |
|---|---|
claude update | Update Claude Code to the latest version |
claude -c | Continue the most recent conversation |
claude -r <session-id> | Resume a specific session |
claude mcp | Manage and configure MCP servers |
Keyboard Shortcuts
| Shortcut | Function |
|---|---|
Ctrl+C | Cancel current input or interrupt the current generation |
Ctrl+D | Exit the Claude Code session |
Ctrl+L | Clear the current terminal display |
↑ / ↓ | Browse command history |
Esc Esc | Edit the previous message |
Multi-line Input
By default, use \ + Enter. On macOS, Option + Enter is common; after running /terminal-setup, Shift + Enter also works.