Your First Conversation and the Permission System
Now that Claude Code is installed, it is time to have your first real conversation and understand the permission system that keeps you in control. The permission model is one of Claude Code's most important features, and understanding it early will make you more productive and more confident.
In this lesson, you will launch Claude Code in a project, have your first conversation, and learn exactly how the permission system works.
What You Will Learn
- How to start your first Claude Code session
- The structure of a Claude Code conversation
- How the permission system works and why it matters
- The four permission levels and what each allows
- How to configure permissions for your workflow
- Keyboard shortcuts and essential commands
Starting Your First Session
Open your terminal and navigate to any project directory. If you do not have a project handy, create a simple one:
mkdir ~/my-first-project
cd ~/my-first-project
npm init -y
Now launch Claude Code:
claude
You will see Claude Code's welcome message and a prompt where you can type. Claude Code automatically scans the current directory to understand your project structure.
Your First Prompt
Try something simple:
What files are in this project and what does each one do?
Claude Code reads your project files and gives you a summary. This is a "read-only" operation, so it does not ask for permission.
Now try something that requires action:
Create a file called hello.js that prints "Hello, World!" to the console
This time, Claude Code shows you what it plans to do and asks for your permission before creating the file. You will see the proposed file content and a prompt asking you to approve.
The Conversation Flow
Every Claude Code session is a conversation. You type natural language instructions, Claude Code responds with explanations and proposed actions, and you approve or reject those actions. Key things to understand:
- Context persists throughout the conversation. Claude Code remembers what you discussed and what files it has read.
- You can ask follow-up questions without repeating context. After creating that hello.js file, you could say "add error handling to it" and Claude Code knows exactly which file you mean.
- You can be as specific or vague as you want. "Fix the bug" works if Claude Code can figure out what bug you mean from context. "Fix the TypeError on line 42 of server.js" works too.
Understanding the Permission System
Claude Code's permission system exists for one reason: you should always know what Claude Code is doing and have the ability to stop it. Every action Claude Code takes falls into one of these categories:
Read-Only Actions (No Permission Needed)
These actions only observe your project without changing anything:
- Reading file contents
- Listing directory structures
- Searching through code with grep
- Analyzing code patterns and architecture
Claude Code performs these freely because they cannot modify your system.
Write Actions (Permission Required)
These actions modify files on your filesystem:
- Creating new files
- Editing existing files
- Deleting files
When Claude Code wants to write to a file, it shows you exactly what it plans to change. For edits to existing files, you see a diff showing the before and after. You can approve, reject, or ask Claude Code to modify its approach.
Shell Command Actions (Permission Required)
These actions execute commands in your terminal:
- Running build commands (
npm run build,cargo build) - Installing packages (
npm install express) - Running tests (
npm test,pytest) - Any other shell command
Claude Code shows you the exact command it wants to run before executing it. This is important because shell commands can have side effects like installing packages, modifying system files, or making network requests.
Sensitive Actions (Always Ask)
Some actions are considered especially sensitive and always require explicit permission, even if you have granted broader permissions:
- Pushing code to remote repositories
- Running commands that could affect files outside your project
- Making network requests to external services
- Deleting multiple files or directories
Permission Modes
Claude Code offers different permission modes to match your comfort level:
Default Mode (Ask Every Time)
In the default mode, Claude Code asks for permission before every write operation and every shell command. This is the safest option and is recommended when you are first getting started.
Trusted Mode (Auto-Approve Common Actions)
You can configure Claude Code to automatically approve certain types of actions. For example, you might auto-approve file edits but still require approval for shell commands.
To approve a specific tool for the current session, when Claude Code asks for permission you can choose "Allow for this session" instead of just "Yes". This means it will not ask again for that type of action during your current conversation.
The Allowed Tools Flag
For non-interactive use (like CI/CD pipelines or scripts), you can specify exactly which tools Claude Code may use:
claude -p "fix lint errors" --allowedTools "Edit,Write,Bash"
This grants Claude Code permission to edit files, write new files, and run bash commands without asking each time.
Configuring Default Permissions
You can set default permissions in your Claude Code settings so they persist across sessions:
claude config
This opens an interactive configuration where you can set which tools are auto-approved by default.
Essential Keyboard Shortcuts and Commands
While in a Claude Code session, these shortcuts help you work efficiently:
Escape -- Cancel the current operation or response. If Claude Code is generating a long response or running a command you want to stop, press Escape.
Ctrl+C -- Exit the current prompt. Press twice to exit Claude Code entirely.
Up Arrow -- Scroll through your previous prompts, just like in a terminal.
/ -- Access slash commands. Type / to see available commands like /help, /clear, /compact, and custom commands you have created.
Useful Built-In Commands
/help -- Show available commands and usage tips
/clear -- Clear the conversation and start fresh
/compact -- Compress the conversation to save context space
/cost -- Show token usage and estimated cost for this session
/memory -- View and manage Claude Code's memory entries
/permissions -- View and modify permission settings
The /compact command is especially useful for long sessions. It summarizes the conversation so far into a compressed form, freeing up context space for new work without losing important information.
Understanding Context and Token Limits
Claude Code has a context window, which is the amount of information it can hold in "working memory" during a conversation. Here is what you need to know:
- The context window is large (up to 1 million tokens with Opus 4.6), but it is not infinite
- Reading large files consumes context. If you ask Claude Code to read a 10,000-line file, that uses significant context space
- Long conversations accumulate context. Every message you send and every response Claude Code gives adds to the context
- Use /compact when context runs low. Claude Code tells you when you are approaching the limit, and
/compacthelps reclaim space
Tips for Managing Context
- Be specific about which files you want Claude Code to read rather than asking it to "read everything"
- Use
/clearto start fresh when switching to a completely different task - Break large tasks into separate conversations when possible
- Use
/compactperiodically during long sessions
Practice Exercise
Try this sequence to get comfortable with Claude Code:
- Navigate to a project directory and run
claude - Ask Claude Code to explain the project structure
- Ask it to create a new file (notice the permission prompt)
- Ask it to modify the file (notice the diff display)
- Try the
/helpcommand to see available options - Use
/compactto compress the conversation - Ask Claude Code to run a shell command like
ls -la(notice the command permission prompt)
This exercise gets you familiar with the conversation flow, permission prompts, and basic commands.
Key Takeaways
- Start Claude Code by running
claudein your project directory; it automatically scans your project for context - The conversation is persistent within a session, so Claude Code remembers previous context and you can ask follow-up questions
- The permission system has four levels: read-only (automatic), file writes (permission required), shell commands (permission required), and sensitive actions (always ask)
- You can auto-approve specific tools for the current session or configure default permissions for all sessions
- Essential commands include
/help,/clear,/compact(to reclaim context space), and/costto monitor usage - The context window is large (up to 1 million tokens) but not infinite; use
/compactand specific requests to manage it effectively

