Best Way To Set Up Claude Code For New (2026)
Setting up Claude Code correctly from day one determines how effectively it assists throughout your project lifecycle. A well-configured project means Claude understands your stack, coding conventions, and project structure. resulting in higher-quality code with less iteration. This guide covers the practical steps to configure Claude Code for new projects.
Create Your CLAUDE.md File
The CLAUDE.md file serves as the primary configuration mechanism. Place it in your project root, and Claude automatically reads it when working in that directory. This file replaces the need for lengthy prompt explanations in every session.
Project Overview
- Project name: MyApp
- Type: Full-stack web application
- Stack: Next.js 14, PostgreSQL, Prisma, TypeScript
- Core functionality: E-commerce platform with real-time inventory
Development Guidelines
- Use functional components with TypeScript
- Prefer async/await over .then() chains
- All API routes go in /app/api/
Testing Requirements
- Minimum 80% code coverage
- Use Vitest for unit tests, Playwright for e2e
- Run tests before every commit
The file supports environment-specific sections. Add a .claude/ folder with context files for more complex setups, or reference external documentation that Claude should follow.
Install Essential Skills Immediately
Skills extend Claude’s capabilities for domain-specific tasks. For a new project, install these skills right after initialization:
The supermemory skill helps maintain persistent context across sessions. Rather than re-explaining your project architecture in every session, supermemory stores project knowledge and automatically provides relevant context when needed.
claude /skill install supermemory
The tdd skill enforces test-driven development workflows. When working on new features, invoke it to ensure tests are written before implementation:
/tdd write user authentication module
For frontend work, the frontend-design skill provides component design patterns and accessibility guidelines:
/frontend-design create login form component
The pdf skill proves valuable when generating project documentation, API docs, or technical specifications:
/pdf generate API documentation
Install additional skills based on your stack. A Python project benefits from data workflow skills; a Go project needs Go-specific patterns loaded.
Configure Project-Specific Settings
Beyond CLAUDE.md, several configuration options shape how Claude interacts with your project.
Allowed Directories
Restrict Claude’s file access to relevant directories. In your CLAUDE.md:
Allowed directories: /src, /tests, /config
This prevents accidental modifications to node_modules or other non-project files.
Execution Permissions
Define which commands Claude can run:
Allowed commands: npm, npx, git, docker, npm run
You can expand permissions as trust builds, but starting restrictive prevents unintended deployments or destructive operations.
Tool Restrictions
For sensitive projects, limit available tools:
Disabled tools: Bash(rm -rf), Edit(write_file)
Set Up Context Files
Large projects benefit from organized context files in a .claude/ directory:
.claude/
architecture.md # System design decisions
api-spec.md # API contracts and endpoints
database-schema.md # Database structure
coding-standards.md # Language-specific conventions
Reference these files in your CLAUDE.md to keep the root file clean:
See .claude/architecture.md for system design details.
Initialize Git Repository Early
Initialize git before writing significant code:
git init
git add .
git commit -m "Initial project structure"
This creates a clean baseline. Claude can then track changes, understand your version control workflow, and help with commit messages using conventional commits:
/conventional-commit create user login feature
Configure Environment Variables
Store environment variable templates in .env.example (never commit actual secrets). Document required variables in CLAUDE.md:
Environment variables required:
- DATABASE_URL: PostgreSQL connection string
- API_KEY: External service authentication
- NODE_ENV: development | production
Claude can then validate your .env file against requirements and flag missing variables before they cause runtime errors.
Project Structure Conventions
Establish clear directory organization from the start. Common patterns include:
src/
components/ # Reusable UI components
lib/ # Utility functions
services/ # Business logic
hooks/ # Custom React hooks
types/ # TypeScript definitions
tests/
unit/ # Unit tests
integration/ # Integration tests
e2e/ # End-to-end tests
Document your chosen structure in CLAUDE.md. Claude will then respect your organization when generating new files.
Enable Automatic Context Loading
With supermemory skill installed, configure it to automatically load project context:
claude /skill config supermemory --auto-load true
This means every new session starts withClaude understanding your project without manual context sharing. The skill maintains awareness of your tech stack, recent changes, and architectural decisions.
Using Claude Code for Initial Project Scaffolding
One of the highest-value uses of Claude Code at project start is automated scaffolding. Rather than manually creating directory structures, configuration files, and boilerplate, describe the project to Claude and let it generate everything.
A useful scaffolding prompt for a new API service:
Set up a Node.js REST API project with the following structure:
- Express with TypeScript
- PostgreSQL via Prisma
- Jest for testing
- ESLint + Prettier
- Docker Compose for local services
Create:
1. The directory structure per our CLAUDE.md standards
2. package.json with all dependencies
3. tsconfig.json configured for strict mode
4. A basic Express server in src/index.ts
5. A .env.example with all required variables
6. Docker Compose for PostgreSQL
7. Makefile with common commands
Claude Code generates all these files consistently and correctly. Review the output, make any adjustments to match your preferences, and commit the scaffold as your initial commit. This baseline becomes the reference point for all future Claude Code changes in the project.
For larger projects that will grow over time, ask Claude Code to also generate a decisions.md or ADR (Architecture Decision Records) directory from the start. Documenting architectural decisions as they’re made is much easier than reconstructing them later.
Verify Your Setup Works
After initial configuration, run a quick validation:
- Start a new Claude session in your project
- Ask: “What is this project’s tech stack?”
- Verify it reads your CLAUDE.md correctly
- Test a skill: “/tdd explain the testing workflow”
- Confirm environment variable awareness
If responses lack context, check your CLAUDE.md syntax and ensure it’s in the correct location.
Configuring Claude’s Permissions and Safety Boundaries
Part of setting up Claude Code for a new project is defining what it’s allowed to do. The default configuration is permissive, which is fine for solo projects with good version control. For shared repositories or production-adjacent work, adding explicit permission boundaries reduces the risk of unintended changes.
Add a settings.json to your .claude directory:
{
"permissions": {
"allow": [
"Bash(npm:*)",
"Bash(npx:*)",
"Bash(git log:*)",
"Bash(git diff:*)",
"Bash(git status:*)",
"Bash(git add:*)",
"Bash(git commit:*)",
"Read",
"Write",
"Edit"
],
"deny": [
"Bash(rm -rf:*)",
"Bash(git push --force:*)",
"Bash(git reset --hard:*)"
]
}
}
This allow/deny list lets Claude perform normal development tasks while blocking destructive operations that should require explicit human confirmation. Adjust as your project requires, a deployment script might legitimately need different permissions than a frontend development workflow.
The goal is not to be overly restrictive, but to make the permission model explicit so you know exactly what Claude can do without asking.
Writing CLAUDE.md for Team Onboarding
When multiple developers work on the same project, CLAUDE.md serves as the project’s AI onboarding document. A well-written CLAUDE.md eliminates the pattern where every developer has to re-explain project context to Claude at the start of each session.
A team-oriented CLAUDE.md goes beyond technical configuration:
Project: PaymentService API
Stack
- Node.js 22, TypeScript strict mode
- PostgreSQL 16 via Prisma ORM
- Redis for rate limiting and session storage
- Deployed on AWS ECS with RDS
Codebase Rules
- All database queries go through service layer (never direct Prisma in routes)
- Error handling uses our AppError class, not generic Error
- API responses use the APIResponse<T> wrapper type
- No `any` types. use `unknown` with type guards
Local Development
- Run `npm run dev` to start with hot reload
- `npm run db:seed` populates test data
- Redis must be running: `docker compose up redis`
Testing Standards
- Unit tests: Vitest, colocated with source files (*.test.ts)
- Integration tests: /tests/integration/, uses a separate test database
- Target: 80% line coverage, 100% coverage on payment-critical paths
Key Files
- /src/types/api.ts. All request/response types
- /src/services/payments.ts. Core payment processing, handle with care
- /src/middleware/auth.ts. Auth validation, changes require security review
Do Not Touch Without Team Discussion
- Database migrations (migration files are permanent)
- Any file in /src/services/payments.ts
- Environment variable names (referenced in multiple systems)
This level of detail means any developer (or any Claude session) understands not just the technology but the project-specific conventions that prevent bugs and maintain consistency.
Iterative Improvement
Your CLAUDE.md evolves with the project. Update it when:
- New dependencies are added
- Architecture decisions change
- Coding standards are revised
- Team members join (document their conventions)
A well-maintained CLAUDE.md compounds in value over time, making each subsequent session more productive than the last.
Try it: Paste your error into our Error Diagnostic for an instant fix.
Related Reading
- Claude Code Project Scaffolding Automation. Scaffold the project structure automatically
- Best Way to Write CLAUDE.md File for Your Project. CLAUDE.md setup is a critical first step
- Claude Code Environment Setup Automation. Automate your dev environment alongside Claude Code
- Claude Code for Beginners: Complete Getting Started Guide. The complete beginner’s reference
- Best Way To Scope Claude Code To A — Honest Review 2026
- Claude Code March 2026 Update: What Is New
- Claude Code and Linear AI for Project and Code Alignment
- Best Way To Get Claude Code To Explain — Honest Review 2026
- Best Way To Give Claude Code — Honest Review 2026
- Claude Code First Project Tutorial: Hello World
- Claude Code for Side Project to Startup Journey
- Best Way To Onboard New Developers — Honest Review 2026
Built by theluckystrike. More at zovo.one
Get started → Generate your project setup with our Project Starter.
Configure permissions → Build your settings with our Permission Configurator.