Starting a session
Launch Claude Code from your terminal in any directory:CLAUDE.md memory files it finds in your project hierarchy, then presents an input prompt. You can start typing immediately.
Keyboard shortcuts
| Shortcut | Action |
|---|---|
Enter | Submit the current input |
Ctrl+J | Insert a newline (multiline input) |
Ctrl+C | Cancel the current in-progress response |
Ctrl+D | Exit the REPL (same as /exit) |
Up / Down | Cycle through previous inputs |
Ctrl+O | Toggle conversation transcript view |
Input modes
Single-line input
Type your request and pressEnter to submit.
Multiline input
UseCtrl+J to insert a newline within your message. This lets you provide structured prompts before submitting:
Pasting file content
You can paste file contents or long blocks of text directly into the prompt. Claude reads pasted content as part of your message.How Claude reads your project context
When you start a session, Claude automatically loads:- Project memory —
CLAUDE.mdand.claude/CLAUDE.mdfiles discovered by walking from your working directory up to the filesystem root - Local memory —
CLAUDE.local.mdfiles for private project-specific instructions (gitignored) - User memory —
~/.claude/CLAUDE.mdfor your global personal instructions - Rules — all
.mdfiles in.claude/rules/directories
Claude does not automatically read every file in your project. It reads files on demand as it works — either because you reference them explicitly, or because it decides to read them to understand the codebase.
Plan mode
Plan mode restricts Claude to read-only operations. Claude can analyze code and produce a plan, but it cannot write files, run commands, or make changes until you approve.Entering plan mode
Working in plan mode
Once in plan mode, describe what you want Claude to do:.claude/plan-<slug>.md). It does not make any changes.
Viewing the current plan
Run/plan again while already in plan mode to display the plan Claude has written:
Opening the plan in an editor
$VISUAL or $EDITOR).
Executing the plan
Once you are satisfied with the plan, exit plan mode by switching back to normal mode. You can do this by asking Claude to proceed:Cost and token tracking
Viewing session cost
Context usage visualization
/compact to free up space.
Automatic compact warnings
As your conversation grows, Claude Code tracks how much context remains. When context is running low, it displays a warning suggesting you run/compact to summarize the conversation. You can suppress repeated warnings by running /compact directly.
Exiting the REPL
Ctrl+D. Both cleanly end the session. Background tasks (if any were started with Ctrl+B) continue running.