Starting a session
1
Open a terminal in your project directory
Navigate to the directory you want to work in. Claude automatically picks up context from that directory.
2
Launch Claude Code
Run
claude with no arguments to open a blank session, or pass an initial prompt to seed the first message:3
Start typing
The input box appears at the bottom of the screen. Type a message and press Enter to send it.
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
Resume and history
Resume and history
Configuration
Configuration
Utilities
Utilities
Keyboard shortcuts
The following shortcuts work inside the interactive session.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.