Appearance
Interactive Mode
Interactive mode is where you spend most of your time with Claude Code. It's a read-eval-print loop with slash commands, keyboard shortcuts, session management, and a permission system that lets you control how much autonomy Claude Code gets. This lesson gets you past the "type a prompt and watch" phase and into the workflow you'll use every day.

What you'll learn
- Interactive mode is the REPL:
claudestarts a session,claude "initial prompt"starts with a task,claude -ccontinues the last session,claude -r "id"resumes a specific one - Slash commands (
/help,/compact,/clear,/context,/cost,/review,/model,/init,/memory,/permissions,/config,/status,/exit) control the session without leaving the conversation - Keyboard shortcuts are muscle memory:
Ctrl+Ccancels,Ctrl+Dexits,Ctrl+Rsearches history,Ctrl+Osaves transcript,Shift+Tabcycles permission modes !for shell commands,@for file references,#for memory items -- these are the three prefixes you'll use constantly
The problem
Typing claude "fix the login bug" and watching it work is satisfying. But most real work is iterative -- you ask Claude Code to do something, you see the result, you adjust, you ask for more. Interactive mode is built for this loop. You start a session, give it a task, watch the tool calls, refine the approach, and keep going. Sessions persist so you can pick up where you left off.
The problem with treating interactive mode like a chatbot is that you miss the session management features. You start a new session every time instead of continuing. You type out full instructions instead of using slash commands. You approve every tool call manually instead of configuring the permission mode. Interactive mode is a power tool -- this lesson shows you how to drive it.
Options & when to use each
| Command | What it does | When to use it |
|---|---|---|
claude | Start a new interactive session | Starting fresh work |
claude "initial prompt" | Start a session with a task already in the prompt | You know exactly what you want to do first |
claude -c | Continue the most recent session | Picking up where you left off after /exit or a crash |
claude -r "session-id" | Resume a specific session by ID | You have multiple sessions and want to go back to a specific one |
--dangerously-skip-permissions | Skip all permission prompts | You trust Claude Code completely in this session and don't want to be interrupted |
--permission-mode | Set the permission mode | acceptEdits auto-approves file changes, bypassPermissions skips everything, default prompts |
--model | Override the default model | Trying a different model for this specific session |
--effort | Set reasoning effort | Higher effort for complex architecture work, lower for simple refactors |
Build it
Step 1: Start an interactive session
Launch the read-eval-print loop (REPL) directly from your terminal. This initializes the context engine and drops you into the standard conversation interface.
bash
claudeYou'll see a banner with the model name and version. The prompt waits for your input. Type a task and Claude Code responds.
Start with a task, not a greeting:
Add a docstring to every public function in src/main.py that's missing one.
Use the Google-style docstring format.Claude Code reads the file, identifies functions without docstrings, adds them, and shows you the diff. You can accept, reject, or ask for changes.
Step 2: Use slash commands
These work at any point in an interactive session. Type / and the command name:
| Command | What it does |
|---|---|
/help | List all available slash commands and keyboard shortcuts |
/compact | Compress the conversation context to save tokens and avoid hitting limits |
/clear | Clear the conversation history, start fresh within the same session |
/context | Show what Claude Code knows about your current context (files, memory, rules) |
/cost | Show the token usage and cost for the current session |
/review | Review the changes made in the current session (diff view) |
/model | Show the current model or switch to a different one |
/init | Initialize a CLAUDE.md file for the current project |
/memory | Open the memory file for the current project to add or edit remembered facts |
/permissions | Show and change the permission mode for the current session |
/agents | List active subagents and their status |
/mcp | Manage MCP server connections |
/config | Show or edit the current configuration |
/status | Show session status: model, turns used, budget, tools active |
/exit | Exit the session (saves it for later resume) |
The three you'll use most: /compact (when the context gets long), /cost (to check spending), and /review (to see what changed).
Step 3: Master the keyboard shortcuts
These are the shortcuts you'll use constantly. They work at any point in interactive mode:
| Shortcut | What it does |
|---|---|
Ctrl+C | Cancel the current operation. If Claude Code is running a tool or thinking, this stops it |
Ctrl+D | Exit the session. Same as /exit |
Ctrl+R | Search command history. Type to filter through past prompts |
Ctrl+O | Save the transcript to a file. Claude Code prompts for a filename |
Shift+Tab | Cycle through permission modes: default -> accept edits -> bypass -> back to default |
! | Prefix for shell commands. !git status runs git status without going through Claude Code |
@ | Prefix for file references. @src/main.py tells Claude Code to read that file |
# | Prefix for memory items. #build-system pulls in a memory entry about your build system |
The !, @, and # prefixes are the muscle memory you need to build. Instead of typing "read the file src/main.py and tell me what it does," you type @src/main.py explain this file.
Step 4: Manage sessions
Control session lifecycles using command line flags. This allows you to pause work and pick up existing context without losing memory state.
bash
# Continue the most recent session
claude -c
# Start a session with an initial prompt
claude "Review the diff in the last commit and suggest improvements"
# Resume a specific session (find the ID with /status first)
claude -r "abc123"Sessions persist automatically. When you /exit or Ctrl+D, the session is saved. claude -c picks it up right where you left off -- same conversation history, same context, same files open.
Step 5: Configure permissions for your workflow
The permission system controls what Claude Code can do without asking you. There are three modes:
# During a session, use /permissions to see current mode
/permissions
# Cycle through modes with Shift+Tab
# Or start a session with the mode you want:
claude --permission-mode acceptEdits| Mode | What it does | When to use it |
|---|---|---|
default | Prompts before file edits and shell commands | Most of the time. You want to approve changes before they happen |
acceptEdits | Auto-approves file edits, prompts for shell commands | When you trust Claude Code's edits but want to review commands |
bypassPermissions | Skips all prompts | When you're iterating quickly and know exactly what you want. Use --dangerously-skip-permissions as a flag for the same effect |
Step 6: Use !, @, and # in practice
These three prefixes are the efficiency boosters in interactive mode. Instead of writing full sentences, you use shorthand:
# Instead of: "read the file src/api/routes.py and tell me what endpoints it defines"
@src/api/routes.py what endpoints does this define?
# Instead of: "run git diff to see what changed"
!git diff
# Instead of: "use the memory about our build system"
#build-system -- run the tests using thatThe @ prefix auto-completes file paths. Type @src/ and press Tab to cycle through files.
What goes wrong
| Mistake | How you notice it | The fix |
|---|---|---|
| Context gets too long and Claude Code slows down | Responses take longer, tokens are expensive | /compact compresses the history. Do this regularly in long sessions. Claude Code also auto-compacts when it's close to the limit |
| You lose your session after a crash | claude -c says "No sessions to continue" | Sessions are auto-saved on normal exit. If Claude Code crashes, the session might not be saved. Use Ctrl+O to save transcripts periodically in important sessions |
| You approve a file edit you didn't want | Claude Code changes a file and you approved it by habit | Use /review to see all changes before accepting. If you already approved, git diff to see what changed and git checkout to revert |
| Permission mode is wrong for the task | You're prompted for every trivial edit, or Claude Code makes changes you didn't want | Shift+Tab cycles permission modes. Set it once at the start of the session. default for careful work, acceptEdits for fast iteration |
! commands don't work because you're in the wrong directory | !ls shows the wrong files | Claude Code inherits the working directory from where you launched claude. Start from the project root, or !cd /path/to/project first |
| Slash commands don't autocomplete | You type /com and nothing happens | Not all slash commands support autocomplete. Type the full command name or use /help to see the list |
Confirm it worked
Test out the full suite of interactive features by running through these validation steps. It confirms that slash commands, syntax shortcuts, and session recovery are operational.
bash
# 1. Start an interactive session
claude
# 2. In the session, run a multi-step task that uses multiple tools:
# "Check the git log for the last 3 commits. For each commit, show the files
# changed and the number of lines added and removed. Summarize what changed."
# 3. Use a slash command to check cost:
# /cost
# 4. Use the @ prefix to reference a file:
# @README.md summarize what this project does
# 5. Use the ! prefix to run a shell command:
# !git status
# 6. Exit and continue the session:
# /exit
# claude -c
# 7. Verify the session resumed with the same conversation historyIf Claude Code completed the multi-step task, /cost showed token usage, @ and ! both worked, and the session resumed correctly -- interactive mode is working. This is the workflow you'll use every day.
Next: CLAUDE.md & Memory -- the memory system that keeps context cheap across sessions, and how to make Claude Code walk into your project already knowing the rules.