Skip to main content

1.2 Verify Installation

Let's confirm Claude Code is working correctly and learn the basic commands you'll use throughout this program.

Your First Claude Code Session​

Start an interactive session:

claude

You should see Claude Code initialize and present a prompt where you can type messages.

Either way, try a simple greeting:

Hello! Can you confirm you're working correctly?

Claude should respond conversationally. This confirms:

  • Your API key is valid
  • Network connectivity works
  • Claude Code is properly installed

Type /exit or press Ctrl+C to end the session.

Essential Commands​

Here are the commands you'll use most frequently:

Starting Claude Code​

# Start in current directory
claude

# Start in a specific directory
claude /path/to/project

# Start with an initial prompt
claude "What files are in this directory?"

# Start in non-interactive mode (runs once and exits)
claude -p "List all JavaScript files"

In-Session Commands​

While in a Claude Code session, these slash commands are available:

CommandDescription
/helpShow available commands
/clearStart a new session with empty context — the previous session stays on disk and is resumable
/compactSummarize conversation to free context space
/rewindUndo to a specific point and compact from there
/contextVisualize current context usage as a colored grid
/statusShow session status and context usage
/exitExit Claude Code
/config*Open settings — model, theme, permission mode, and output style
/modelSwitch between Claude models
/doctorDiagnose installation and configuration issues
/memoryView and manage persistent memories
/reviewReview recent changes
/initBootstrap CLAUDE.md for a project
/renameName the current conversation (alias: /name) so it's findable in /resume
/colorSet the prompt bar color for this session
/branchBranch the conversation at this point into a separate session
/resume*Resume a previous conversation

Desktop equivalent for the starred rows: /config opens Settings → Claude Code directly rather than an inline panel (typing extra text after it, like /config theme=dark, is ignored). /resume isn't needed at all — every past session already sits in the sidebar; click one to reopen it.

Turn on an explanatory output style while you're learning

Open /config and set Output style to Explanatory (or Learning). Claude then narrates why it chose an approach as it works, instead of just producing the result. When you're ramping on an unfamiliar codebase, language, or tool, this is the single highest-value setting in the product.

There is no separate /output-style command — output styles live under /config. Switch back to the default once the narration stops teaching you anything new.

Keyboard Shortcuts​

The Desktop app's Code tab has its own shortcut set — the terminal's interactive-mode bindings (like Shift+Tab) don't carry over. Here's the CLI shortcut and its Desktop equivalent side by side:

CLI ShortcutActionDesktop Equivalent
Ctrl+CCancel current operation or exitEsc to stop a response; Cmd+W / Ctrl+W to close the session
Ctrl+LClear screenNot applicable — there's no terminal screen to clear in a GUI
EscapeInterrupt current generationSame — Esc stops Claude's response
Esc EscSame as /rewind — step back through conversation and code-modification historyNot bound to a shortcut; run /rewind directly
Shift+TabCycle operational modes (Manual, Accept Edits, Plan, Auto)Cmd+Shift+M / Ctrl+Shift+M opens the permission mode menu, or click the mode selector next to the send button
Shift+EnterInsert a newline without sendingWorks out of the box in the composer — no setup needed
Up/DownNavigate command historyNot applicable — the composer doesn't recall prior prompts this way
TabAutocomplete file paths, skills, plugins, and slash commandsType / in the composer, or click the + button next to it, to browse commands, skills, and plugins
Ctrl+AInside /resume: search sessions across all projects on this machineNot applicable — use the sidebar's filter controls to search across sessions instead

A few Desktop-only shortcuts worth knowing: Cmd+N / Ctrl+N (new session), Cmd+Shift+I / Ctrl+Shift+I (model menu), and Cmd+/ / Ctrl+/ (show all shortcuts in the app).

Newlines need a one-time setup

Shift+Enter only works after you run /terminal-setup once. In Apple's built-in Terminal the equivalent binding is Option+Enter. Claude Code tells you which one applies when you run the command. This only applies to the terminal CLI (including the Desktop app's integrated terminal pane) — in the Desktop app's chat itself, Shift+Enter works out of the box.

Context Management Deep Dive

The /compact, /rewind, and /context commands listed above are essential tools for keeping your AI agent sharp during long sessions. You'll learn exactly when and how to use them — along with /branch, /rename, and /resume — in Context Management Best Practices.

Verification Exercise: Hello Claude​

Let's run a simple exercise to verify everything works. Create a temporary directory and test Claude's file operations:

mkdir -p ~/claude-test && cd ~/claude-test
claude
Sessions are scoped to the directory you launch from

Notice that you cd into the directory before running claude. That matters: Claude Code creates and stores a session scoped to the working directory. Opening Claude here creates a ~/claude-test session that has nothing to do with sessions you start elsewhere.

You'll feel this the moment you run /resume — it lists only the sessions started in your current directory. Press Ctrl+A to widen the search to every project on the machine; if you then pick a session from somewhere else, Claude hands you a cd <path> && claude --resume <id> command instead of resuming in place.

This shapes how you organize your work. More on it in Session Management.

Desktop works the same way, just through folders instead of cd: each session is permanently tied to the project folder you picked when you created it (visible in the sidebar), and /resume doesn't apply since there's no separate picker — every session is already listed there. If the folder is a Git repository, Desktop also gives each session its own isolated Git worktree, so parallel sessions in the same repo never step on each other's uncommitted changes.

In the Claude session, try these prompts:

1. Create a file:

Create a file called hello.py with a simple Python script that prints "Hello from Claude Code!"

2. Read the file back:

Read hello.py and confirm its contents

3. Run the script:

Run the Python script and show me the output

4. Clean up:

Delete hello.py

If all four steps complete successfully, your installation is working correctly.

Understanding Claude's Tools​

Claude Code has access to several built-in tools:

ToolPurpose
ReadRead file contents
WriteCreate or overwrite files
EditMake targeted changes to existing files
BashExecute shell commands
GlobFind files matching patterns
GrepSearch file contents
TaskLaunch specialized sub-agents

You don't need to memorize these — Claude uses them automatically based on your requests. But understanding they exist helps you phrase requests effectively.

Glob and Grep on macOS and Linux

Starting in Claude Code v2.1.117, native macOS and Linux builds (which most of us run at Liatrio) replace the separate Glob and Grep tools with embedded bfs and ugrep binaries that run through the Bash tool — the same searches, just without a separate tool round-trip. On these builds you'll see Claude reach for Bash to find files and search contents rather than calling Glob or Grep directly. Windows and npm-installed builds are unchanged and still expose Glob and Grep as first-class tools, so if you want them back, install Claude Code via npm.

Either way, you don't do anything differently — Claude picks the right search method for your platform automatically.

Check Model Access​

Verify you have access to the models you'll use:

claude "What model are you currently using?"

For this program, we primarily use:

  • Claude Opus (latest version) — Anthropic's most advanced model, ideal for complex reasoning, high-level planning, and long-horizon tasks
  • Claude Sonnet (latest version) — Excellent for most development tasks, offering a good mix of speed and intelligence

Troubleshooting Verification​

Claude doesn't respond​

"Permission denied" when creating files​

  • Ensure you have write permissions in the current directory
  • Try running in a directory you own (like ~/projects)

Commands run slowly​

  • Large context windows take longer to process
  • Start fresh sessions for new tasks to avoid context buildup
  • Check your network latency to Anthropic's API

Configure Your Status Line​

Claude Code can display a customizable status line at the bottom of your terminal — a live bar that runs any shell script you configure. It receives JSON session data and can show things like your current model, context window usage, session costs, git branch, and more. See the full list of available properties for everything you can display. Setting this up now gives you useful session telemetry from day one.

Run the /statusline Command​

The /statusline slash command generates a status line script and configures it for you automatically. Start a Claude Code session and run /statusline with a prompt describing what you want to see. Here's a sample prompt to get you started:

/statusline I would like a multi-line status line with emojis for a fun, colorful feel.

Line 1: Current model (🤖), a color-coded context meter showing tokens used (📊, from context_window.total_input_tokens plus total_output_tokens — green below 80k, yellow 80k–120k, red above 120k), and total session duration in human-readable format like 2m 34s or 1h 2m (⏱️).

Line 2: Current directory (shortened — strip everything up to and including /repos/ from the path) and git branch. Use 📂 before the directory and 🌿 before the branch.

Use ANSI colors throughout. The script should be POSIX /bin/sh compatible and read JSON from stdin.

Claude will generate a shell script, save it to ~/.claude/, and update your settings — all in one step. Experiment with different prompts to make it your own!

Why tokens instead of a percent? Research shows model quality degrades with the absolute number of tokens in context — most models are substantially degraded near ~100K tokens whether their window is 200K or 1M — so a percent gauge means different things on different models. You'll learn the full story in 1.7 Context Management and the Context Internals appendix.

Verify the Status Line​

Claude should automatically reload its config to pick up your new status line, displaying it at the bottom of the terminal. If it doesn't appear, ask Claude to help troubleshoot — try something like "my status line isn't showing up, can you help me debug it?"

Clean Up Test Directory​

Once verified, clean up the test directory:

cd ~
rm -rf ~/claude-test

Next Steps​

With Claude Code verified and working, the next section walks you through installing the Spec-Driven Development workflow prompts that form the backbone of this program.

Knowledge Check​

Question 1 of 6

1.2 Verify Installation Knowledge Check

Q1. You run `claude` in a fresh terminal and type 'Hello!' but Claude never responds. Which of the following is NOT a likely cause?