Skip to main content
Claude Code’s default mode is an interactive REPL built with Ink (React for the terminal). It keeps a live conversation with Claude, lets you run slash commands, and gives Claude access to tools like Bash, file editing, and search.

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:
# Blank session
claude

# Session with an initial prompt
claude "refactor the auth module to use async/await"
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.
CommandDescription
/helpShow 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.
/contextVisualize current context usage as a coloured grid
/costShow the total cost and duration of the current session
/exit (alias: /quit)Exit the REPL
CommandDescription
/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
CommandDescription
/config (alias: /settings)Open the config panel
/model [model]Set the AI model for this session
/memoryEdit Claude memory files
/permissions (alias: /allowed-tools)Manage allow and deny tool permission rules
/keybindingsOpen or create your keybindings configuration file
CommandDescription
/initInitialize a new CLAUDE.md file with codebase documentation
/doctorDiagnose and verify your Claude Code installation and settings
/mcpManage MCP server connections
Press Tab after / to autocomplete command names. You can also type a search term as an argument to /resume to filter sessions by their first prompt.

Keyboard shortcuts

The following shortcuts work inside the interactive session.
ShortcutAction
EnterSend message
Shift+EnterInsert a newline in the input box
Ctrl+CInterrupt Claude mid-task (see below)
Ctrl+OToggle conversation transcript (expand/collapse tool output)
Up / DownNavigate input history
Ctrl+RSearch 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:
/compact focus on the decisions made about the API schema
The status bar shows a context usage indicator so you can see how full the window is before it becomes a problem. Run /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
Tool calls appear inline in the conversation pane as they execute. Each call shows the tool name, the input, and the output or result.
Claude can run shell commands and modify files in your working directory. Review the permission settings (/permissions) if you want to restrict which tools or commands are allowed.

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.

Build docs developers (and LLMs) love