Starting a session
Open a terminal in your project directory
Navigate to the directory you want to work in. Claude automatically picks up context from that directory.
Launch Claude Code
Run
claude with no arguments to open a blank session, or pass an initial prompt to seed the first message:The terminal UI
The interface has three main areas:- Conversation pane — scrollable history of your messages and Claude’s responses, including tool output.
- Status bar — shows the current model, session cost (when applicable), and context usage.
- Input box — multiline editor at the bottom of the screen for composing messages.
The UI is rendered with React/Ink components, so it responds to terminal resize events and supports standard terminal colour themes.
Sending messages and iterating
Type your message in the input box. Press Enter to send. Claude streams its response in real time; tool calls (Bash commands, file edits, searches) appear inline as they execute. After Claude finishes a turn you can:- Reply with a follow-up to continue the conversation.
- Run a slash command (see below) to manage the session.
- Press Ctrl+C to interrupt Claude mid-task (see Interrupting Claude).
Slash commands
Type/ followed by a command name in the input box to run a slash command. Commands are available during a session and act on the conversation or the tool environment.
Core session commands
Core session commands
| Command | Description |
|---|---|
/help | Show help and available commands |
/clear (aliases: /reset, /new) | Clear conversation history and free up context |
/compact [instructions] | Summarize the conversation and replace it with a summary, freeing context. Pass optional custom summarization instructions. |
/context | Visualize current context usage as a coloured grid |
/cost | Show the total cost and duration of the current session |
/exit (alias: /quit) | Exit the REPL |
Resume and history
Resume and history
| Command | Description |
|---|---|
/resume [id or search term] (alias: /continue) | Resume a previous conversation — opens an interactive picker if no argument is given |
/export [filename] | Export the current conversation to a file or clipboard |
Configuration
Configuration
| Command | Description |
|---|---|
/config (alias: /settings) | Open the config panel |
/model [model] | Set the AI model for this session |
/memory | Edit Claude memory files |
/permissions (alias: /allowed-tools) | Manage allow and deny tool permission rules |
/keybindings | Open or create your keybindings configuration file |
Utilities
Utilities
| Command | Description |
|---|---|
/init | Initialize a new CLAUDE.md file with codebase documentation |
/doctor | Diagnose and verify your Claude Code installation and settings |
/mcp | Manage MCP server connections |
Keyboard shortcuts
The following shortcuts work inside the interactive session.| Shortcut | Action |
|---|---|
| Enter | Send message |
| Shift+Enter | Insert a newline in the input box |
| Ctrl+C | Interrupt Claude mid-task (see below) |
| Ctrl+O | Toggle conversation transcript (expand/collapse tool output) |
| Up / Down | Navigate input history |
| Ctrl+R | Search input history |
Keybinding customization is available as a preview feature. Run
/keybindings to open or create your personal keybindings file.Context window management and compacting
Every message you send and every tool result Claude receives consumes tokens from the context window. When the context window fills up, Claude can no longer see the full conversation history. Claude Code provides two ways to manage this: Automatic compaction — When the context approaches its limit, Claude Code automatically summarizes the conversation and replaces the history with the summary, freeing space while preserving the key points. Manual compaction — Run/compact at any time to trigger a summary immediately. You can provide custom instructions to control what the summary focuses on:
/context for a detailed grid view.
How Claude uses tools during a session
Claude Code gives Claude access to a set of built-in tools it can invoke autonomously during a turn:- Bash — run shell commands in your working directory
- File reading and editing — read, write, and patch source files
- Search — grep for patterns, list files, explore directory structure
- Web fetch — retrieve URLs when needed
Interrupting Claude
Press Ctrl+C while Claude is running to interrupt the current task. Claude will stop at the next safe checkpoint, report what it was doing, and return control to you.Interrupting does not undo any changes Claude has already made (files edited, commands run). If you need to revert, use your version control system.
Exiting the session
Run/exit (or its alias /quit) to end the session cleanly. You can also press Ctrl+D on an empty input line.
Sessions are automatically saved as JSONL transcripts under ~/.claude/projects/. You can resume any session later with claude --resume or the /resume slash command.