How to Set Up Claude Code Properly, from Install to CLAUDE.md
Install Claude Code, write a CLAUDE.md that gives it real context, set permissions and learn the daily habits that make it reliable on real projects
Installing Claude Code takes about two minutes. Setting it up so it works like a colleague who knows your project takes a little longer, and that second part is where almost all the value is. I build my apps and websites with Claude Code every day, and the difference between a fresh install and a well set up project is enormous.
This guide covers both: the install, and the handful of settings and habits that make it reliable.
What you need
- A paid Claude plan (Pro, Max, Team or Enterprise) or a Claude Console account with API credits. Claude Code is not included in the free plan. Current options are on the pricing page.
- A Mac, Windows or Linux computer.
- A folder to work in. It can be an existing project or an empty folder for something new.
Step 1: Choose where you will use it
Claude Code runs in several places, and they all use the same account:
- Terminal. The most complete version, and the one the docs describe first.
- VS Code or Cursor. Open the Extensions view, search for "Claude Code" and install the one published by Anthropic. It gives you a chat panel, inline diffs and plan review inside your editor. See the VS Code docs.
- Desktop app. The Claude desktop app has a Code tab with visual diffs, parallel sessions and an app preview. Desktop docs.
If you have never used a terminal, the editor extension or the desktop app is a gentler start. You can switch later without losing anything.
Step 2: Install
For the terminal version, the native installer is the recommended route. On macOS, Linux or WSL:
curl -fsSL https://claude.ai/install.sh | bash
On Windows PowerShell:
irm https://claude.ai/install.ps1 | iex
If you prefer a package manager, brew install --cask claude-code on Mac and winget install Anthropic.ClaudeCode on Windows both work, but those versions do not update themselves. The native install does. Confirm it worked:
claude --version
Full details, including troubleshooting, are in the setup docs.
Step 3: Log in and open a project
cd path/to/your/project
claude
The first time, a browser window opens so you can sign in. After that you land in a session with the model and folder shown at the top. Start by asking questions before asking for changes:
what does this project do, and how is it organized?
This is the fastest way to see how Claude reads your code, and it gives you a feel for where it is confident and where it guesses.
Step 4: Give it your context with CLAUDE.md
A fresh session knows nothing about you or your project. It makes reasonable generic choices, and generic is rarely what you want. CLAUDE.md fixes that. Claude Code reads it at the start of every session.
Run this inside a project:
/init
Claude looks through your codebase and writes a starting CLAUDE.md with build commands and conventions it found. Then edit it and add what it could not discover on its own. Something like:
# Project
Marketing site for a small design studio. Static HTML and CSS, no framework.
# Commands
Run locally: npm run dev
Build: npm run build
# Rules
American English in all copy.
Never edit files in /vendor.
Ask before adding a new dependency.
Before saying a task is done, run the build and fix any errors.
A few things that are easy to miss:
~/.claude/CLAUDE.mdholds your personal preferences for every project../CLAUDE.mdin the project root is shared with your team through git.CLAUDE.local.mdis for personal notes on one project, and belongs in.gitignore.- Keep each file short. The docs suggest under 200 lines, because long files are followed less reliably.
- Run
/memoryto edit these files, and/contextto confirm they loaded.
The memory docs cover the full loading order.
Step 5: Decide how much it can do on its own
Claude Code asks before it runs risky actions. Press Shift+Tab to cycle permission modes during a session. The one I would learn first is plan mode: Claude reads and researches, then proposes a plan, and makes no edits until you approve it. You can also start a single task that way with /plan.
For rules that should always apply, run /permissions, or add them to .claude/settings.json. For example, to let it run your scripts freely but never push:
{
"permissions": {
"allow": ["Bash(npm run *)"],
"deny": ["Bash(git push *)", "Read(./.env)"]
}
}
The permission modes docs explain each mode.
Step 6: The daily habits that matter
- Plan before big changes. Explore, plan, then build. It catches wrong turns while they are still cheap.
- Give it a way to check its own work. A test, a build command, or a screenshot to compare against. Claude does much better when it can verify.
- Use
/clearbetween unrelated tasks. Old conversation left in context makes answers worse. Use/compactwhen you want to keep going but free up space. - Interrupt early. Press Esc the moment it heads the wrong way. Press Esc twice with an empty prompt, or run
/rewind, to go back to an earlier point. - Commit often. Ask it to commit after anything works. Git is your real undo button.
- Paste errors in full. The complete error message, plus "explain what went wrong," fixes most problems and teaches you along the way.
Step 7: Add the power tools only when you need them
You do not need any of these on day one. Add each one when a real need shows up.
- Skills. A repeated workflow saved as
.claude/skills/<name>/SKILL.md. Claude loads it when relevant, or you call it with/name. Skills docs. - MCP servers. Connections to other tools, for example
claude mcp add --transport http notion https://mcp.notion.com/mcp. MCP docs. - Hooks. Scripts that run automatically at set points, such as formatting after every edit. Unlike CLAUDE.md, they always run. Hooks guide.
- Subagents. Focused helpers with their own context, useful for research or review. Subagents docs.
- Plugins. Bundles of the above you install with
/plugin. Only install what you can read and trust.
Where to learn more
Anthropic's best practices page is the most useful single page on getting good results. If you prefer a course, Claude Code 101 and Claude Code in Action are free on Claude Academy.
Install it today, run /init in one real project, and spend ten minutes improving the CLAUDE.md it writes. Then build something small you actually need. The setup gets better every time you notice Claude guessing and write the answer down.