Your First Conversation

30-45 min beginner Lesson 1

Learning Outcomes

  • Start and exit Claude Code sessions confidently
  • Understand the difference between interactive and one-shot modes
  • Ask Claude to explain code and answer questions
  • Use basic slash commands to control the session
  • Understand how Claude reads your project context

Lesson Plan

Segment Duration Topic
Intro 3 min What we'll cover, what you need
Demo 1 8 min Starting Claude, first conversation
Explain 5 min Interactive vs one-shot mode
Demo 2 10 min Asking about code, exploring a project
Explain 5 min How context works
Demo 3 7 min Slash commands and session control
Wrap-up 5 min Key takeaways, preview next lesson

Before You Begin

Pre-work:

  • Complete the Installation guide
  • Have a terminal open
  • Navigate to any folder with code (or create an empty folder)

Shopping List:

  • Claude Code installed and authenticated
  • A terminal application
  • Any code project (even a single file is fine)

1 Starting Claude Code in Interactive Mode

Open your terminal and navigate to a project directory:

cd ~/my-project
claude

You'll see Claude's interactive prompt appear:

╭─────────────────────────────────────╮
│ Claude Code                          │
│                                      │
│ Working directory: ~/my-project      │
╰─────────────────────────────────────╯

>

This is interactive mode — Claude stays open and you can have a back-and-forth conversation. Type your message and press Enter.

Try something simple:

> Hello! What can you help me with?

Claude will respond, explaining its capabilities. Notice how it knows the directory you're in.

TIP
Tip
Claude automatically detects your project type by scanning the directory. It can see your files, package.json, git history, and more — all from the start.
WARNING
Watch Out
Don't run claude from your home directory or root — Claude works best when you're inside a specific project folder. The working directory sets the context for everything it does.

On macOS, use Terminal.app, iTerm2, or any terminal emulator. Claude Code works identically in all of them.

On Windows, always run Claude Code inside WSL, not PowerShell or CMD. Open your WSL terminal first:

wsl
cd ~/my-project
claude

2 One-Shot Mode — Quick Questions

For quick questions, you don't need to enter interactive mode. Use one-shot mode by passing your prompt directly:

claude "What files are in this directory?"

Claude will answer and exit immediately. This is perfect for:

  • Quick questions about your code
  • Single operations (rename a file, explain a function)
  • Piping into scripts

Compare the two modes:

Mode Command Use Case
Interactive claude Multi-turn conversations, complex tasks
One-shot claude "prompt" Quick questions, single operations

Try a few one-shot examples:

claude "Explain what this project does in one paragraph"
claude "What language is this project written in?"
claude "List the main entry points"
NOTE
How It Works
In one-shot mode, Claude still reads your project context — it just answers and exits instead of waiting for follow-up questions.

3 Asking Claude About Your Code

Let's have Claude analyze actual code. In interactive mode:

> What does the main function in this project do?

Claude will:

  1. Find the relevant file(s)
  2. Read them
  3. Explain what the code does

You can ask follow-up questions:

> What are the dependencies this project uses?
> Which files handle authentication?
> Is there any error handling in the database layer?

Each question builds on the conversation context — Claude remembers what you've discussed.

Try asking Claude to explain code at different levels:

> Explain index.js like I'm a beginner
> What are the performance implications of this approach?
> Are there any bugs or issues you notice?
TIP
Tip
Be specific! Instead of 'explain the code', try 'explain how the login function validates passwords in auth.js'. Specific prompts get specific, useful answers.
WARNING
Watch Out
Claude reads files on demand. If you reference a file that doesn't exist, Claude will tell you. Always make sure you're in the right directory.

4 Understanding Context — What Claude Can See

Claude Code's power comes from its ability to understand your project context. Here's what Claude can access:

Automatically available:

  • All files in the working directory (recursively)
  • Git history and current status
  • Package manifests (package.json, requirements.txt, etc.)
  • Environment structure (not secrets)

Not available unless you share:

  • Files outside the working directory
  • Running processes or server state
  • Database contents
  • Environment variable values

When you start a conversation, Claude builds a mental model of your project. You can ask it directly:

> What do you know about this project?
> What's the folder structure look like?
> Show me the recent git history
NOTE
How It Works
Claude doesn't read every file immediately — it reads files as needed based on your questions. This keeps conversations fast even in large projects.

5 Slash Commands — Controlling Your Session

While in interactive mode, you have access to slash commands that control the session:

Command What It Does
/help Show available commands
/clear Clear conversation history and start fresh
/compact Summarize the conversation to save context
/cost Show token usage for this session
/quit Exit Claude Code

Try them out:

> /help

This shows all available commands and their descriptions.

> /cost

This shows how many tokens you've used — useful for tracking API costs.

Keyboard shortcuts:

Shortcut Action
Ctrl+C Cancel current generation
Ctrl+D Exit Claude Code
Esc Cancel current input
Up Arrow Previous message
TIP
Tip
Use /compact when conversations get long. It summarizes everything so far into a shorter context, freeing up space for more detailed work ahead.
WARNING
Watch Out
Don't confuse /clear with /compact. Clear wipes everything — Claude forgets the entire conversation. Compact keeps a summary.

6 Your First Practical Task

Let's do something practical. Create a new folder and have Claude help you with a real task:

mkdir ~/claude-practice
cd ~/claude-practice
claude

Now ask Claude to create something:

> Create a simple Python script that prints "Hello, World!" and explains what each line does with comments

Claude will:

  1. Show you the code it wants to create
  2. Ask for permission to write the file
  3. Create the file once you approve

You'll see something like:

I'll create a simple Python script for you.

┌─ hello.py ──────────────────────────────┐
│ # This is a Python script               │
│ # The print function outputs text        │
│ print("Hello, World!")                   │
└──────────────────────────────────────────┘

Create this file? (y/n)

Type y to approve. The file is created in your current directory.

Verify it:

> Run the script and show me the output
NOTE
How It Works
Claude always asks permission before creating, editing, or deleting files. You're always in control — nothing happens without your approval.
WARNING
Watch Out
If Claude tries to create a file and you see a path you don't expect, say no and clarify where you want the file created. Always check the path before approving.

7 Multi-Turn Conversations — Building on Context

The real power of interactive mode is multi-turn conversation. Each message builds on the previous ones:

> Create a function that calculates the fibonacci sequence up to n numbers

> Now add error handling for negative numbers

> Add a docstring explaining how to use it

> Write a test for this function

Notice how you don't need to repeat context — Claude remembers you're working on the fibonacci function and adds to it progressively.

Good multi-turn patterns:

  • Start broad, then refine: "Create X" → "Now add Y" → "Make Z better"
  • Ask for explanation, then modification: "Explain this" → "Change it to..."
  • Build incrementally: "Create the skeleton" → "Add feature A" → "Add feature B"

Anti-patterns to avoid:

  • Starting over each message with full context
  • Asking unrelated questions mid-conversation (use /clear first)
  • Being vague after specific context ("make it better" — better how?)
TIP
Tip
Think of a Claude conversation like pair programming. You're the navigator (giving direction) and Claude is the driver (writing code). Clear directions = better code.

Questions & Answers

Q: How much does each conversation cost?
It depends on usage. Use /cost during a session to check. A typical 30-minute session might use 50K-200K tokens. With Claude Pro/Max, it's included in your subscription.
Q: Can Claude see my environment variables or secrets?
No. Claude can see file contents but not environment variable values unless they're hardcoded in files (which they shouldn't be). Your .env files are typically gitignored and Claude respects that boundary.
Q: What happens if I close the terminal mid-conversation?
The conversation is lost. Each session starts fresh. If you want to resume work, you can use claude --resume to pick up your last conversation, or use /compact before closing to save a summary.
Q: Can Claude access the internet?
Not by default. Claude Code works with your local files and tools. However, with MCP servers (covered in Lesson 7), you can give Claude access to web searches, APIs, and more.
Q: Is my code sent to Anthropic's servers?
Yes — the code Claude reads is sent to Anthropic's API for processing. Anthropic does not use this data for training. If you're working with sensitive code, review Anthropic's data usage policy.

Key Takeaways

  1. Two modes: Interactive (claude) for conversations, one-shot (claude "prompt") for quick questions
  2. Context is king: Always run Claude from your project directory — that's what it can see
  3. Permission model: Claude always asks before creating or modifying files
  4. Slash commands: /help, /clear, /compact, /cost, /quit control your session
  5. Multi-turn: Build on previous messages rather than repeating context
  6. Be specific: Detailed prompts produce detailed, useful results

Next Steps: In Lesson 2 — Project Setup & CLAUDE.md, you'll learn how to configure Claude's behavior for your specific project using the CLAUDE.md file.