How to set up a new Claude Code project
Set up a new code project in Claude not difficult. Below are detailed instructions on how Set up the project in Claude Code.
Most Claude Code installation guides still advise users to run the ` commandnpm install`. However, that method is outdated. The native installer does not require Node.js, and the real setup work begins after installation. Configuration CLAUDE.mdskills and MCP server will turn a regular AI assistant into a “soulmate” that understands your source code.
The difference between the default setup and a properly configured setup in Claude is huge. With a good CLAUDE.md file and a few MCP servers, Claude will stop guessing about the project and start giving answers that match your source code. That setup only takes 15-20 minutes. This Claude Code tutorial will cover from installation to your first productive session.
How to install Claude Code
Install Claude Code using the original installer. Run
curl -fsSL
on macOS or Linux, or
irm
on Windows PowerShell. The npm method is no longer recommended. No longer needed Node.js. Once installed, run
claude --version
to verify, then open
claude
in any project folder to confirm the installation.
Installation takes about two minutes on all platforms:
- Run the original installer for your operating system:
- Verify installation:
- Authenticate on first launch by running the command
Claudein any folder. A browser window will open for OAuth login with your Claude Pro, Max, Team, or Enterprise subscription.
Note for Windows users: both WSL and native PowerShell work with Claude Code. If you are using Linux-based toolkits, WSL is a better choice as it fully supports Bash tool isolation. Native Windows needs Git Bash.
How to use Claude Code for beginners
Let’s start your first Claude Code session by navigating to the project directory and running the ` commandClaude`. Use the ` command/init` to create the file CLAUDE.md initially, then explore your source code before writing any code. Follow the Discover, Plan, Do, Commit process. Always ask Claude to describe its approach and wait for your approval before it starts making changes.
A productive session will follow this pattern:
- Navigate to your project and start a session:
-
**Run **/initto create the CLAUDE.md file. Claude will scan your project structure, identify file types, and create initial configuration. - Explore before you code. Ask Claude to explain the source code, summarize the architecture, or identify patterns. This helps it better understand your project.
- Use planning mode (Shift+Tab) to preview proposed changes before Claude makes them. This is “safety net” yours to consider what Claude plans to do.
- Anthropic’s best practices document recommends a Discover, Plan, Do, Commit process. Avoid jumping straight to the step “build me a feature” – build features. Let Claude understand your project first, propose a plan, then start implementing.
Commands to know from the beginning:
-
/help— shows all available commands -
/clear— restart the conversation without losing context CLAUDE.md -
/compact— compress the conversation to free up context window space -
/config— open your settings
What should the CLAUDE.md file include?
The CLAUDE.md file should include a project summary (one paragraph), the technologies you use, the build/test/lint commands, and important programming conventions, all within 60 to 80 lines. Use the WHY/WHAT/HOW framework: explain why the project exists, what it does, and how to work with it. Don’t include code style rules in CLAUDE.md at all and instead rely on code formatting and syntax checking tools.
CLAUDE.md is persistent memory. Claude reads it at the start of each session, so everything in this file shapes how Claude interacts with your code. Setting up this file correctly is more important than any other part of the Claude Code setup.
The WHY/WHAT/HOW framework gives you a clear structure:
WHY: What does the project do and what problem does it solve?
WHAT: Technology used, dependencies, project structure
HOW: Commands for building, testing, checking code, and verification steps
A template includes essential elements:
# Project: MyApp
Một API quản lý nhiệm vụ được xây dựng bằng Node.js và Express.
## Tech stack
- Node.js 20, Express 4, TypeScript
- PostgreSQL with Prisma ORM
- Jest for testing
## Commands
- `npm run dev` - Start dev server (port 3000)
- `npm test` - Run all tests
- `npm run test:watch` - Watch mode
- `npm run lint` - ESLint check
- `npm run build` - Production build
## Conventions
- Use async/await over raw promises
- Named exports preferred over defaults
- Error responses follow RFC 7807 format
For larger projects, use `@imports` to reference external documents. A line in CLAUDE.md like `@docs/api-conventions.md` tells Claude when to download the file. Input commands can be chained up to 5 levels, so you get information displayed gradually without overloading your original file.
Directory `.claude/rules/` allows you to create modular, themed rules. Each `.md` file in this directory is loaded as project storage. You can limit the scope of rules to specific file paths using a YAML header:
---
paths:
- "src/api/**/*.ts"
---
# Quy tắc API
- Tất cả endpoints phải bao gồm xác thực đầu vào
- Dùng định dạng phản hồi lỗi tiêu chuẩn
File CLAUDE.local.md used to store personal override settings for the project. It is automatically added to the file .gitignoreso your team will use the same CLAUDE.md file while each developer keeps their own preferences (sandbox URL, preferred test data, personal shortcuts) in the CLAUDE.local.md file.
Claude also automatically manages current memory ~/.claude/projects/
How to configure skill and slash commands
Create custom skills by adding files SKILL.md into the folder
.claude/skills/
in your project. Each file uses a YAML frontmatter to declare its description, allowed tools, and execution behavior. Skill system replaces method.
claude/commands/
older, although both still work. In addition to custom skills, Claude Code’s plugin ecosystem offers over 1,300 community-built skills you can use
Skill is how you teach Claude Code repeatable workflows. A skill is a folder containing a SKILL.md file with YAML frontmatter and markdown instructions.
A test debugging skill looks like this:
---
name: fix-tests
description: Phân tích và khắc phục các thử nghiệm lỗi trong dự án
allowed-tools: Read, Grep, Bash(npm test *)
---
Khi sửa lỗi các thử nghiệm:
1. Chạy bộ thử nghiệm để nhận diện lỗi
2. Đọc các tệp kiểm thử bị lỗi và mã mà chúng kiểm thử
3. Xác định xem lỗi nằm ở bài kiểm thử hay cách triển khai
4. Thực hiện các thay đổi tối thiểu để khắc phục sự cố
5. Chạy lại các bài kiểm thử để xác minh việc khắc phục
Tập trung vào: $ARGUMENTS
Please call the command
/fix-tests src/features/auth/
and Claude will run the entire process.
Claude loads skills sequentially. It just reads the name and description at the start of the session, then loads the entire skill content when you call it or when Claude determines it’s relevant. This keeps your context window compact.
The plugin ecosystem now has over 1,300 community-built skills across repositories like Claude Code Plugins and Claude Plugins Directory. You’ll find plugins for document lookup, browser automation, code analysis, and syntax checking. Take a look at what’s available and install the right plugin for your system.




Post Comment