Your First Project with Claude Code
This guide will walk you through your first Claude Code session, introducing core concepts and commands.
Starting a Session
-
Navigate to your project directory:
cd /path/to/your/project
-
Launch Claude Code:
claude
-
Generate a CLAUDE.md file (recommended): When prompted, choose "Yes" to generate a
CLAUDE.md
file. This file acts as project-specific instructions for Claude.
Essential Commands
Slash Commands
Claude Code supports several slash commands for quick actions:
/help
- List all available commands/model
- Select a different AI model (Sonnet, Opus, Haiku)/clear
- Clear the conversation context/permissions
- Manage tool permissions/context
- View current context usage/memory
- Manage CLAUDE.md files
Basic Tasks
Try these simple tasks to get familiar with Claude:
-
Read and summarize a file:
Read src/index.ts and summarize its purpose
-
Analyze code structure:
What is the overall architecture of this project?
-
Make a simple edit:
Add a comment to the top of README.md explaining this is a test project
Understanding Tool Permissions
Claude asks for permission before performing potentially dangerous actions. You'll see prompts like:
Claude wants to use Edit to modify src/config.js
Allow? [y/N/always/never]
y
- Allow this time onlyN
- Deny this requestalways
- Always allow this toolnever
- Never allow this tool
Start conservatively with permissions. Grant "always" access only after you're comfortable with Claude's behavior for specific tools.
Working with CLAUDE.md
The CLAUDE.md
file in your project root provides persistent instructions to Claude. Here's a basic example:
# Project Overview
This is a React application for task management.
## Coding Standards
- Use TypeScript for all new files
- Follow ESLint configuration
- Write tests for new features
## Key Commands
- `npm run dev` - Start development server
- `npm test` - Run tests
- `npm run build` - Build for production
## Important Notes
- Never modify files in the `vendor/` directory
- Always run tests before committing
Your First Workflow
Let's walk through a complete workflow:
-
Explore the codebase:
Can you explore the src directory and tell me what the main components are?
-
Plan a change:
I want to add a new "About" page to this app. What files would need to be modified?
-
Implement the change:
Please implement the About page we just discussed
-
Review and test:
Show me the changes you made and run any relevant tests
Tips for Success
1. Be Specific
Instead of vague requests, provide clear instructions:
- ❌ "Fix the bug"
- ✅ "Fix the TypeError in utils.js line 42 when user is null"
2. Use Context Wisely
Claude remembers your conversation, but long sessions can get cluttered:
- Use
/clear
when switching to unrelated tasks - Keep related work in the same session
3. Leverage Planning
For complex tasks, ask Claude to plan first:
Think about how to implement user authentication. Create a detailed plan before writing any code.
4. Verify Changes
Always review Claude's modifications:
Show me what changes you made to the database schema
Common Patterns
Reading Files
Read package.json and tell me what dependencies this project uses
Making Edits
Update the version number in package.json to 1.2.0
Running Commands
Run npm install and then npm run test
Git Operations
Create a git commit with the changes we just made
Next Steps
Now that you understand the basics:
- Explore Workflows for advanced patterns
- Learn about IDE Integrations
- Discover MCP Servers for extended capabilities
Remember: Claude Code is a powerful tool that improves with practice. Start with simple tasks and gradually tackle more complex challenges as you build confidence.