Skip to content

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
claude

2. 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 ​

CommandDescription
claude updateUpdate Claude Code to the latest version
claude -cContinue the most recent conversation
claude -r <session-id>Resume a specific session
claude mcpManage and configure MCP servers

Keyboard Shortcuts ​

ShortcutFunction
Ctrl+CCancel current input or interrupt the current generation
Ctrl+DExit the Claude Code session
Ctrl+LClear the current terminal display
↑ / ↓Browse command history
Esc EscEdit the previous message

Multi-line Input

By default, use \ + Enter. On macOS, Option + Enter is common; after running /terminal-setup, Shift + Enter also works.

NextHub · Direct connections to OpenAI / Anthropic via official account pools — reliable, secure, and worry-free.