ASK KNOX
beta
LESSON 42

Your First Session with Claude

Starting a session, asking questions versus giving tasks, reading tool calls in real time, and understanding permission modes — this is what Claude Code actually feels like to use.

9 min read·Getting Started with Claude Code

You have Claude Code installed. The API key is configured. You navigate to your project directory, type claude, and press Enter. The welcome prompt appears. Now what?

This lesson covers the mechanics of an actual session — what to type, how to read Claude's responses, how to understand the tool calls it makes, and when to use which permission mode.

Your First Session with Claude

Starting a Session

Claude Code runs in your terminal as an interactive session. Navigate to the directory you want to work in and run:

claude

That is it. You are in. Claude Code reads the current directory as its working context. Any file operations it performs happen relative to this location.

If you have a CLAUDE.md file in the current directory, Claude reads it automatically before your first message. This is the project-specific instruction file — more on this in Lesson 44. For now, just know it exists.

Questions vs. Tasks

The most important thing to understand about Claude Code sessions is the distinction between questions and tasks.

Questions are requests for information. Claude answers them conversationally without touching your filesystem or running any commands.

> How does JavaScript's event loop work?
> What's the difference between == and === in JavaScript?
> Explain what a closure is.

Claude gives a clear, direct explanation. No tools are called. No files are read. Fast and cheap in terms of token usage.

Tasks are requests for Claude to do something. Claude plans a sequence of tool calls, executes them, and reports results.

> Add error handling to the fetchUser function in api.js
> Create a new file called utils.js with a debounce function
> Run the tests and show me which ones are failing

For tasks, you will see Claude's tool calls appear as it works. This is where Claude Code's power shows — it is actually doing the work, not just describing how to do it.

Reading Tool Calls in Real Time

When Claude executes a task, it shows you each tool call as it happens. This transparency is intentional — you can see exactly what Claude is doing to your project.

Here is what tool output looks like:

● Running tool: Read(/Users/you/project/api.js)

● Running tool: Edit(/Users/you/project/api.js)
  Replace: async function fetchUser(id) {
  With:    async function fetchUser(id) {
             if (!id) throw new Error('fetchUser: id is required')

● Running tool: Bash(node --version)
  > v20.11.0

Each line shows the tool name and its arguments. For Edit calls, you see what was replaced and what it was replaced with. For Bash calls, you see the command output.

Reading tool calls is how you stay in control. You know exactly what changed and why. If you see Claude about to do something you did not intend, you can press Ctrl+C to cancel mid-execution.

Permission Modes

Claude Code has two permission modes that control how much autonomy it operates with.

Default mode — Claude asks for confirmation before making file writes, running bash commands that modify state, or taking any action it considers risky. This is the safest mode and recommended for beginners. You review each action before it happens.

claude              # default mode

Bypass permissions mode — Claude auto-approves all actions without asking. Use this when you are in a sandboxed environment (like a Docker container), working on throwaway code, or after you have verified Claude's plan and want it to execute without interruption.

claude --dangerously-skip-permissions

There is also a middle ground: you can say "yes" or "no" to individual permission prompts during a session, which gives you fine-grained control without committing to full bypass mode.

Giving Claude Good Tasks

The specificity of your request directly impacts the quality of the result. Vague requests produce vague or incorrect implementations.

Vague: "Fix the bug." Specific: "The login form shows a blank screen when the email field is empty. Fix the validation in components/LoginForm.jsx so it shows an error message instead."

Vague: "Make it faster." Specific: "The loadDashboard() function in dashboard.js makes 5 sequential API calls. Convert them to run in parallel using Promise.all."

Vague: "Add a new feature." Specific: "Add a dark mode toggle button to the nav in Nav.jsx. Use a CSS class dark-mode on the body element, toggled via localStorage so the preference persists."

The pattern: describe what is broken or missing, where it lives, and what the correct behavior should be. Claude fills in the how.

The /clear Command

Context accumulates during a session. Every message, every tool output, every file Claude reads — it all stays in the context window. This is useful for continuity within a task but creates noise when you switch to something unrelated.

The /clear command resets the conversation context:

> /clear

Claude forgets the current session history. What persists:

  • Your CLAUDE.md files (Claude re-reads them)
  • Your actual files (Claude did not forget your codebase — it just forgets this conversation)
  • Your API key and settings

Use /clear when you finish one task and start a new, unrelated one. Think of it as clearing your whiteboard before starting a new problem — the codebase is still on your desk.

Your First Real Task

Here is a practical walkthrough of a first task. Create an empty project folder:

mkdir my-first-task
cd my-first-task
claude

In the Claude session, type:

Create a simple index.html file with a heading that says "Hello from Claude Code" and a paragraph explaining what Claude Code is in one sentence.

Watch the tool calls appear. Claude will use the Write tool to create index.html. When it finishes, you will see a summary of what it created.

Then iterate:

Add a basic CSS style block to that file: dark background (#0d1117), white text, centered content, and a monospace font.

Claude reads the file it just created, makes the targeted edit, and confirms. Open index.html in your browser to see the result.

That is the loop: describe → Claude acts → review → iterate. This is the core workflow you will use for every project in this track.

Lesson 42 Drill

Run a 10-minute session in a new empty directory. Complete these four tasks in sequence:

  1. Ask a question (no tool calls): "What is the difference between let, const, and var in JavaScript?"
  2. Give a file creation task: "Create a JavaScript file called greeting.js that exports a function which returns a personalized greeting string."
  3. Give an edit task: "Add a default parameter to the greeting function so it works even if no name is passed."
  4. Give a test run task: "Run node greeting.js with a quick inline test and show me the output."

Read the tool calls on each step. Notice which tools Claude uses for each type of task.

Bottom Line

A Claude Code session is an interactive loop in your terminal. Questions get explanations. Tasks get executed. Tool calls show you exactly what is happening to your files in real time. Default permission mode keeps you in control with prompts before impactful actions. /clear resets the conversation when you switch contexts.

Lesson 43 puts this into practice: building your first real web page from scratch.