Skip to main content

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​

  1. Navigate to your project directory:

    cd /path/to/your/project
  2. Launch Claude Code:

    claude
  3. 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:

  1. Read and summarize a file:

    Read src/index.ts and summarize its purpose
  2. Analyze code structure:

    What is the overall architecture of this project?
  3. 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 only
  • N - Deny this request
  • always - Always allow this tool
  • never - Never allow this tool
tip

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:

  1. Explore the codebase:

    Can you explore the src directory and tell me what the main components are?
  2. Plan a change:

    I want to add a new "About" page to this app. What files would need to be modified?
  3. Implement the change:

    Please implement the About page we just discussed
  4. 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:

  1. Explore Workflows for advanced patterns
  2. Learn about IDE Integrations
  3. 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.