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. 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
/clearClear conversation history
/compactSummarize conversation to free context space
/rewindUndo to a specific point and compact from there
/statusShow session status and context usage
/exitExit Claude Code
/configView or modify configuration
/modelSwitch between Claude models
/doctorDiagnose installation and configuration issues
/memoryView and manage persistent memories
/reviewReview recent changes
/initBootstrap CLAUDE.md for a project

Keyboard Shortcuts

ShortcutAction
Ctrl+CCancel current operation or exit
Ctrl+LClear screen
EscapeInterrupt current generation
Esc+EscRewind — undo and compact from a checkpoint
Shift+TabInsert newline without sending
Up/DownNavigate command history
TabAutocomplete file paths
Context Management Deep Dive

The /compact and /rewind 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 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

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.

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 4.6 — Anthropic's most advanced model, ideal for complex reasoning, high-level planning, and long-horizon tasks
  • Claude Sonnet 4.6 — 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 bar showing % context window usage (📊, green below 50%, yellow 50–79%, red 80%+), 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!

Verify the Status Line

Restart Claude Code and you should see your status bar 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

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