> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/jackdog668/claude-code/llms.txt
> Use this file to discover all available pages before exploring further.

# Interactive mode

> Use Claude Code as an interactive REPL for iterative coding, exploration, and agentic tasks.

Claude Code's default mode is an interactive REPL built with [Ink](https://github.com/vadimdemedes/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

<Steps>
  <Step title="Open a terminal in your project directory">
    Navigate to the directory you want to work in. Claude automatically picks up context from that directory.
  </Step>

  <Step title="Launch Claude Code">
    Run `claude` with no arguments to open a blank session, or pass an initial prompt to seed the first message:

    ```bash theme={null}
    # Blank session
    claude

    # Session with an initial prompt
    claude "refactor the auth module to use async/await"
    ```
  </Step>

  <Step title="Start typing">
    The input box appears at the bottom of the screen. Type a message and press **Enter** to send it.
  </Step>
</Steps>

## 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.

<Note>
  The UI is rendered with React/Ink components, so it responds to terminal resize events and supports standard terminal colour themes.
</Note>

## 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](#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.

<AccordionGroup>
  <Accordion title="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                                                                                                               |
  </Accordion>

  <Accordion title="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                               |
  </Accordion>

  <Accordion title="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 |
  </Accordion>

  <Accordion title="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                                  |
  </Accordion>
</AccordionGroup>

<Tip>
  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.
</Tip>

## 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                                         |

<Note>
  Keybinding customization is available as a preview feature. Run `/keybindings` to open or create your personal keybindings file.
</Note>

## 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.

<Warning>
  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.
</Warning>

## 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.

<Note>
  Interrupting does not undo any changes Claude has already made (files edited, commands run). If you need to revert, use your version control system.
</Note>

## 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.
