What is Claude Code?
Claude Code is Anthropic's official command-line AI agent. While claude.ai is a browser chat interface, Claude Code runs directly inside your terminal — where your actual files, code, and tools live. It can read your entire project, write and edit files across multiple directories, execute shell commands, run tests, and autonomously complete multi-step tasks.
The difference is significant: claude.ai requires you to copy-paste code in and out. Claude Code works in your environment — it sees your actual codebase, understands your project structure, and can make changes end-to-end without you acting as an intermediary.
Full file access
Reads any file in your project. Understands your architecture before acting.
Runs commands
Executes terminal commands, tests, build scripts — with your permission.
Persistent memory
CLAUDE.md keeps project context alive across every session, every day.
Multi-file edits
Refactors across dozens of files simultaneously, with full context.
Agentic loops
Can work autonomously for hours on complex tasks without check-ins.
MCP integration
Connect to databases, APIs, browsers via Model Context Protocol.
Claude Code vs. claude.ai — side-by-side
| Capability | Claude Code (CLI) | claude.ai (Browser) |
|---|---|---|
| Reads your actual project files | Yes — full directory access | No — you must paste code in |
| Edits multiple files in one session | Yes — unlimited | No |
| Executes terminal commands | Yes — with permission prompts | No |
| Runs tests and build scripts | Yes | No |
| Persistent project memory (CLAUDE.md) | Yes | Limited (Projects feature) |
| Autonomous multi-step task execution | Yes | No |
| Custom hooks & automation | Yes — full hooks system | No |
| Slash commands & custom workflows | Yes — extensive | No |
| Works without a browser | Yes | No |
| No coding knowledge required | Basic terminal skills helpful | Yes |
Writers, researchers, analysts, marketers, and founders use Claude Code daily. Any work that involves files — documents, spreadsheets, scripts, data — can be dramatically accelerated. You don't need to write code to benefit from an agent that can operate on your files.
Installation: macOS, Linux & Windows
Claude Code is distributed as an npm package. You need Node.js 18 or higher installed first, then a single command installs the agent globally.
Step-by-step installation checklist
-
1
Install Node.js 18+ Download from nodejs.org (LTS recommended). After install, verify with
node --version— output should show v18 or higher. -
2
Install Claude Code globally Run the install command below. The
-gflag makesclaudeavailable from any directory. -
3
Authenticate your Anthropic account On first run, Claude Code opens a browser for OAuth login. You need a Claude Pro or higher subscription — the free tier does not support Claude Code.
-
4
Navigate to your project and launch
cdinto any project folder and typeclaudeto start your first session. -
5
Verify permissions Claude Code will ask for permission before running commands or editing files. Review and approve on first use.
macOS / Linux
# Install Node.js via Homebrew (macOS)
brew install node
# Or download from nodejs.org and run the installer
# Then verify:
node --version
# v20.11.0 (or similar — must be 18+)
# Install Claude Code globally
npm install -g @anthropic-ai/claude-code
# Verify install
claude --version
# Launch (first run will open browser for auth)
cd ~/my-project
claude
Terminal
Windows
# Install Node.js from nodejs.org — use the Windows installer
# Open PowerShell or Windows Terminal, verify:
node --version
# Install Claude Code
npm install -g @anthropic-ai/claude-code
# Launch from any project folder
cd C:\Users\YourName\my-project
claude
# Windows Subsystem for Linux (WSL) users: use the Linux commands above
# WSL provides the best experience on Windows
PowerShell
Claude Code does not work with a free Anthropic account. You need Claude Pro ($20/mo) at minimum. For daily usage, Pro Plus ($100/mo) or direct API access gives you much higher rate limits and won't hit context caps mid-session. Don't start an important work session on a restricted plan.
Troubleshooting common install issues
# Permission error on macOS/Linux (EACCES)
sudo npm install -g @anthropic-ai/claude-code
# Or fix npm permissions: https://docs.npmjs.com/resolving-eacces-permissions-errors
# "claude: command not found" after install
# Add npm global bin to your PATH:
echo 'export PATH="$(npm bin -g):$PATH"' >> ~/.zshrc
source ~/.zshrc
# Check which Node version is active
node --version
# If < 18, install Node via nvm (Node Version Manager):
nvm install 20 && nvm use 20
Terminal
Your first session — what to type, what to expect
After typing claude in your terminal, you'll see a prompt. Here's exactly what you should do in your first session.
What you'll see on first launch
$ claude
╭───────────────────────────────────────────╮
│ Claude Code v1.x.x │
│ Ready to help — type your request below │
╰───────────────────────────────────────────╯
Working directory: /Users/you/my-project
Files in context: 0 (type /init to scan project)
You:
Terminal
First things to type
Start with commands that get Claude oriented in your project. Here are the most useful openers for a first session:
# Scan and summarize your project structure
You: Summarize this project — what does it do, how is it structured, and what are the main files?
# Ask Claude to explain any file
You: Read README.md and tell me the top 3 things I should know to work in this codebase.
# Start a real task
You: Look at src/auth.py and add input validation to the login function. Write the tests too.
# Initialize Claude's memory
You: /init
# This creates a CLAUDE.md file with a project summary Claude generates itself
Claude Code Prompt
What Claude Code can do on day 1
- Read any file: "Read package.json and list all dependencies that are outdated."
- Write new files: "Create a Python script that scrapes my competitor's pricing page."
- Edit existing files: "In utils/helpers.js, refactor the three date formatting functions into one."
- Run commands: "Run the test suite and fix any failing tests." (requires permission approval)
- Search across files: "Find every place the old API endpoint /v1/users is called and replace with /v2/users."
- Explain code: "Explain how the authentication middleware works in this Express app."
- Generate content: "Based on PRODUCT.md, write a 500-word product description for the landing page."
The /init command causes Claude to scan your project and generate its own CLAUDE.md — a summary of what it found: architecture, key files, naming conventions, tech stack. This is a massive productivity shortcut. Run it first in any new project before typing your first real request.
Approving and denying tool use
When Claude wants to run a command or write to a file, it asks for permission. You'll see a prompt like:
Claude wants to run:
npm test -- --coverage
[A]llow once [T]rust always [D]eny [C]ancel
Permission Prompt
Use [T]rust always for safe, repeatable commands like npm test. Use [A]llow once for commands you want to review each time. Use [D]eny if you're not sure — Claude will work around it.
The CLAUDE.md file explained
CLAUDE.md is the single most important file in your Claude Code setup. It lives in the root of your project directory and is automatically read by Claude at the start of every session — without you having to paste anything or repeat yourself.
Think of it as the standing briefing you give a new team member on day one: here's what we're building, here's how we do things, here are the rules. Except Claude reads it every single session and never forgets. Learn more in our Claude Code Memory Guide.
What goes in CLAUDE.md?
- Project overview — What the project does, tech stack, architecture summary
- Coding conventions — Naming patterns, file organization, style guide rules
- Key commands — How to run the app, run tests, build for production
- Laws and guardrails — Rules Claude must follow before taking any action
- Data sources — Where to find important files, configs, or context
- Off-limits areas — Files Claude should never modify, APIs to never call in production
- Session startup instructions — What Claude should do first at the start of every session
A minimal CLAUDE.md example
# My SaaS App — Claude Instructions
## Project Overview
B2B subscription analytics platform. Django backend, React frontend.
Main codebase in /src. Tests in /tests. Infra configs in /deploy.
## Tech Stack
- Backend: Python 3.12, Django 5, PostgreSQL 16
- Frontend: React 18, TypeScript, Tailwind CSS
- API: REST + OpenAPI spec at /docs/api.yaml
- Auth: Auth0 (never touch auth/views.py without asking)
## Critical Rules
1. Never modify migrations directly — always run `python manage.py makemigrations`
2. Never hardcode secrets — use os.getenv() for all credentials
3. All new features must have tests before marking done
4. Run `pytest --fast` before any git commit
## Key Commands
- Run app: `docker-compose up`
- Run tests: `pytest tests/`
- Build frontend: `cd frontend && npm run build`
- Deploy staging: `./scripts/deploy.sh staging`
## Session Startup
On every session: read /brain/daily_context.md for today's priorities
and /brain/open_issues.md for known blockers.
CLAUDE.md
Don't write CLAUDE.md from scratch. Run /init in your first session and Claude will scan your project and generate a detailed starting template. Then edit and refine it over time. The best CLAUDE.md files grow organically — add a rule every time Claude does something wrong, and that mistake never recurs.
CLAUDE.md is hierarchical
You can have CLAUDE.md files at multiple levels. A CLAUDE.md in /src/api/ is automatically loaded when Claude is working in that subdirectory, layering on top of the root-level file. This is useful for giving different instructions to different parts of a monorepo. See our full CLAUDE.md Templates library for role-specific starting points.
The brain/ directory — persistent memory & task management
CLAUDE.md holds standing instructions. The brain/ directory holds living state — the things that change session to session: current priorities, task queues, accumulated knowledge, decisions made, and context that would overflow a single CLAUDE.md file.
This is a pattern, not a Claude Code feature — you create it yourself. But it's one of the highest-leverage setups you can build. Power users treat the brain/ directory as Claude's long-term memory. For the full picture, see our Claude Code Memory Guide.
A typical brain/ structure
brain/
├── session_startup.md # What Claude reads at the start of every session
├── daily_context.md # Today's priorities, blockers, goals
├── task_queue.json # Prioritized list of pending work items
├── open_issues.md # Known bugs, blockers, questions
├── decisions.md # Architecture decisions and why they were made
├── knowledge/
│ ├── api_notes.md # Notes on external APIs used
│ ├── vendor_quirks.md # Edge cases discovered in dependencies
│ └── performance.md # Performance findings and benchmarks
└── session_log.jsonl # Append-only log of what was done each session
Directory Structure
Reference brain/ files from CLAUDE.md
Add a session startup section to your CLAUDE.md that tells Claude to read the relevant brain files at the start of every session:
## Session Startup (MANDATORY — read before doing anything)
1. Read brain/session_startup.md for current context and locked decisions
2. Read brain/daily_context.md for today's priorities
3. Read brain/task_queue.json for the next 3 tasks to work on
4. Do NOT ask "what should I work on?" — check the queue
CLAUDE.md excerpt
After 30 days of daily sessions, your brain/ directory becomes an extraordinarily rich context that no fresh conversation can match. Every decision, every bug discovered, every insight from past sessions is available to every future session — automatically. This is how solo builders operate at team speed.
.claude/rules/ — modular rule files for projects & teams
While CLAUDE.md holds your main project instructions, the .claude/rules/ directory lets you organize rules into separate, focused files. This is especially useful for teams (each member can add their own rules), for large projects (rules split by domain), and for keeping rules versioned separately from code.
.claude/
├── settings.json # Claude Code configuration, hooks, permissions
├── settings.local.json # Local overrides (add to .gitignore)
└── rules/
├── testing.md # Rules for writing and running tests
├── api-design.md # API naming, versioning, error format conventions
├── security.md # Security rules — never commit secrets, never bypass auth
└── deployment.md # Deploy rules — staging first, no Friday pushes
Directory Structure
All .md files in .claude/rules/ are automatically included in Claude's context. You don't need to reference them from CLAUDE.md — Claude Code loads them automatically. Explore the full system in our Claude Code Context Guide.
A .claude/rules/ file example
# .claude/rules/security.md
## Security Rules (MANDATORY — applies to all code changes)
1. NEVER hardcode secrets, API keys, or passwords in any file
2. NEVER log sensitive user data (emails, passwords, PII)
3. All SQL queries must use parameterized queries — no string concatenation
4. Before any production deployment: verify CORS settings are restricted
5. All user inputs must be validated server-side before processing
6. Never disable SSL verification in HTTP clients, even for testing
.claude/rules/security.md
Rules in .claude/rules/ are committed to git and shared with your team. Personal preferences (your editor style, personal shortcuts) go in .claude/settings.local.json, which you add to .gitignore. This keeps team rules consistent without forcing personal preferences on everyone.
Essential commands: slash commands & keyboard shortcuts
Claude Code ships with a rich set of built-in slash commands and keyboard shortcuts. These are the ones you'll use every day. You can also create custom slash commands for your own workflows.
Built-in slash commands
| Command | What it does | When to use it |
|---|---|---|
| /init | Scan project and generate CLAUDE.md | First session in any project |
| /memory | Open and edit Claude's persistent memory files | Adding facts Claude should always remember |
| /clear | Clear the conversation context | Starting a new unrelated task in same session |
| /compact | Compress conversation history to save context | Long sessions before context limit |
| /cost | Show token usage and cost for this session | Monitoring spend on API-billed accounts |
| /doctor | Run diagnostics on your Claude Code install | Troubleshooting auth or config issues |
| /model | Switch between Claude models (Opus, Sonnet, Haiku) | Choosing power vs. speed vs. cost |
| /permissions | View and manage tool permission settings | Reviewing what Claude is allowed to run |
| /review | Ask Claude to review recent changes | Pre-commit quality check |
| /help | Show all available commands | Discovering what's available |
Keyboard shortcuts
| Shortcut | Action |
|---|---|
| Ctrl+C | Interrupt Claude mid-response or mid-task |
| Ctrl+L | Clear the terminal display (not conversation context) |
| ↑ / ↓ | Navigate prompt history |
| Ctrl+R | Search prompt history |
| Esc | Cancel current input without submitting |
Creating custom slash commands
You can create your own slash commands by adding markdown files to .claude/commands/. The filename becomes the command name.
# Create .claude/commands/deploy.md
# Invoked with: /deploy
Run the deployment checklist:
1. Run the full test suite: `pytest tests/ -v`
2. Check for any TODO: BEFORE DEPLOY comments in changed files
3. Run `python scripts/pre_deploy_check.py`
4. If all pass, stage changes with `git add -A` and show me a diff summary
5. Wait for my approval before committing
.claude/commands/deploy.md
# Now you can run:
You: /deploy
# Claude runs the full checklist automatically
Claude Code Prompt
5 mistakes every beginner makes (and how to fix them)
These are the patterns we see most often in beginners. Each one quietly kills productivity and is easy to fix once you know about it.
Mistake #1: Starting every session without a CLAUDE.md
New users paste context manually into each session — architecture notes, coding conventions, project background. This is exhausting and means Claude starts each session knowing nothing about your project. The context is gone the moment the session ends.
/init immediately in any new project. Then spend 15 minutes editing the generated CLAUDE.md to add your actual conventions. Every rule you add compounds over every future session.Mistake #2: Using vague requests instead of specific tasks
"Fix the bugs in my app" or "Make this better" produce vague, unfocused results. Claude works best when you define the exact scope, file, and expected outcome of a task.
src/api/users.py, the create_user function doesn't validate email format. Add validation that raises a ValueError with a clear message, and write a pytest test for it." Claude will nail it.Mistake #3: Never reviewing what Claude actually changed
Beginners often type "yes" to every permission prompt without reviewing what was changed. This leads to drift — the codebase diverges from what you think it is, and bugs sneak in.
git diff after every Claude session before committing. Add a rule to CLAUDE.md: "After any editing session, run git diff --stat and summarize all changes made." Claude will do this automatically at session end.Mistake #4: Ignoring the context window limit
Claude Code has a context window limit. In a long session working on a large codebase, you'll hit it — and Claude starts forgetting things it read earlier. Many beginners don't notice until Claude starts making contradictory changes.
/compact periodically in long sessions to compress conversation history. For very large projects, break work into focused sub-sessions with clear scopes. See our full Context Guide for strategies.Mistake #5: Building everything from scratch instead of using templates
Crafting an effective CLAUDE.md, a brain/ directory structure, rules files, hooks, and slash commands from scratch takes days of iteration. Most beginners spend weeks getting to a setup that Brainfile members get on day one.
Never run Claude Code as sudo or in a production environment on your first sessions. Claude can and will run terminal commands. Until you've built familiarity with permission prompts and your own rules file, run in a development environment only. Add an explicit rule to your CLAUDE.md: "NEVER run commands against the production database or deploy to production without explicit confirmation."
Get a pre-configured Brainfile OS for your profession
Instead of building your CLAUDE.md, brain/ directory, rules, hooks, and commands from scratch — get a complete, production-tested setup for your exact role. Engineers, analysts, founders, writers, and more.
Zero additional infrastructure. Works with your existing Claude subscription.
From beginner to power user in 30 days
Here's a realistic progression path based on how experienced Claude Code users actually developed their workflows. Most people try to do too much too fast — this path is deliberately sequential.
Install, authenticate, first real tasks
Get Claude Code running. Try 5 real tasks on an actual project — not toy examples. Run /init. Observe what Claude does and doesn't do well. Don't build infrastructure yet.
- Install and authenticate
- Run
/initon a real project - Complete 5 real tasks end-to-end
- Note 3 things you had to repeat twice
Build your first real CLAUDE.md
Edit the generated CLAUDE.md aggressively. Every time Claude does something wrong — wrong style, missed a convention, broke a rule — add a law to CLAUDE.md immediately. By day 7, Claude should feel like it knows your project.
- Add project architecture overview
- Add 5–10 explicit rules (what NOT to do)
- Add key commands (test, build, run)
- Add session startup instructions
Create your brain/ directory
Build the basic brain/ structure. Start with session_startup.md (today's priorities), open_issues.md (known bugs), and decisions.md (things you've decided). Reference these from CLAUDE.md's session startup instructions.
- Create
brain/session_startup.md - Create
brain/task_queue.json - Create
brain/open_issues.md - Wire them into CLAUDE.md startup
Add hooks and custom commands
Set up 2–3 hooks that automate things you're doing manually: auto-commit on session end, log session summaries, run lint on every file write. Add your first custom slash commands for recurring workflows. See the hooks guide.
- Add a Stop hook for session logging
- Create a
/reviewcustom command - Create a
/standupcommand for daily status - Add PreToolUse safety gates if needed
MCP servers, multi-agent, full autonomy
Connect Claude to external tools via MCP servers — databases, browsers, APIs. Run long autonomous sessions where Claude works through your entire task queue. Refine rules based on 3+ weeks of real use. At this point, Claude Code should feel like a genuine second brain for your work.
- Install 1–2 MCP servers relevant to your work
- Run a 2-hour autonomous session
- Prune and refine CLAUDE.md based on 3 weeks of data
- Identify what to systemize next
FAQ — 10 beginner questions answered
Claude Code itself is free — it's an open-source npm package. The cost is your Claude subscription. Claude Pro ($20/mo) is the minimum to use Claude Code. Claude Pro Plus ($100/mo) gives higher rate limits for daily professional use. Direct API access (pay-per-token) is best for heavy users who need predictable, uncapped throughput. There's no separate charge for the CLI.
claude.ai is a browser chat interface. Claude Code is a terminal agent. The key difference: Claude Code operates inside your environment — it reads your actual files, runs your commands, edits code across multiple files, and can work autonomously on long tasks. claude.ai requires you to copy-paste in and out. For anything involving real project work, Claude Code is dramatically more powerful.
No. Many Claude Code users are non-coders — founders, writers, researchers, analysts, operators. If you work with files, Claude Code can help. That said, basic terminal familiarity helps: knowing how to navigate directories (cd), run a command, and understand the difference between stdout and stderr will make you more effective. Most people with no terminal background pick up the basics in an hour.
Claude Code asks for permission before every potentially destructive action (file writes, command execution, deletions). You control what it can do. That said, treat it like any powerful tool: don't run it as root, keep a git repository so you can roll back, and add explicit "never touch X" rules to your CLAUDE.md for sensitive directories. The permission system is robust — Claude does not take actions you haven't approved.
Claude Code doesn't have native cross-session memory — each session starts fresh from the model's perspective. Persistence comes from files: your CLAUDE.md is read at session start. Your brain/ directory stores context you tell Claude to read. Your .claude/rules/ files are auto-loaded. Together, these create durable memory that's under your control. See our full Claude Code Memory Guide for strategies.
Claude Opus is the most powerful and thoughtful — best for complex architecture decisions, multi-file refactors, strategic analysis. Slower and more expensive. Claude Sonnet is the daily workhorse — fast, capable, cost-effective. Best for most coding, writing, and analysis tasks. Claude Haiku is fastest and cheapest — best for quick questions, file reads, simple edits. Switch models with /model in Claude Code.
Yes. Each project gets its own CLAUDE.md and brain/ directory. You launch Claude Code from the project directory (cd my-project && claude) and it automatically picks up that project's configuration. There's no global project management — the directory is the context.
Brainfile is the complete Claude Code OS for your profession. It's a pre-configured system of CLAUDE.md templates, brain/ directory structures, rule files, hooks, slash commands, and self-improvement loops — built for your specific role (software engineer, founder, data analyst, content creator, etc.). Instead of spending weeks building your setup from scratch, you get a production-tested system on day one. Try the free starter kit to see what a professional setup looks like.
Yes — they operate independently. Many teams use Cursor or Copilot for in-editor autocomplete and Claude Code for autonomous longer tasks (refactors, feature builds, research, analysis). They don't conflict. The CLAUDE.md and .claude/rules/ patterns are also fully compatible with Cursor's .cursorrules system — see our Cursor vs Claude Code comparison.
Update with: npm update -g @anthropic-ai/claude-code. Check your current version with claude --version. Anthropic releases updates frequently — new capabilities, model versions, and bug fixes. Subscribe to the Brainfile newsletter for a curated digest of the most important Claude Code updates each month.
The complete Claude Code OS
for your profession.
150+ role-specific templates: CLAUDE.md, brain/ directory, .claude/rules/ files, hooks, slash commands, and self-improvement loops. Pre-configured for engineers, founders, analysts, writers, and more. Updated monthly.
30-day money-back guarantee · Instant access · Cancel anytime
Works with your existing Claude subscription · Zero additional infrastructure
Team of 5+? Enterprise at $299/mo →