---
title: "Install Claude Code and give it a CLAUDE.md it reads every session"
description: "Install Claude Code, sign in, write a first CLAUDE.md, set up the project folder, connect Obsidian, and test that the context loads."
canonical: "https://scalewithsearch.com/articles/claude-code-setup-guide"
date: "2026-01-27"
modified: "2026-09-25"
---
## Site navigation

- [Scale With Search](https://scalewithsearch.com/)
- Real estate
  - Real estate
    - [Real estate](https://scalewithsearch.com/for/real-estate)
- Work
  - Start here
    - [Send your brief](https://scalewithsearch.com/work#send-your-brief)
    - [Prepare your six-question brief](https://scalewithsearch.com/work#prepare-your-six-question-brief)
  - Build
    - [Site build, content library with SEO, signal desk](https://scalewithsearch.com/work)
- For your business
  - Trades and home services
    - [Auto body and collision shops](https://scalewithsearch.com/for/auto-body-and-collision-shops)
    - [Foundation and home repair contractors](https://scalewithsearch.com/for/foundation-and-home-repair)
    - [Garage door and fencing contractors](https://scalewithsearch.com/for/garage-door-and-fencing-contractors)
    - [HVAC contractors](https://scalewithsearch.com/for/hvac-contractors)
    - [Janitorial and commercial cleaning companies](https://scalewithsearch.com/for/janitorial-and-commercial-cleaning)
    - [Locksmiths](https://scalewithsearch.com/for/locksmiths)
    - [Moving companies](https://scalewithsearch.com/for/moving-companies)
    - [Pest control companies](https://scalewithsearch.com/for/pest-control-companies)
    - [Plumbing and electrical contractors](https://scalewithsearch.com/for/plumbing-and-electrical-contractors)
    - [Restoration and water or fire damage companies](https://scalewithsearch.com/for/restoration-and-water-fire-damage)
    - [Roofing companies](https://scalewithsearch.com/for/roofing-companies)
    - [Towing companies](https://scalewithsearch.com/for/towing-companies)
    - [Tree services and landscaping companies](https://scalewithsearch.com/for/tree-services-and-landscaping)
    - [Solar installers](https://scalewithsearch.com/for/solar-installation)
    - [General contractors](https://scalewithsearch.com/for/general-contractors-and-construction)
    - [Paving, concrete, and flooring contractors](https://scalewithsearch.com/for/paving)
  - Practices and professional services
    - [Bookkeeping and tax practices](https://scalewithsearch.com/for/bookkeeping-and-tax-practices)
    - [Dental practices](https://scalewithsearch.com/for/dental-practices)
    - [Family and criminal defense law firms](https://scalewithsearch.com/for/family-and-criminal-defense-law-firms)
    - [Med spas and aesthetics practices](https://scalewithsearch.com/for/med-spas-and-aesthetics)
    - [Personal injury law firms](https://scalewithsearch.com/for/personal-injury-law-firms)
    - [Veterinary clinics](https://scalewithsearch.com/for/veterinary-clinics)
    - [Gyms and fitness studios](https://scalewithsearch.com/for/fitness)
    - [Therapy and outpatient health practices](https://scalewithsearch.com/for/therapy-and-outpatient-health)
    - [Medical billing companies](https://scalewithsearch.com/for/medical-billing)
    - [Insurance agencies](https://scalewithsearch.com/for/insurance-agencies)
    - [Financial advisors](https://scalewithsearch.com/for/financial-advisors)
    - [Property management companies](https://scalewithsearch.com/for/property-management)
    - [Recruiting and staffing agencies](https://scalewithsearch.com/for/recruiting-and-staffing)
    - [Architects and interior designers](https://scalewithsearch.com/for/architects-and-interior-designers)
    - [Logistics and supply chain companies](https://scalewithsearch.com/for/logistics-and-supply-chain)
  - Agencies, MSPs, and manufacturing
    - [IT and managed service providers](https://scalewithsearch.com/for/it-and-managed-service-providers)
    - [Machine shops and precision manufacturers](https://scalewithsearch.com/for/machine-shops-and-precision-manufacturing)
    - [Marketing agencies and freelancers](https://scalewithsearch.com/for/marketing-agencies-and-freelancers)
    - [SEO agencies and consultants](https://scalewithsearch.com/for/seo-agencies-and-consultants)
    - [Small manufacturers and fabricators](https://scalewithsearch.com/for/small-manufacturers-and-fabricators)
  - Restaurants, shops, studios, and nonprofits
    - [Restaurants and hospitality businesses](https://scalewithsearch.com/for/restaurants-and-hospitality)
    - [Retail stores and ecommerce sellers](https://scalewithsearch.com/for/retail-and-ecommerce)
    - [Photographers, event planners, and travel agents](https://scalewithsearch.com/for/photographers)
    - [Churches and nonprofits](https://scalewithsearch.com/for/churches-and-nonprofits)
  - [All industries](https://scalewithsearch.com/for/)
- Learn
  - For your office
    - [Office job guides](https://scalewithsearch.com/guides/)
    - [Browser calculators](https://scalewithsearch.com/tools/)
  - Start here
    - [How it works](https://scalewithsearch.com/how-it-works)
    - [Free Starter Kit](https://scalewithsearch.com/kit/business-memory-starter-kit.zip)
    - [Synthetic specimen](https://scalewithsearch.com/specimen/working-session-specimen.zip)
  - Guides
    - [The Complete Guide to Business Memory for AI Agents](https://scalewithsearch.com/articles/business-memory-for-ai-agents-guide)
    - [The Complete Small-Business Guide to AI Agent Governance](https://scalewithsearch.com/articles/ai-agent-governance-guide-small-business)
    - [The Complete Guide to Leaving Vendor AI Memory](https://scalewithsearch.com/articles/leaving-vendor-ai-memory-guide)
  - Articles by cluster
    - [Business memory](https://scalewithsearch.com/articles/business-memory-for-ai-agents-guide)
    - [Agent governance](https://scalewithsearch.com/articles/ai-agent-governance-guide-small-business)
    - [Migration and ownership](https://scalewithsearch.com/articles/leaving-vendor-ai-memory-guide)
  - For machines
    - [llms.txt](https://scalewithsearch.com/llms.txt)
    - [llms-full.txt](https://scalewithsearch.com/llms-full.txt)
    - [Machine view](https://scalewithsearch.com/?view=machine)
- Company
  - Evidence
    - [Proof](https://scalewithsearch.com/proof)
  - Company
    - [About](https://scalewithsearch.com/about)

# Install Claude Code and give it a CLAUDE.md it reads every session.

Claude Code runs in your terminal, not in a browser tab. It reads and writes files on your machine. That gives it two things a browser chat lacks. It has direct access to your project files. It also reads a configuration file, `CLAUDE.md`, at the start of each session. The file holds your preferences and context, so each session starts from them.

This guide covers the full setup in order. It starts with the requirements, the install, and sign-in. It then covers a first `CLAUDE.md`, the folder layout, an optional Obsidian connection, and a test that proves the context loaded. The install details below match the [Claude Code setup page](https://code.claude.com/docs/en/setup) as checked on 2026.09.25. The plan details date from January 2026. Check both before you start.

## Check the requirements

You need four things before you install:

- **A supported system.** macOS 13 or later, Windows 10 or later, or a current Linux such as Ubuntu 20.04 or later.
- **A paid Claude plan or an Anthropic Console account.** The free plan does not include Claude Code.
- **Terminal access.** Terminal on a Mac, Windows Terminal, or any Unix shell works.
- **A text editor.** VS Code, Cursor, or any editor can open the configuration files.

Choose between a plan and the API before you sign in. In January 2026, the Claude Pro and Claude Max plans included Claude Code within the plan's usage limits, with no per-token bill. Max cost more than Pro and allowed more use. API access bills per token, and long sessions make that route cost more than a plan for most daily users. Check current plan terms before you choose.

## Step 1: Install Claude Code

Open your terminal and run the native installer, which the documentation recommends. On macOS, Linux, or WSL:

```
curl -fsSL https://claude.ai/install.sh | bash
```

On Windows PowerShell, run `irm https://claude.ai/install.ps1 | iex`. Homebrew (`brew install --cask claude-code`) and WinGet (`winget install Anthropic.ClaudeCode`) also work. The npm package, `@anthropic-ai/claude-code`, is still available and needs Node.js 22 or later.

Confirm that the install worked:

```
claude --version
```

The command prints the version number. A native install updates itself in the background. Homebrew and WinGet installs need a manual upgrade. If npm gives a permission error, configure npm to use a global folder that your user owns. Do not use `sudo npm install -g`, because it causes permission and security problems.

## Step 2: Sign in

Start Claude Code with `claude`. On the first run, it opens a browser sign-in. Choose one of two account types:

1. A Claude account on a Pro, Max, Team, or Enterprise plan.
2. An Anthropic Console account, which bills API use per token.

If the `ANTHROPIC_API_KEY` environment variable is set, Claude Code asks once whether to use that key.

The sign-in persists between sessions. You sign in again only when you sign out or the credentials expire. Claude Code stores the credentials in your system keychain or credential manager.

## Step 3: Write the first CLAUDE.md

`CLAUDE.md` is a Markdown file in the project folder. Claude Code loads it at the start of each session and applies it for the whole conversation. Create the file with this outline:

```
# Project Context

## Who I Am
[Your role, company, relevant background]

## This Project
[What this codebase does, tech stack, conventions]

## My Preferences
- Code style: [your preferences]
- Communication: [terse, detailed, etc.]
- Error handling: [your approach]

## Current Focus
[What you're working on right now]
```

You can also run `/init` inside Claude Code. It scans the project and writes a first draft of the file with build commands and conventions. The draft covers the codebase, not you. The article on [where /init stops](/articles/claude-code-init-limitations) lists what to add.

Specific context gives specific output. "I prefer clean code" changes little. "Use TypeScript strict mode; return errors as values; never add a dependency without asking" changes each answer.

### Worked example: a first file for a business owner

A consultant who uses Claude Code for proposals and client reports might write this:

```
# Project Context

## Who I Am
Owner of a two-person marketing consultancy. I write proposals,
monthly client reports, and short articles.

## This Project
Client work folder. One subfolder per client. Each client folder
has brief.md (scope and contacts) and reports/ (past reports).

## My Preferences
- Plain English. Short paragraphs. No jargon.
- Cite the source file for every client fact.
- Draft only. Never send email or change files outside drafts/.

## Current Focus
October reports for three clients, due on the 5th.
```

The file is short. It names the owner, the folder layout, three working rules, and the current task. Keep business facts that change often, such as prices or client status, in separate files that the job reads. The [CLAUDE.md template for business context](/articles/claude-md-template-business-context) shows that split in full.

## Step 4: Organize the project folder

Claude Code works best in an organized folder:

```
project-root/
├── CLAUDE.md           # Main context file
├── .claude/
│   ├── hooks/          # Custom automation scripts
│   └── sessions/       # Session logs (optional)
├── docs/
│   └── context/        # Additional context files
└── [your project files]
```

The `.claude` folder keeps the Claude Code configuration apart from your project files. Hooks run your scripts at set points, such as session start, session stop, or when you submit a prompt. The `sessions/` folder is a custom convention for logs, not a built-in feature. Point to the files in `docs/context/` from `CLAUDE.md`, so each job reads the context it needs. The [minimum-context guide](/articles/what-context-should-an-agent-read) explains how to choose them.

## Step 5: Connect Obsidian (optional)

An Obsidian vault is a folder of Markdown files, so Claude Code can read it directly. With access, Claude Code can search, read, and update your notes, research, client records, and SOPs, in addition to the project files.

Do not start Claude Code at the root of a large vault. Give it one scoped business folder, deny the private paths, and widen access only when a job needs it. The guide to [connect Claude to Obsidian](/articles/connect-claude-obsidian-business-memory) covers the folder layout, permission rules, and search setup.

## Step 6: Test the setup

Start Claude Code in the project folder:

```
cd /path/to/your/project
claude
```

Ask a question that only the context in `CLAUDE.md` can answer. If the file names your tech stack, ask about a detail of that stack. In the business example above, ask, "What is due this week, and what may you not do?" A correct answer names the October reports and the draft-only rule.

Run `/memory` to see which memory files Claude Code loaded in this session. If the answer is generic, check these items:

- `CLAUDE.md` exists in the project folder or a parent folder.
- The file name is exactly `CLAUDE.md`, in capitals.
- The file is valid Markdown.
- You started Claude Code inside the project folder, not above it.

## Compare the setup with ChatGPT

This comparison reflects January 2026 product limits:

| Feature | Claude Code | ChatGPT |
|---|---|---|
| Stored context | `CLAUDE.md` file; no fixed size limit, but long files use context | Custom instructions, 1,500 characters per field |
| File access | Reads the local file system | Files you upload |
| Project structure | Reads the whole codebase | Uploads per conversation or project |
| Automation | Hooks, scripts, command-line runs | GPT Actions |

A long `CLAUDE.md` is allowed, but every line competes for the model's attention. Keep it concise and move detail into files that load when needed. The [ChatGPT and Claude memory comparison](/articles/chatgpt-vs-claude-memory-business) covers the memory features in depth.

## Fix common setup problems

**Permission denied during install.** Use the native installer, which needs no elevated rights. If you use npm, configure it to use a global folder that your user owns. Do not run the install with `sudo`.

**Sign-in fails.** Sign out, clear the stored credentials, and sign in again.

**CLAUDE.md does not load.** Claude Code reads `CLAUDE.md` from the working folder and from each parent folder above it. It does not read a file in a folder below the one where you started until it works in that folder. Start Claude Code in the project folder, and run `/memory` to confirm what loaded.

**Claude Code ignores a rule in the file.** First run `/memory` and confirm that the file loaded. Then rewrite the rule as one specific instruction, such as "Save drafts only in `drafts/`," in place of a general wish. Move the rule near the top of the file. A rule in `CLAUDE.md` is context, not enforcement. For a hard limit, add a deny rule to the permission settings in `.claude/settings.json`, so Claude Code cannot run the action at all.

## Grow the setup from use

The install is the foundation. Three additions come next:

- context files for each area of your work;
- hooks that automate routine tasks;
- a connection to the notes you already keep.

Start with a minimal `CLAUDE.md`. Add a line only when a session shows that Claude Code needed it. The best files grow from real sessions, not from a plan written before the first one.


## Related: AI memory

- [Stop Claude from forgetting your business between sessions with context files](/articles/claude-memory-problems)
- [Choose between Claude Projects and Claude Code by where your files live](/articles/claude-projects-vs-claude-code)
- [Understand Claude Code before you install it](/articles/what-is-claude-code)

----

```text
                  .|########||.                                       .|########||.                                       .|########||.
               |##||.      .||##|.                                 |##||.      .||##|.                                 |##||.      .||##|.
             |#|.              .|#|.                             |#|.              .|#|.                             |#|.              .|#|.
           |#|                    |#|                          |#|                    |#|                          |#|                    |#|
         .#|                        |#.                      .#|                        |#.                      .#|                        |#.
        .#.                          .#|                    .#.                          .#|                    .#.                          .#|
       |#.                            .#|                  |#.                            .#|                  |#.                            .#|
      |#             ......             #|                |#             ......             #|                |#             ......             #|
     .#           ||#########|           #|              .#           ||#########|           #|              .#           ||#########|           #|
    .#.         |######||######|.        .#.            .#.         |######||######|.        .#.            .#.         |######||######|.        .#.
    #.        .##|###|##|#|######|        .#            #.        .##|###|##|#|######|        .#            #.        .##|###|##|#|######|        .#
   ||        |##|#||||||||||||#||#|        ||          ||        |##|#||||||||||||#||#|        ||          ||        |##|#||||||||||||#||#|        ||
   #        |#||||||||||||||||||||#|        #.         #        |#||||||||||||||||||||#|        #.         #        |#||||||||||||||||||||#|        #.
  ||       |#||||||||||||||||||||||#|       ||        ||       |#||||||||||||||||||||||#|       ||        ||       |#||||||||||||||||||||||#|       ||
  #       .#||||||||||||||||||||||||#|       #        #       .#||||||||||||||||||||||||#|       #        #       .#||||||||||||||||||||||||#|       #
 ||   ....|||#||||||##|#|||#|#||##||||....|. ||      ||   ....|||#||||||##|#|||#|#||##||||....|. ||      ||   ....|||#||||||##|#|||#|#||##||||....|. ||
 #.  .  ....|#  ....#|||   ||| .#|||  ....#. .#      #.  .  ....|#  ....#|||   ||| .#|||  ....#. .#      #.  .  ....|#  ....#|||   ||| .#|||  ....#. .#
 #   .  ||||#| .#####||  . .#| .#|||  ||||#   #.     #   .  ||||#| .#####||  . .#| .#|||  ||||#   #.     #   .  ||||#| .#####||  . .#| .#|||  ||||#   #.
.|   |||||  #. |#|||||. ||  #. |#||. .|||||   ||    .|   |||||  #. |#|||||. ||  #. |#||. .|||||   ||    .|   |||||  #. |#|||||. ||  #. |#||. .|||||   ||
||   |....  #. ....|#.      |. ...|. ....||   ||    ||   |....  #. ....|#.      |. ...|. ....||   ||    ||   |....  #. ....|#.      |. ...|. ....||   ||
#.  .||||||##||||||##||####|||||||#||||||#|   .#    #.  .||||||##||||||##||####|||||||#||||||#|   .#    #.  .||||||##||||||##||####|||||||#||||||#|   .#
#    .||####|###########################|.     #    #    .||####|###########################|.     #    #    .||####|###########################|.     #
#      .#||||||.#.|| # |. ..# #| #|||||#|      #    #      .#||||||.#.|| # |. ..# #| #|||||#|      #    #      .#||||||.#.|| # |. ..# #| #|||||#|      #
#      .#|||||| ..  |# ## |#| ...#|#|||#|      #    #      .#|||||| ..  |# ## |#| ...#|#|||#|      #    #      .#|||||| ..  |# ## |#| ...#|#|||#|      #
#      .#|||#|# .# .#| #| ##|.#..#|||||#|      #    #      .#|||#|# .# .#| #| ##|.#..#|||||#|      #    #      .#|||#|# .# .#| #| ##|.#..#|||||#|      #
#      .#||||||############|######|||||#|      #    #      .#||||||############|######|||||#|      #    #      .#||||||############|######|||||#|      #
#   |...||#||||||#||||#|#||||||#|||||#||| |.|  #    #   |...||#||||||#||||#|#||||||#|||||#||| |.|  #    #   |...||#||||||#||||#|#||||||#|||||#||| |.|  #
#. .. ||||# .|||##|.  |#| .|| || .|||#. #|  # .#    #. .. ||||# .|||##|.  |#| .|| || .|||#. #|  # .#    #. .. ||||# .|||##|.  |#| .|| || .|||#. #|  # .#
|| |  ...||  ...##| |  #| .|. |. #####  .. .| ||    || |  ...||  ...##| |  #| .|. |. #####  .. .| ||    || |  ...||  ...##| |  #| .|. |. #####  .. .| ||
|| ||||| || ||||#|  .  |. |. |#. ||||| |#| || ||    || ||||| || ||||#|  .  |. |. |#. ||||| |#| || ||    || ||||| || ||||#|  .  |. |. |#. ||||| |#| || ||
.# |.....#|....|#.||||.|||##.|#|....||.#||.#. #.    .# |.....#|....|#.||||.|||##.|#|....||.#||.#. #.    .# |.....#|....|#.||||.|||##.|#|....||.#||.#. #.
 #.|||||||#############################| ||| .#      #.|||||||#############################| ||| .#      #.|||||||#############################| ||| .#
 ||       ##||#||#||||||#||#||#||#||##.      ||      ||       ##||#||#||||||#||#||#||#||##.      ||      ||       ##||#||#||||||#||#||#||#||##.      ||
  #       .#|||||||||#||#|||||||||||#|       #        #       .#|||||||||#||#|||||||||||#|       #        #       .#|||||||||#||#|||||||||||#|       #
  ||       |#||||||||||||||||||||||#|       ||        ||       |#||||||||||||||||||||||#|       ||        ||       |#||||||||||||||||||||||#|       ||
  .#        |#||||||||||||||||||||#|        #.        .#        |#||||||||||||||||||||#|        #.        .#        |#||||||||||||||||||||#|        #.
   ||        |#||||||||||||||||||#|        ||          ||        |#||||||||||||||||||#|        ||          ||        |#||||||||||||||||||#|        ||
    #.        .######|#|#########|        .#            #.        .######|#|#########|        .#            #.        .######|#|#########|        .#
    .#.         |#####||||#####|         .#.            .#.         |#####||||#####|         .#.            .#.         |#####||||#####|         .#.
     |#           ||########||           #.              |#           ||########||           #.              |#           ||########||           #.
      |#             ......             #|                |#             ......             #|                |#             ......             #|
       |#.                            .#|                  |#.                            .#|                  |#.                            .#|
        |#.                          .#.                    |#.                          .#.                    |#.                          .#.
         .#|                        |#.                      .#|                        |#.                      .#|                        |#.
           |#|                    |#|                          |#|                    |#|                          |#|                    |#|
            .|#|.              .|#|.                            .|#|.              .|#|.                            .|#|.              .|#|.
               |##||.      .||##|                                  |##||.      .||##|                                  |##||.      .||##|
                 .||########||.                                      .||########||.                                      .||########||.

Scale With Search  2026  [scalewithsearch.com](https://scalewithsearch.com)
```
