---
title: "Write your stack into CLAUDE.md so AI code matches each project's conventions"
description: "Put personal stack defaults in a user-level CLAUDE.md and client rules in each repository's CLAUDE.md so Claude Code writes code in your conventions."
canonical: "https://scalewithsearch.com/articles/ai-for-web-developers"
date: "2026-01-28"
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)

# Write your stack into CLAUDE.md so AI code matches each project's conventions.

You are three hours into a build when the AI suggests Bootstrap. You do not use Bootstrap. You use Tailwind, and you have said so five times today.

Or it writes a React class component, when you have written function components with hooks for years. It does not know your ESLint rules. It does not know you prefer Zod over Yup. It does not know that one client's API uses snake_case and another's uses camelCase.

Each session starts from zero. The first ten minutes go to an explanation of your architecture.

## Why a generic assistant guesses

A fresh chat does not carry your last session. It does not carry the talk three days ago about your component library structure either.

Ask it to "add a form component," and it guesses from what most developers do, not from what you do. The result has the wrong pieces:

- CSS framework;
- state management library;
- file structure;
- naming conventions;
- TypeScript patterns;
- API integration pattern.

You spend more time on fixes than the code would take to write. The time saver becomes a time sink.

Without instructions, a coding assistant writes code from patterns across millions of repositories, not from your repository. It does not know why you chose Zustand over Redux, or why one client's contract requires a stricter accessibility level than another's.

The more projects you run, the worse it gets. With five client projects on five stacks, you get Next.js code for a Vue project and REST examples for a GraphQL API.

## What to write down

You need the assistant to know your stack before you ask. That means a written record of:

- preferred frameworks and libraries;
- component architecture patterns;
- naming conventions and file structure;
- TypeScript configuration and type patterns;
- client-specific requirements and limits;
- testing approach and tools;
- deployment pipeline and environments.

When you switch between a React storefront, a Vue dashboard, and a WordPress plugin in one day, you cannot re-teach the assistant each time.

## Put each rule where Claude Code loads it

Claude Code loads `CLAUDE.md` files at session start from two places that matter here. A user-level file at `~/.claude/CLAUDE.md` applies to every project on your machine. A project file at the repository root applies to that repository, and you can commit it so it travels with the code.

Put your personal defaults in the user-level file:

```text
## Stack defaults
Frontend: React 18+ (function components and hooks only),
  Tailwind CSS (no inline styles; @apply rarely), TypeScript strict mode,
  Zod for validation, TanStack Query for data fetching
Backend: Node.js + Express (not NestJS), Prisma, PostgreSQL, JWT auth
Conventions: PascalCase components, camelCase functions and variables,
  kebab-case file names, one component per file, tests next to components
Build: Vite unless the project says otherwise
```

Put client rules in each project's `CLAUDE.md`:

```text
## Client project rules (synthetic example)
Stack: Vue 3 with the Composition API, Pinia for state
API: snake_case; convert to camelCase at the API boundary only
Dates: API returns ISO 8601; convert to local time with date-fns
Browser support: see the browserslist entry in package.json
Accessibility: WCAG 2.2 AA for all forms
Design system: docs/design-system.pdf; use its color and spacing tokens only
Commands: npm run typecheck, npm test, npm run lint
```

Browser support belongs in the project's own configuration, not in a line from memory. Microsoft retired the Internet Explorer 11 desktop app on June 15, 2022, so an old "support IE11" note is a stale fact to remove.

[The business CLAUDE.md template](/articles/claude-md-template-business-context) shows the same split for non-code work. [Context file or CLAUDE.md](/articles/context-file-vs-claude-md-business-project) explains which rule belongs in which file.

## Before and after

A profile form. Before: you ask for a user profile form and get Material UI, which you do not use. Validation is inline instead of Zod. Data sits in local component state instead of your query layer. The API call uses fetch, not your configured axios instance with interceptors. You spend 20 minutes on a rewrite.

After: Claude Code reads both files. The form uses your Tailwind classes, your Zod schemas, your query mutations, and your axios instance. It follows your file structure and names. You run the type check and the tests, then commit.

A button in a client project. Before: you ask for a button and get generic React. You adapt it to Vue and then find it ignores the client's design tokens. After: you are in the client repository, so Claude Code reads that project's `CLAUDE.md`. The button is a Vue component that uses the design system's color variables and spacing scale.

A build error. Before: you paste an error into a chat. It suggests Webpack fixes for a Vite project, and Create React App fixes for a Next.js project. You lose 15 minutes to wrong answers. After: the project file names the build tool, so the first suggestion is for Vite.

## A week with the files

Monday morning. You start a new feature for a client and ask Claude Code to scaffold the user dashboard. It reads the project file: Vue 3 with the Composition API, Pinia for state, ISO dates converted with date-fns. It generates the component, the Pinia store, the API service file, the types, and the test file, all in your conventions. You review, change two lines, run the checks, and commit.

Wednesday afternoon. A different client, the same request. This repository's `CLAUDE.md` says React with TypeScript. Claude Code produces a different structure, because your React patterns differ from your Vue patterns. One assistant, two stacks, and no mix-up.

## Test the files from a cold start

A file helps only if the assistant applies it. Test each project file the way you would test a new teammate's onboarding notes.

1. Close all Claude Code sessions.
2. Start a new session at the repository root.
3. Ask for one small component, one API call, and one test.
4. Do not add any explanation during the test.
5. Run the lint, type check, and test commands.
6. Compare each result with the rules in both files.

The test passes when the output uses the right framework, naming, validation library, and API case conversion, and the checks pass. It fails when you must restate a convention. For each failure, add or fix the rule in the right file, then run the same three requests again. Keep the three requests in the project file, so you can rerun the test after each stack change.

## Measure the time you get back

Run the arithmetic on your own numbers. If each re-explanation costs 10 minutes and you do it six times a day, you lose an hour a day. That is five hours a week, or about twenty hours a month.

Check it for one week: count the sessions where you had to restate a convention before and after the files. The count also tells you which rule a file lacks.

## Enforce what matters with tools, not prose

`CLAUDE.md` is guidance. The model reads it and usually follows it, but a sentence is not a guarantee. Enforce the rules that matter with tools: ESLint and Prettier for style, `strict` in `tsconfig.json`, and tests and type checks in CI. Then put the check commands in the project file, and ask Claude Code to run them before it reports a task as done.

Other assistants have their own instruction files. GitHub Copilot reads `.github/copilot-instructions.md` in a repository, and Cursor reads project rules. The content can be the same; only the file location changes. [Claude Code versus Cursor project memory](/articles/claude-code-vs-cursor-project-memory) compares the two approaches.

Keep secrets out of every instruction file. API keys belong in environment variables and your secret manager. Claude Code sends the code and files it reads to Anthropic's servers during a session. Retention and training terms depend on your plan. Check each client contract for rules on third-party AI tools before you open that client's repository.

For large repositories, [Claude Code versus ChatGPT on a large codebase](/articles/claude-code-vs-chatgpt-large-codebase) shows how instruction files and discovery work on one bounded change.

----

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

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