Your First Conversation
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)
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.
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
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"
Let's have Claude analyze actual code. In interactive mode:
> What does the main function in this project do?
Claude will:
- Find the relevant file(s)
- Read them
- 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?
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
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 |
/compact when conversations get long. It summarizes everything so far into a shorter context, freeing up space for more detailed work ahead./clear with /compact. Clear wipes everything — Claude forgets the entire conversation. Compact keeps a summary.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:
- Show you the code it wants to create
- Ask for permission to write the file
- 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
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
/clearfirst) - Being vague after specific context ("make it better" — better how?)
Questions & Answers
/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.claude --resume to pick up your last conversation, or use /compact before closing to save a summary.Key Takeaways
- Two modes: Interactive (
claude) for conversations, one-shot (claude "prompt") for quick questions - Context is king: Always run Claude from your project directory — that's what it can see
- Permission model: Claude always asks before creating or modifying files
- Slash commands:
/help,/clear,/compact,/cost,/quitcontrol your session - Multi-turn: Build on previous messages rather than repeating context
- 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.