Starting a Session
Open your terminal, navigate to your project directory, and run:
claude
You'll see an interactive prompt like this:
╔══════════════════════════════════╗ ║ Claude Code · claude-sonnet ║ ╚══════════════════════════════════╝ > _
Claude Code is ready to receive instructions in natural language. You can write to it as if it were a coworker.
Your First Task
Try something simple to get started. Type:
> What files are in this directory?
Claude Code will run ls or find and show you the result. You'll notice that before running any tool, it asks for confirmation or shows you what it's about to do.
Understanding the Workflow
Claude Code operates in cycles of:
- Think — analyzes your request and plans the steps.
- Act — uses tools (read files, run commands, edit code).
- Show — presents the results and changes made.
- Wait — returns to waiting for your next instruction.
Operating Modes
Normal mode (default)
Claude Code asks for confirmation before editing files or running important commands. Ideal for getting started and maintaining control.
Auto mode
Claude completes tasks autonomously without asking for confirmation at each step. Useful when you trust the task and want speed:
claude --dangerously-skip-permissions
Plan mode
Type /plan before your request so Claude shows you the plan before executing anything. Ideal for complex tasks:
> /plan refactor the authentication module to use JWT
Examples of First Tasks
Understanding an Existing Project
> Explain this project's structure and what each folder does
> What does the processPayment function do in src/payments.ts?
Creating a New File
> Create a React component called Button with primary and secondary variants in TypeScript
Fixing an Error
> I have this error in the console: [paste the error] — help me fix it
Running Tests
> Run the tests and if there are failures, fix them
Exiting Claude Code
You can exit with Ctrl + C, Ctrl + D, or by typing:
> /exit
Starting with a Direct Prompt
If you know exactly what you want, you can pass it directly to the command without entering interactive mode:
claude "explain the package.json file" claude "add TypeScript types to the utils.js file"
"Print" mode (direct output)
To use Claude Code in scripts or pipelines:
claude -p "summarize the changes in this diff" < changes.diff
The -p flag makes Claude respond once and exit, ideal for automation.