Skip to content
Free Tool Arena

AI & LLMs · Guide · AI & Prompt Tools

How to Set Up Claude Code

Install Claude Code, configure permissions and CLAUDE.md, wire MCP servers, and use sub-agents and skills — the full working setup.

Updated April 2026 · 6 min read

Claude Code is Anthropic’s terminal-native coding agent. It reads your entire repo, edits files, runs commands, and drives git — all from natural language. Powered by Claude Opus 4.7 (released April 16, 2026), it’s the most capable autonomous coding agent you can actually use today, and in developer satisfaction surveys it sits at the top of the pack.

This guide covers installation, your first real session, sub-agents, skills, and the permission model — in that order. Assumes you’ve used a terminal before and have an Anthropic API key.

Advertisement

Step 1 — Install

Claude Code ships as an npm package. You need Node.js 18+.

npm install -g @anthropic-ai/claude-code

Then, from any project directory:

cd ~/code/my-project
claude

On first run it will ask you to log in (or paste an API key). A few IDE extensions wrap it — VS Code, JetBrains — but the terminal is the canonical surface; the wrappers just render the same session inline.

Step 2 — Your first session

Pick something real but bounded. Good first-session prompts:

  • “Summarise the architecture of this repo in 6 bullet points.”
  • “Find dead code in /src and list it with line numbers.”
  • “Add a unit test for the function in utils/date.ts.”

Don’t start with “refactor the whole app.” Claude Code is most reliable when the scope fits in a single PR’s worth of change. Large scopes should be decomposed — often into sub-agents, which we’ll cover in step 5.

Step 3 — Understand the permission model

Claude Code never runs a write command without your permission. You’ll see three prompts frequently:

  • File write — approve, reject, or “don’t ask for this file again” within the session.
  • Shell command — same, but with a preview of the exact command.
  • Tool use (web fetch, MCP tools) — approve or reject.

Resist the urge to “auto-approve everything.” Review mode slows you down for about three sessions, then becomes fast muscle memory. It’s also how you notice an agent about to delete the wrong directory, which is worth an hour of friction.

Step 4 — CLAUDE.md

In the root of your repo, create a CLAUDE.md file. This is a plain-text instruction set Claude Code reads at the start of every session. Put things in it that you wish every new dev on the team knew:

# Conventions
- TypeScript strict mode everywhere.
- Tests live next to the file: foo.ts -> foo.test.ts.
- Never commit .env files.
- Lint with 'npm run lint' before PR.

# This repo
- /app is Next.js app-router pages.
- /lib/pages.ts is the single manifest of every page.
- Changing that file triggers the full static build.

CLAUDE.md is how you get consistent behaviour across sessions without retyping the same context. It’s also the top lever for output quality — vague CLAUDE.md, vague agent.

Step 5 — Sub-agents

For tasks with multiple stages (e.g. “find this bug, fix it, write a test, write a changelog entry”), Claude Code can spawn sub-agents. Each sub-agent runs in its own context, does one thing, and returns a summary to the main agent. This is the single biggest quality-of-life feature for long tasks — it stops the main session’s context from getting cluttered with “what was in that file I read twenty minutes ago.”

Create sub-agent definitions in .claude/agents/ as Markdown files with a short system prompt and an allow-list. Claude Code picks them up automatically.

Step 6 — Skills

Skills are reusable “recipes” — folders under .claude/skills/ with a SKILL.md that tells the agent when and how to use the skill. Use them for repeatable artefacts: “when making a PR description, use this format,” “when writing release notes, do this.” Skills beat copy-pasting a prompt into a new session every time.

Step 7 — MCP servers

Claude Code supports MCP — the same Model Context Protocol covered in our MCP guide. Hook up a GitHub MCP to open PRs, a Linear MCP to read issues, a Postgres MCP to query your dev DB. Configure them in .claude/mcp.json and allow-list the tools you want.

Step 8 — Budget

Claude Opus 4.7 is the premium model; a long agentic session can run $5–$15 of spend. Set a monthly cap in the Anthropic console. If you want cheaper iteration, configure Claude Code to fall back to Sonnet for routine tasks and reserve Opus for the hard ones. Also run the stuff you paste into it through our token counter first so you have a baseline.

How to tell it’s working

Good signs: you approve most changes on first pass, tests still green after edits, PR sizes are boring and focused. Bad signs: lots of “let me try again,” files touched that shouldn’t have been, huge diffs. The fix is almost always a tighter CLAUDE.md and narrower scope, not a smarter model.

Pair Claude Code with an editor-based agent like Cursor for tight in-editor loops, and keep Claude Code for the heavy, multi-file, plan-and-execute work. The two complement each other — that’s the workflow most developers have settled on in 2026.