🏗️Practical

Project Setup & Init

How Claude Code observes, initializes, and integrates with a codebase.

Starting a Project with Claude Code

The first step when working with Claude Code on any project is initialization. Running the /init command makes Claude scan the repository, explore directory structures, read file contents, and generate reflections about the codebase. The result is a CLAUDE.md file that captures the project's architecture, tech stack, and essential commands.

bash
# Create a new Next.js project
npx create-next-app@latest

# Navigate into the project
cd my-project

# Start Claude Code and initialize
claude
> /init

What /init Produces

During initialization, Claude analyzes the repository structure, reads file contents, and creates a task list to process everything. Once complete, it generates a CLAUDE.md file containing:

  • Project goal and the business problem being solved
  • How to run the project (dev server, build, test commands)
  • Frameworks and major dependencies in use
  • Folder and directory structure overview
  • Architecture patterns and code organization

The Permission System

Claude Code operates with explicit permissions. Every file creation or edit triggers a permission prompt. This is a fundamental safety mechanism for agentic coding — unrestricted access can lead to unintended changes and bugs.

OptionBehavior
YesApprove this single action
Yes, don't ask again this sessionAuto-approve for this file/tool for the rest of the session
No, tell Claude what to do differentlyReject and redirect
⚠️Warning

Maintaining control over permissions ensures safer agentic workflows. Allowing unrestricted access can quickly lead to unintended file changes and bugs.

Running from an IDE

Most developers run Claude Code through an IDE integration like VS Code or Cursor. This setup allows you to work within the editor, view diffs clearly, and keep everything in one place. Claude Code can be installed as an extension directly from the slash menu.

Before you continue

We use analytics cookies to understand how the documentation is used and improve the experience. Privacy Policy.