Claude Code Setup
Set up Claude Code with your KitRocket project for AI-assisted development.
Claude Code is Anthropic's CLI tool for AI-assisted coding. KitRocket is built to work with it out of the box — your project includes a CLAUDE.md file that gives Claude full context about your codebase.
Install Claude Code
npm install -g @anthropic-ai/claude-code
Verify the installation:
claude --version
Set up your API key
Claude Code needs an Anthropic API key. Get one from console.anthropic.com.
The first time you run claude, it will prompt you to authenticate. Follow the instructions to link your account.
Alternatively, set the key as an environment variable:
export ANTHROPIC_API_KEY="sk-ant-your-api-key"
Add it to your shell profile (~/.zshrc or ~/.bashrc) so it persists:
echo 'export ANTHROPIC_API_KEY="sk-ant-your-api-key"' >> ~/.zshrc
source ~/.zshrc
Navigate to your project
cd my-saas
Start Claude Code
claude
When Claude starts, it automatically reads CLAUDE.md from your project root. This file tells Claude:
- Your tech stack (Next.js, Better Auth, DodoPayments, etc.)
- Your directory structure and file conventions
- Your coding standards and patterns
- Key files and their purposes
- Database schema and API routes
You don't need to explain your project. Claude already knows.
Verify it works
Test with a simple prompt:
What tech stack does this project use?
Claude should respond with details about Next.js, Better Auth, DodoPayments, Drizzle ORM, and the rest of your stack — all from reading CLAUDE.md.
Try a more practical test:
Show me the database schema for the users table.
Claude should navigate to src/db/schema/users.ts and show you the table definition.
Project structure awareness
Claude Code has filesystem access and can:
- Read any file in your project
- Create new files
- Edit existing files
- Run terminal commands (with your permission)
- Search across your codebase
Combined with the CLAUDE.md context, this means Claude can:
- Implement features that follow your existing patterns
- Fix bugs by tracing through your actual code
- Refactor code while maintaining conventions
- Write tests that match your testing setup
Using with Prompt Recipes
KitRocket includes 12 Prompt Recipes in the /prompts/ directory. These are structured prompts for common tasks:
# Implement a new feature
claude < prompts/implement.md
# Review code
claude < prompts/review.md
# Fix a bug
claude < prompts/fix-bug.md
See Prompt Recipes for the full list.
Recommended settings
For the best experience with KitRocket, consider these Claude Code settings:
Allow file operations
When Claude asks to create or edit files, review the changes and approve them. For trusted operations, you can configure auto-accept in ~/.claude.json.
Use extended thinking
For complex features, enable extended thinking. Claude will reason through the problem before writing code:
Think step by step. I want to add a team management system with roles and permissions.
Troubleshooting
"CLAUDE.md not found"
Make sure you're running claude from the project root directory — the one containing CLAUDE.md.
"API key not set"
Run claude and follow the authentication prompts, or set ANTHROPIC_API_KEY in your environment.
Claude doesn't know about recent changes
CLAUDE.md is read at the start of a session. If you've made significant changes to your project structure, update CLAUDE.md and start a new session.