Claude Code Init: Project Setup Guide

Setting up Claude Code for a project takes about ten minutes but significantly improves future sessions. The process involves using /init to generate a CLAUDE.md file that captures your tech stack, commands, and conventions, which should be committed to git for team consistency.

Permissions can be configured through .claude/settings.json for team sharing and .claude/settings.local.json for personal overrides. Path-specific rules work well for monorepos with different stacks, while proper configuration ensures Claude understands your project from the first message and behaves consistently across the team.

Claude Code Project Setup. Proper Claude Code project setup makes every session faster. Learn to use /init, generate CLAUDE.md, configure path-specific rules, and set local preferences.

Claude Code Project Setup

Claude Code Project Setup: What You’ll Learn

In this guide to Claude Code Project Setup, you’ll work through practical, hands-on steps with real examples. Claude Code Project Setup is explained from the ground up so you can apply it immediately in your own projects.

Getting Claude Code working well on a project takes about ten minutes of setup. The payoff is that Claude understands your conventions from the first message, has the right permissions to do useful work, and behaves consistently for everyone on the team. This lesson walks through the setup steps in order.

Claude Code Init Command: Initializing Project Memory

Start with /init. Claude scans your codebase, reading package.json, existing docs, directory structure, then generates a CLAUDE.md that captures your tech stack, key commands, and initial conventions. Commit this file to git immediately so teammates get the same context.

A good CLAUDE.md is concise and specific. Aim for under 200 lines per file. Every line should be relevant to nearly every session. If something only matters for one feature, put it in a path-scoped rules file instead. The most valuable sections are: tech stack and versions, development commands (install, test, build, lint), naming conventions that aren’t obvious, and known gotchas that would trip up a new developer.

# Project: Payment Service

## Stack

- Node.js 20, TypeScript 5, PostgreSQL 15
- Express for API, Prisma for ORM, Jest for tests

## Commands

- `npm run dev`: start with hot reload
- `npm test`: run test suite
- `npm run migrate`: apply pending migrations
- `npm run lint`: ESLint + Prettier check

## Conventions

- All monetary values stored as integers (cents)
- Use `Result<T, E>` pattern for error handling, never throw in service layer
- Database columns: snake_case; TypeScript: camelCase

Configuring Permissions

Claude Code operates within a permission system that controls which tools it can use without asking. The default mode requires approval for most file writes and all bash commands. For active development, you’ll want to pre-approve common operations.

Open the permission manager with /permissions. Add patterns for the commands Claude will use repeatedly. Use Bash(git *) to allow all git commands, Bash(npm *) for npm, or Bash(npx jest *) for a specific tool. File operations can be scoped to specific paths.

Settings files control permissions at project and user level. .claude/settings.json is committed to git for the team. .claude/settings.local.json is git-ignored for personal overrides:

{
  "permissions": {
    "allow": [
      "Bash(git *)",
      "Bash(npm *)",
      "Bash(npx *)",
      "Read(**/*)",
      "Write(src/**/*)",
      "Edit(src/**/*)"
    ]
  }
}

For sensitive operations like production deploys, leave them requiring approval or use disable-model-invocation: true on skills so Claude can never trigger them automatically.

When a task needs files outside the project root (a sibling library, a shared types package, a generated bundle), use --add-dir at launch (or /add-dir mid-session) to extend Claude’s working directories for that session. Each path must exist as a directory and the flag only grants file access, not the rest of .claude/ configuration in that tree:

# Start a session with read/edit access in two sibling directories
claude --add-dir ../shared-types --add-dir ../design-tokens

To persist those directories across every session in the project instead of typing them each time, set permissions.additionalDirectories in .claude/settings.json. --add-dir is the temporary, per-session form of the same grant.

Security and Marketplace Restrictions

Use blockedMarketplaces to restrict which plugin marketplaces can be used. Entries support hostPattern to block by domain (e.g., "*.example.com") and pathPattern to block by repository path (e.g., "acme/corp-plugins"):

{
  "blockedMarketplaces": [
    { "hostPattern": "*.untrusted-domain.io" },
    { "pathPattern": "acme/corp-plugins" }
  ]
}

This is enforced at the policy level. Users cannot override it with local settings. Available in managed policy for enterprise deployments.

When writing plugin manifests for your project, note that monitors and themes are experimental and should be declared under experimental: {} rather than at the top level of plugin.json. Top-level declarations still work but claude plugin validate will warn, and a future release will require the nested form.

Settings and Environment

Settings follow this precedence from highest to lowest: (1) Managed settings (cannot be overridden by anything, including command-line arguments), (2) Command-line arguments, (3) Local (.claude/settings.local.json), which overrides project and user settings, (4) Project (.claude/settings.json), (5) User (~/.claude/settings.json). Local settings override project settings, not the reverse. Managed delivery can use platform policy files or managed configuration directories, but those are implementation details for the top managed layer rather than separate everyday scopes.

The native installer auto-updates in the background by default. Homebrew and WinGet installations do not auto-update by default. To opt in, set CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1. Claude Code will then run the package manager upgrade in the background when a new version is available and prompt you to restart on success.

To upgrade manually instead, run brew upgrade claude-code (or brew upgrade claude-code@latest) or winget upgrade Anthropic.ClaudeCode. You can control the release channel with the autoUpdatesChannel setting: "latest" (default) receives new features immediately, while "stable" uses a version about one week old that skips releases with major regressions. To disable auto-updates entirely, set DISABLE_UPDATES to "1" in your settings env block. This blocks all update paths including manual claude update. For a less strict option, DISABLE_AUTOUPDATER suppresses package manager update notifications only.

Beyond permissions, useful settings include env for environment variables that should be present in every session, agent to set a custom default agent, and claudeMdExcludes for filtering out irrelevant memory files in monorepos. You can also set the default model and effort level:

{
  "model": "claude-sonnet-4-6",
  "env": {
    "NODE_ENV": "development",
    "LOG_LEVEL": "debug"
  }
}

Add .claude/settings.local.json to your .gitignore so personal overrides stay personal. Share .claude/settings.json, CLAUDE.md, .claude/rules/, .claude/skills/, and optionally .claude/agents/ with the team via git. That gives teammates the same shared project instructions and project-scoped extensions, while personal settings and auto memory remain local to each machine.


Real-World Code Examples: Memory Configuration

Example 1: Project CLAUDE.md

A comprehensive project configuration file that defines architecture, standards, and conventions:

# Project Configuration

## Project Overview
- Name: E-commerce Platform
- Tech Stack: Node.js, PostgreSQL, React 18, Docker
- Team Size: 5 developers

## Architecture
@docs/architecture.md
@docs/api-standards.md
@docs/database-schema.md

## Development Standards

### Code Style
- Use Prettier for formatting
- Use ESLint with airbnb config
- Maximum line length: 100 characters

### Naming Conventions
- Files: kebab-case (user-controller.js)
- Classes: PascalCase (UserService)
- Functions/Variables: camelCase (getUserById)

### Git Workflow
- Branch names: feature/description or fix/description
- Commit messages: Follow conventional commits
- PR required before merge

Example 2: Personal CLAUDE.local.md (Not Committed to Git)

Personal preferences that stay local and are never shared with the team:

# My Development Preferences

## About Me
- Experience Level: 8 years full-stack development
- Preferred Languages: TypeScript, Python
- Communication Style: Direct, with examples

## Code Preferences

### Error Handling
I prefer explicit error handling with try-catch blocks.
Avoid generic errors. Always log errors for debugging.

### Testing
I prefer TDD (test-driven development).
Write tests first, then implementation.

### Architecture
I prefer modular, loosely-coupled design.
Use dependency injection for testability.

Example 3: Directory-Scoped Rules for src/api/

A CLAUDE.md file placed in src/api/ that overrides root settings for that directory:

# API Module Standards

This file overrides root CLAUDE.md for everything in /src/api/

### Request Validation
- Use Zod for schema validation
- Always validate input
- Return 400 with validation errors

### Authentication
- All endpoints require JWT token
- Token in Authorization header
- Token expires after 24 hours

### Response Format
{
  "success": true,
  "data": {},
  "timestamp": "2025-11-06T10:30:00Z",
  "version": "1.0"
}

### Rate Limiting
- 1000 requests per hour for authenticated users
- 100 requests per hour for public endpoints


What claude code init Writes to CLAUDE.md

When you run claude code init inside a project directory, it walks the repository, infers what it can about the stack, and writes a starter CLAUDE.md that captures the most useful context for future sessions. Understanding the shape of that generated file is what lets you turn a generic starter into a sharp project memory. The claude code init output is not meant to be the final word; it is a scaffold that gets better as you edit it.

The generated file typically contains five sections. First, a project overview sentence or two that claude code init drafts from the README and the top-level directory structure. Second, the build, test, and lint commands, which claude code init detects by looking for package.json scripts, a Makefile, Cargo targets, Gradle tasks, or similar entry points. Third, code-style notes inferred from any existing linter configuration. Fourth, architecture notes drawn from the layout of the source tree. Fifth, a placeholder area for conventions that claude code init cannot infer, which is where your edits add the most value.

What to keep and what to edit: the detected build and test commands are usually accurate and worth keeping as-is, because claude code init reads them straight from the manifest. The project overview is a starting point and almost always needs sharpening to reflect what the project actually does rather than what the directory layout suggests. The architecture notes are the section most likely to be wrong on a non-trivial codebase, because claude code init can see the file tree but not the design intent behind it; rewrite this section in your own words so future sessions inherit the right mental model.

The single highest-value edit after claude code init runs is to make the test command explicit and correct. Once the assistant knows exactly how to verify a change, it can run that command after every edit and hand you a result that is already checked, which is a large productivity gain for a one-line configuration.

claude code init vs a Hand-Written CLAUDE.md

claude code init is one way to create a CLAUDE.md, and a hand-written file is the other. The two are not in competition; they suit different moments. claude code init is best when you are new to a project and want a fast first draft of project memory without staring at a blank file. A hand-written CLAUDE.md is best when you already know the project deeply and can write the few rules that actually matter in five minutes, which is faster than reading and correcting a generated draft.

Re-running claude code init on a project that already has a CLAUDE.md is safe: it does not silently overwrite your edits. The claude code init flow detects an existing file and merges or prompts rather than clobbering, which means you can use it as a refresh tool when the project has changed significantly. If the merge is messy, the diff is reviewable in version control, and you keep the lines that still apply and discard the rest.

For a brand-new greenfield project, running claude code init once at the very start, then editing the result as the project takes shape, is a reliable rhythm. The generated scaffold gives the first few sessions enough context to be useful, and your incremental edits keep it honest as the codebase grows. For a large existing codebase, claude code init gives you a head start on the manifest-derived sections, and your job is to replace the inferred architecture notes with the real story.

Settings and Permissions Generated by claude code init

Alongside CLAUDE.md, claude code init may write or update a settings.json for the project that records allowed tools and a default permission mode. These files are the other half of project setup, because they decide which actions the assistant can take without asking each time. The claude code init defaults are conservative on purpose, which is the right starting point while you learn how the assistant behaves on your codebase.

The project settings.json is meant to be committed and shared with the team, while settings.local.json is the personal override file that is gitignored. After claude code init runs, move anything personal (a local path, a token reference, a tool only you use) into settings.local.json, and keep settings.json to the shared allow-list. This split is the same pattern as CLAUDE.md and CLAUDE.local.md, and it exists for the same reason: shared artifacts are reviewed; personal artifacts are not.

The allowed-tools list is where teams encode their trust boundary. A common shape after claude code init is to allow read operations and the project’s own build and test commands, while keeping file writes and network calls behind an approval prompt. As trust grows, you widen the allow-list; if something goes wrong, you narrow it again. Treating the allow-list as a living document, rather than a set-and-forget setting, is what keeps the workflow safe as the project evolves.

The default permission mode that claude code init writes is usually default, which prompts before destructive actions. Teams that want fewer prompts move to acceptEdits for routine work and reserve plan for anything non-trivial. The bypassPermissions mode exists but is almost never the right default; it removes the safety net entirely and should only be turned on for a throwaway sandbox.

Onboarding an Existing Codebase with claude code init

Onboarding is where claude code init earns its keep. The steps are simple but worth doing in order. First, cd into the repository root so claude code init sees the whole project. Second, run claude code init and let it generate the starter CLAUDE.md and settings. Third, read the generated file end to end, correcting the architecture notes and adding the conventions that claude code init cannot see. Fourth, commit the CLAUDE.md and the shared settings.json so the rest of the team inherits them.

For a large repository, claude code init on the root may produce a file that tries to cover too much. The fix is to scope: run claude code init from a subdirectory that represents one service or one area of the codebase, and let the directory-scoped CLAUDE.md handle just that part. This produces a sharper memory file than a root-level file that vaguely describes everything, because the assistant only loads the relevant scope when working in that directory.

Incremental enrichment is the realistic pattern for most teams. The first claude code init run gives a baseline. Each time someone corrects the assistant during a session, that correction is a candidate for a new line in CLAUDE.md. Over a few weeks, the file accumulates the conventions that actually matter, discovered through real work rather than guessed up front. This is the same philosophy as Auto Memory, but driven by deliberate edits rather than automatic capture.

Common claude code init Failures and Recovery

The most common claude code init failure is running it in the wrong directory. If you run claude code init in your home directory or in a folder with no project files, the generated CLAUDE.md is either empty or full of guesses that have nothing to do with any real codebase. The fix is to delete that file and re-run claude code init inside the actual project root. Checking pwd before you run claude code init is a one-second habit that prevents this entirely.

The second failure is a generated CLAUDE.md that is too generic to be useful. This usually means the project had no manifest claude code init could read, so the file is full of placeholders. Recovery is to treat that file as a template: delete the placeholders, write the few rules you actually care about (the test command, the commit style, the architecture summary), and commit the result. A short specific CLAUDE.md beats a long generic one every time.

The third failure, and the one with the widest blast radius, is accidentally committing settings.local.json or CLAUDE.local.md. Because these files hold personal overrides, they may contain local paths or tokens that should not be shared. The fix is preventative: after claude code init runs, add both filenames to .gitignore before your next commit. If one has already been committed, remove it from the index with git rm --cached, add it to .gitignore, and audit the history for anything sensitive that needs rotating.

The fourth failure is treating the generated file as read-only. claude code init produces a first draft; the value comes from editing it. A CLAUDE.md that has never been edited after its initial generation is usually a sign that no one has thought about what the assistant needs to know, which is exactly the question claude code init is meant to start, not finish.

How claude code init Adapts to Different Stacks

What claude code init writes depends on what it can detect, and detection is driven by the project’s manifest files. A Node.js project with a package.json produces a CLAUDE.md that lists the scripts claude code init found there, so npm run build, npm test, and npm run lint show up as the canonical commands. The generated file also notes the package manager if it detects pnpm, yarn, or bun lockfiles, which keeps the commands accurate for that specific workflow rather than defaulting to npm.

A Python project is handled similarly. claude code init looks for pyproject.toml, setup.py, requirements.txt, Pipfile, or Poetry and uv lockfiles, and drafts the test and lint commands from what it finds. Because Python packaging is more fragmented than Node’s, the manual edit step matters more here: if the project uses a Makefile target or a tox environment to run tests, claude code init may not infer that, and you should correct the test command so future sessions run the right thing the first time.

Go, Rust, and Java projects follow the same pattern against their own manifests. A Go module gives go build ./... and go test ./...; a Cargo workspace gives cargo build and cargo test; a Gradle project gives ./gradlew build and ./gradlew test. claude code init is good at surfacing these because the manifest is explicit, which is exactly the kind of structured input the generation step is built for.

For a monorepo with several stacks side by side, running claude code init at the root produces a file that tries to cover everything, which is usually too generic. The better move is to run claude code init from each service subdirectory, or to write the root CLAUDE.md by hand and let directory-scoped CLAUDE.md files handle the per-stack commands. The choice between these depends on how independent the services are; tightly coupled services often share a root file, while independent ones benefit from scoped files.

Across all of these, the value of claude code init is that it reads the manifest so you do not have to transcribe it. The value of the manual edit that follows is that you know which of the detected commands is the one the team actually runs, which test target is the fast one to use in a tight loop, and which lint rule is the one that has to pass before merge. claude code init gives the skeleton; you add the muscle.

Team Workflows Around claude code init

claude code init is a one-person action, but the CLAUDE.md it produces is a team artifact, so a little workflow design keeps it healthy. The first question is who runs claude code init first on a new project. Usually whoever sets up the repository, the same person who adds the README and the CI config, runs claude code init as part of that initial setup so the file exists from day one rather than being retrofitted later.

Once the file exists, every change to it goes through a pull request, just like a change to the build system would. Reviewing a CLAUDE.md diff is quick: does each new rule change behavior, is it specific, and does it duplicate an existing rule? A short PR description that says what changed and why is enough. Over time this review cadence builds a file the whole team trusts, because every line in it survived a review.

Keeping the file in sync with reality is the ongoing cost. The trigger to revisit it is any change to how the team builds, tests, or lints the project. When the build command changes, the line in CLAUDE.md that records it should change in the same PR. Treating the file as documentation that must track the build, rather than as a static README, is what prevents the most common claude code init failure mode: a file that was accurate on day one and wrong six months later.

Onboarding a new hire is where a well-maintained CLAUDE.md pays off. Instead of explaining the build and test commands verbally, you point them at the file, which means the information is consistent across everyone who joins. A short session pairing on the file, walking through what each section means and why, is a better use of an hour than answering the same questions repeatedly. This is the compounding return on the small upfront cost of running claude code init and maintaining its output.

When to Re-run claude code init

The first claude code init run is the obvious one, but re-running it on an existing project is sometimes the right move and sometimes a mistake. The guideline is to re-run claude code init when the project’s structure has changed enough that the generated file would be meaningfully different, and to edit by hand when only a rule or two is stale. Re-running to fix a single outdated line is overkill; re-running after a major refactor that renamed directories and swapped the build system is worth it.

The signals that warrant a re-run are structural: a new manifest file (a switch from npm to pnpm, or from pip to poetry), a reorganized source tree, or a new top-level module. Each of these changes what claude code init would detect, so the generated file would capture the new reality. After the re-run, the merge step is where you reconcile the new draft with the conventions you already wrote down; the goal is to keep your hand-edited rules and refresh only the detected commands and structure.

The signals that do not warrant a re-run are content-level: a new test was added, a function was renamed, a dependency was bumped. None of these change what claude code init detects in a way that matters, and editing the existing CLAUDE.md by hand is faster than re-running and re-merging. Treating claude code init as a refresh tool for structure rather than content keeps it useful without making it a chore.

A quarterly review is a good compromise for projects that change constantly. Every few months, read the CLAUDE.md end to end, ask whether claude code init run today would produce a meaningfully better file, and re-run it if the answer is yes. For most projects this check takes ten minutes and results in either a clean bill of health or a focused set of edits. The alternative, never re-running claude code init, works for a while and then produces a file that has drifted far enough from reality to be actively misleading.

Whatever cadence you settle on, the unit test for the file is whether a new session behaves the way the rules say it should. If a teammate runs claude code init on their machine, then starts a session, and the assistant does the right thing on the first try (runs the right test command, follows the right convention, knows where the entry point is), the CLAUDE.md is doing its job. If it does not, the file needs editing, not faith. claude code init gives the starting point; the ongoing quality of claude code init’s output is a function of the editing that follows.

claude code init and Permission Hygiene

The CLAUDE.md that claude code init writes gets most of the attention, but the settings file it touches is just as important to long-term safety. After claude code init runs, take ten minutes to review what landed in the project’s settings.json and settings.local.json, because those files decide which tool calls are auto-approved for everyone on the team. A permissive allow-list shipped by accident is harder to walk back than a tight one that is widened deliberately.

The hygiene pattern is to start tight and widen on evidence. Right after claude code init, the allow-list should cover only the operations the team has explicitly approved: reading files, running the project’s own build and test commands, and nothing else. Every widening, adding a new tool to the allow-list or moving a class of action to auto-approve, should be a deliberate decision backed by a reason. Claude Code workflows that follow this pattern stay safe as they grow; workflows that start permissive and try to tighten later rarely do.

The split between shared and local settings matters here too. claude code init may write defaults into both settings.json and settings.local.json, and the discipline is the same as for the memory files: shared settings are reviewed and committed, local settings are personal and gitignored. Auditing the two files after claude code init, and moving anything personal out of the shared file, prevents the most common settings mistake, which is a personal preference accidentally becoming a team rule.

A quarterly review of the allow-list is the settings equivalent of the CLAUDE.md pruning pass. Reading the allow-list end to end and asking, for each entry, whether it is still needed and still appropriately scoped, catches the slow drift where an overly-permissive entry was added for a one-off task and never removed. claude code init gives the starting configuration; keeping that configuration honest over time is what makes the permission model actually protect the team rather than sitting unused.

Pro Tips

  • Less is more in CLAUDE.md. Include only information relevant to EVERY session: project name, tech stack, essential commands, and non-obvious conventions. Keep it under 300 lines. Everything else goes in modular rules or @imports.
  • Use modular rules for path-specific overrides. Instead of one giant CLAUDE.md, create .claude/rules/*.md files with YAML paths frontmatter. This keeps context lean. Rules only load when you’re working in matching directories.
  • Never auto-generate CLAUDE.md. Craft it manually with careful consideration. Auto-generated files tend to be verbose, generic, and filled with low-value information that wastes context tokens.
  • Commit project memory to git. Your CLAUDE.md and .claude/rules/ should be version-controlled so the whole team benefits. Use CLAUDE.local.md (git-ignored) for personal project-specific preferences.
  • Use /team-onboarding to generate ramp-up guides. This built-in command inspects your CLAUDE.md, skills, and configuration to auto-produce an onboarding document, perfect for bringing new teammates up to speed quickly.

Hands-On Challenge: Onboard a Project with CLAUDE.md + Skills

Task: Set up a complete Claude Code project configuration: a well-crafted CLAUDE.md, a modular rules directory, and a project-specific skill, so a new teammate can be productive in minutes.

Steps

  1. Create a root CLAUDE.md with: project name, tech stack, essential dev commands (npm run dev, npm test, etc.), and 3-5 critical conventions
  2. Create .claude/rules/testing.md with path-specific rules using frontmatter: paths: ["tests/**/*.ts"] , e.g., “Use Jest, follow AAA pattern, mock external calls”
  3. Create .claude/rules/api.md with frontmatter paths: ["src/api/**/*.ts"] , e.g., “All endpoints require input validation and return a standard JSON envelope”
  4. Create a project skill at .claude/skills/onboarding/SKILL.md that generates a ramp-up guide by reading the project structure, CLAUDE.md, and available skills
  5. Run /onboarding to generate a teammate onboarding document, then verify it accurately reflects your project setup

Expected Outcome

A new developer running /onboarding should receive a comprehensive guide covering the project purpose, tech stack, development commands, coding conventions, available skills, and testing requirements, all derived from your configuration files.

Hint: Use the /team-onboarding built-in command (v2.1.101+) as a starting point. It inspects your CLAUDE.md, installed skills, and hooks to auto-generate a ramp-up guide. Customise the output by enriching your CLAUDE.md first.


Knowledge Check: Setting Up Your Claude Code Project

Test your understanding with these quiz questions. Try to answer each question before revealing the answer.

1. What does the /init command do?

  1. Initializes a new Claude Code project from scratch
  2. Generates a template CLAUDE.md based on your project structure
  3. Resets all memory to defaults
  4. Creates a new session

Correct Answer: B. /init analyzes your project and generates a template CLAUDE.md with suggested rules and standards. It is a one-time bootstrapping tool.

2. You want personal project preferences that are NOT committed to git. Which file should you use?

  1. ~/.claude/CLAUDE.md
  2. CLAUDE.local.md
  3. .claude/rules/personal.md
  4. .claude/memory/personal.md

Correct Answer: B. CLAUDE.local.md in the project root is for personal project-specific preferences. It should be git-ignored.

3. How do you scope a rule file to only apply to files in src/api/?

  1. Put the rule in src/api/CLAUDE.md
  2. Add paths: src/api/** YAML frontmatter to a .claude/rules/*.md file
  3. Name the file .claude/rules/api.md
  4. Use @scope: src/api in the rule file

Correct Answer: B. Files in .claude/rules/ support a paths: frontmatter field with glob patterns to scope rules to specific directories.

4. What is the maximum depth for @path/to/file imports in CLAUDE.md?

  1. 3 levels deep
  2. 5 levels deep
  3. 10 levels deep
  4. Unlimited

Correct Answer: B. The @import syntax supports recursive imports up to a maximum depth of 5 to prevent infinite loops.

5. You work across two repositories and want Claude to load CLAUDE.md from both. What flag do you use?

  1. --multi-repo
  2. --add-dir /path/to/other
  3. --include /path/to/other
  4. --merge-context /path/to/other

Correct Answer: B. The --add-dir flag loads CLAUDE.md from additional directories, allowing multi-repo context.

Test Your Knowledge

/5

Lesson 4 Quiz: Project Setup

Test your knowledge of setting up projects for Claude Code - configuration, CLAUDE.md, and best practices.

1 / 5

What should you include in CLAUDE.md for best results?

2 / 5

What is the recommended structure for organizing Claude Code configuration in a project?

3 / 5

What is the primary purpose of a CLAUDE.md file in your project root?

4 / 5

How do you scope rules to only apply to specific file paths?

5 / 5

Which file should be git-ignored for personal preferences?

Your score is

0%

Additional Resources

ResourceTypeLink
Claude Code: Memory DocumentationOfficial Docscode.claude.com/docs/en/memory
Claude Code: Skills DocumentationOfficial Docscode.claude.com/docs/en/skills
Claude Code: Settings & ConfigurationOfficial Docscode.claude.com/docs/en/settings
Agent Skills Architecture BlogBlogclaude.com: Agent Skills
Skills Repository (Ready-to-use)GitHubgithub.com/luongnv89/skills
Agent Skill Manager (ASM)GitHubgithub.com/luongnv89/asm

Do I have to set up every project from scratch?

No. Run the initialisation command to generate a starting file, then adjust it rather than writing everything by hand.

What is the single most useful thing to configure?

The build, test, and lint commands. With those recorded, the assistant can verify its own changes before handing them back.

How do monorepos work?

Use path-specific rules so each folder gets the right conventions without bloating the root configuration file.

Putting It All Together

A clean project setup pays for itself almost immediately. The few minutes you spend running the init command, recording your commands, and separating shared from personal configuration are repaid every single session in fewer corrections and faster, more reliable results.

The goal is a configuration that a new teammate could clone and use without asking questions. When the build, test, and lint commands are written down and the conventions live in version control, onboarding becomes a matter of cloning the repository rather than scheduling a walkthrough with whoever set things up first.

Claude Code Project Setup: Frequently Asked Questions

What does the claude code init command actually do?

It scans your project and generates a starting CLAUDE.md skeleton describing your stack and structure. That skeleton is a first draft, not a finished file, and usually needs editing before it reflects how your team actually works.

Should I use the generated CLAUDE.md file without editing it?

No. The raw output often includes generic boilerplate that does not match your real conventions. Treat it as a starting point, then trim and rewrite it so every line is something the assistant should genuinely follow.

What is the risk of skipping build, test, and lint command setup?

Without those commands recorded, the assistant cannot verify its own changes, which means every mistake has to be caught by hand instead of being flagged automatically after an edit.

How large should CLAUDE.md be before I split it up?

Once it grows past a few hundred lines, move path-specific conventions into .claude/rules/ instead of continuing to dump everything into the root file. A bloated file becomes harder for both you and the assistant to trust.

What happens if I accidentally commit settings.local.json?

It leaks personal preferences and machine-specific paths into the shared repository, so keep that file out of version control and double-check your .gitignore during initial setup.

Claude Code Project Setup gives you a solid, repeatable workflow. Bookmark this Claude Code Project Setup guide and revisit the steps whenever you need them.

Claude Code Project Setup key concepts

A Repeatable Setup Checklist

Treat a new project setup as a short, repeatable checklist so you never forget a step. Run the initialisation command, confirm the generated file describes the project accurately, then add the commands the assistant needs to build, test, and lint without asking you each time.

Next, decide what belongs in shared configuration versus your own machine. Conventions the whole team relies on go in the committed file; personal preferences and local paths stay in settings that are never pushed. This single decision prevents most of the friction teams hit when several people use the assistant on the same repository.

For larger repositories, lean on path-specific rules. A monorepo with a Python service in one folder and a TypeScript app in another can give each its own conventions without bloating the root file. The assistant then applies the right rules automatically based on which files it is working in.

Claude Code Project Setup: Common Mistakes to Avoid

A rushed claude code init pass causes more friction than it saves. These are the mistakes that show up most often once a project has been running Claude Code for a few weeks.

  • Accepting the raw output of claude code init without editing it. The generated CLAUDE.md is a starting draft, not a finished file, and often includes generic boilerplate that doesn’t match how the team actually works.
  • Letting CLAUDE.md grow past a few hundred lines by dumping every convention into the root file instead of moving path-specific rules into .claude/rules/.
  • Committing .claude/settings.local.json by accident, which leaks personal preferences and machine-specific paths into the shared repository.
  • Never recording build, test, and lint commands, which leaves Claude unable to verify its own changes and forces you to catch every mistake by hand.

Claude Code Project Setup: Best Practices

  • Run /init first to auto-generate a CLAUDE.md skeleton from your codebase.
  • Add the build, test, and lint commands so the assistant can verify its own work.
  • Set local preferences for anything personal so they never get committed.
  • Use path-specific configuration for monorepos with different stacks per folder.
  • Commit CLAUDE.md so the whole team shares the same project memory.
Claude Code Project Setup best practices