Claude Code CLAUDE.md vs settings.json: which one controls what (and why it matters)
Hi there, little friend! 👋
Imagine Claude is like a super-smart robot helper! 🤖
He has two special notebooks:
-
CLAUDE.mdis like Claude's "Idea Book" 🧠. You write down all your wishes and ideas for him, like "Please draw a blue car" or "Always be super friendly!" Claude tries his best to follow these ideas. -
settings.jsonis like Claude's "Rule Book" 🛑. This book tells Claude what he can and cannot do, no matter what! Like, "Never touch the hot stove!" or "Only play with safe toys!" He must follow these rules!
So, the Idea Book is for wishes, and the Rule Book is for super-important safety rules! Easy peasy! ✨
<h1> Claude Code CLAUDE.md vs settings.json: which one controls what (and why it matters) </h1> <p>If you've been using Claude Code for more than a week, you've probably edited both <code>CLAUDE.md</code> and <code>.claude/settings.json</code> — and at some point wondered: <em>which file should this go in?</em></p> <p>They look similar. They both configure Claude's behavior. But they control completely different things, and mixing them up leads to frustrating results.</p> <p>Here's the complete breakdown.</p> <h2> The mental model </h2> <p><strong>CLAUDE.md = Claude's brain</strong><br><br> <strong>settings.json = Claude's permissions</strong></p> <p><code>CLAUDE.md</code> is natural language. You write instructions, context, constraints, and preferences. Claude reads it like a colleague r
Claude Code CLAUDE.md vs settings.json: which one controls what (and why it matters)
If you've been using Claude Code for more than a week, you've probably edited both CLAUDE.md and .claude/settings.json — and at some point wondered: which file should this go in?
They look similar. They both configure Claude's behavior. But they control completely different things, and mixing them up leads to frustrating results.
Here's the complete breakdown.
The mental model
CLAUDE.md = Claude's brain
settings.json = Claude's permissions
CLAUDE.md is natural language. You write instructions, context, constraints, and preferences. Claude reads it like a colleague reads a briefing doc.
settings.json is machine config. It controls what tools Claude is allowed to use, what commands it can run, what it's blocked from doing.
What CLAUDE.md controls
# Project context This is a Next.js 14 app using Prisma + PostgreSQL.# Project context This is a Next.js 14 app using Prisma + PostgreSQL.Architecture decisions
- All API routes live in /app/api/
- Database models are in /prisma/schema.prisma
- Never create new /pages/ routes — we're on App Router
Code style
- TypeScript strict mode always on
- Prefer async/await over .then() chains
- Use Zod for all input validation
Response format
- Give me code first, explanation after
- Skip obvious comments — I can read the code
- When suggesting a fix, show the before AND after`
Enter fullscreen mode
Exit fullscreen mode
Things that belong in CLAUDE.md:
-
Tech stack and architecture
-
Coding conventions and style preferences
-
Business domain context (what the app does, who uses it)
-
Response format preferences
-
Things to always/never do
-
Commands to run for common tasks
What settings.json controls
{ "permissions": { "allow": [ "Bash(npm run *)", "Bash(git add:*)", "Bash(git commit:*)", "Bash(cat:*)", "Bash(grep:*)", "Bash(find:*)" ], "deny": [ "Bash(rm -rf *)", "Bash(git push:*)", "Bash(curl:*)", "WebFetch" ] } }{ "permissions": { "allow": [ "Bash(npm run *)", "Bash(git add:*)", "Bash(git commit:*)", "Bash(cat:*)", "Bash(grep:*)", "Bash(find:*)" ], "deny": [ "Bash(rm -rf *)", "Bash(git push:*)", "Bash(curl:*)", "WebFetch" ] } }Enter fullscreen mode
Exit fullscreen mode
Things that belong in settings.json:
-
Which bash commands Claude can run without asking
-
Which tools are blocked entirely
-
Auto-approve settings for trusted operations
-
Model preferences (if you're on Pro)
The key difference: CLAUDE.md is read, settings.json is enforced
Claude can choose to ignore something in CLAUDE.md if it thinks it knows better. (It shouldn't, but it can.) Settings.json is a hard fence — Claude literally cannot execute a command that's in the deny list.
This is why:
-
Style preferences go in CLAUDE.md — you want Claude to understand and apply them, not be mechanically blocked
-
Safety constraints go in settings.json — you want actual enforcement, not suggestions
Real-world example: preventing accidental deploys
Wrong approach — putting it in CLAUDE.md:
# IMPORTANT Never run # IMPORTANT Never run or deployment commands without asking me first.Enter fullscreen mode
Exit fullscreen mode
Claude will try to follow this. But if it's confident a push is needed, it might do it anyway.
Right approach — settings.json:
{ "permissions": { "deny": [ "Bash(git push:*)", "Bash(npm run deploy:*)", "Bash(vercel:*)" ] } }{ "permissions": { "deny": [ "Bash(git push:*)", "Bash(npm run deploy:*)", "Bash(vercel:*)" ] } }Enter fullscreen mode
Exit fullscreen mode
Now it's impossible, not just discouraged.
Real-world example: project conventions
Wrong approach — trying to encode this in settings.json: You can't. Settings.json doesn't support natural language rules.
Right approach — CLAUDE.md:
# Database conventions
- All new tables need a
created_atandupdated_atcolumn - Foreign key names: {table}_{column}_fkey
- Always use UUIDs for primary keys, never auto-increment integers
- Migrations live in /prisma/migrations/ �� never edit them by hand`
Enter fullscreen mode
Exit fullscreen mode
Claude reads this, understands it, and applies it when writing schema changes.
The inheritance question
Both files support inheritance — but differently.
CLAUDE.md inheritance (directory-based):
~/.claude/CLAUDE.md # global rules for all projects /project/CLAUDE.md # project rules /project/src/api/CLAUDE.md # subdirectory rules~/.claude/CLAUDE.md # global rules for all projects /project/CLAUDE.md # project rules /project/src/api/CLAUDE.md # subdirectory rulesEnter fullscreen mode
Exit fullscreen mode
All three are read and merged, with deeper files taking precedence.
settings.json inheritance (also directory-based):
~/.claude/settings.json # global permissions /project/.claude/settings.json # project permissions~/.claude/settings.json # global permissions /project/.claude/settings.json # project permissionsEnter fullscreen mode
Exit fullscreen mode
Permissions merge — if global denies git push but project allows it, the project setting wins.
My combined setup
Here's what my two files look like on a typical project:
CLAUDE.md:
# Stack Node.js 20, Express 5, PostgreSQL 16, Redis# Stack Node.js 20, Express 5, PostgreSQL 16, RedisRules
- Tests live in /test/ mirroring /src/ structure
- All routes must have input validation (Zod)
- Log with winston, never console.log in production code
- Environment variables always via process.env, never hardcoded
Workflow
- After any schema change, remind me to run migrations
- When creating a new API endpoint, scaffold test file too
- Prefer small focused functions over large ones
Response style
- Code first, then brief explanation
- If you see a related issue while fixing something, mention it but don't fix it unless I ask`
Enter fullscreen mode
Exit fullscreen mode
.claude/settings.json:
{ "permissions": { "allow": [ "Bash(npm run test:*)", "Bash(npm run lint:*)", "Bash(npm install:*)", "Bash(git status:)", "Bash(git diff:*)", "Bash(cat:*)", "Bash(ls:*)", "Bash(grep:*)" ], "deny": [ "Bash(git push:*)", "Bash(rm -rf:*)", "Bash(DROP TABLE:*)" ] } }{ "permissions": { "allow": [ "Bash(npm run test:*)", "Bash(npm run lint:*)", "Bash(npm install:*)", "Bash(git status:)", "Bash(git diff:*)", "Bash(cat:*)", "Bash(ls:*)", "Bash(grep:*)" ], "deny": [ "Bash(git push:*)", "Bash(rm -rf:*)", "Bash(DROP TABLE:*)" ] } }Enter fullscreen mode
Exit fullscreen mode
Quick reference
What you want File
Coding style rules CLAUDE.md
Architecture context CLAUDE.md
Domain knowledge CLAUDE.md
Response format preferences CLAUDE.md
Block dangerous commands settings.json
Auto-approve safe commands settings.json
Prevent git push settings.json
Project tech stack info CLAUDE.md
Tool restrictions settings.json
One more thing: the API alternative
If you're using Claude Code heavily, you've probably noticed the rate limits. One thing that helps: routing Claude Code through a direct API endpoint instead of Anthropic's consumer tier.
The ANTHROPIC_BASE_URL environment variable lets you point Claude Code at any compatible endpoint:
export ANTHROPIC_BASE_URL=https://simplylouie.com/api
Enter fullscreen mode
Exit fullscreen mode
SimplyLouie runs a flat-rate Claude API proxy at $2/month — same claude-3-5-sonnet-20241022 model, no per-token billing, no rate limit anxiety. If you're doing serious Claude Code work, the math tends to favor flat-rate.
The CLAUDE.md vs settings.json confusion trips up a lot of Claude Code users. Once you have the mental model — brain vs fence — the right file for each thing becomes obvious.
What's in your CLAUDE.md that probably shouldn't be? Drop it in the comments.
DEV Community
https://dev.to/subprime2010/claude-code-claudemd-vs-settingsjson-which-one-controls-what-and-why-it-matters-10i3Sign in to highlight and annotate this article

Conversation starters
Daily AI Digest
Get the top 5 AI stories delivered to your inbox every morning.
More about
claudemodelupdate
China cuts cost of military-grade infrared chips to as little as a few dozen USD
A research team at a Chinese university has developed a new way to make high-end infrared chips that could slash their cost dramatically and improve the performance of smartphone cameras and self-driving cars. The key breakthrough was finding a way to make the chips using conventional manufacturing techniques, rather than the exotic, costly materials that were relied on before. Mass production is set to begin by the end of the year, according to a press release from Xidian University. The chips...
![[llama.cpp] 3.1x Q8_0 speedup on Intel Arc GPUs - reorder optimization fix (PR submitted)](https://d2xsxph8kpxj0f.cloudfront.net/310419663032563854/konzwo8nGf8Z4uZsMefwMr/default-img-neural-network-P6fqXULWLNUwjuxqUZnB3T.webp)
[llama.cpp] 3.1x Q8_0 speedup on Intel Arc GPUs - reorder optimization fix (PR submitted)
TL;DR : Q8_0 quantization on Intel Xe2 (Battlemage/Arc B-series) GPUs was achieving only 21% of theoretical memory bandwidth. My AI Agent and I found the root cause and submitted a fix that brings it to 66% - a 3.1x speedup in token generation. The problem : On Intel Arc Pro B70, Q8_0 models ran at 4.88 t/s while Q4_K_M ran at 20.56 t/s; a 4x gap that shouldn't exist since Q8_0 only has 1.7x more data. After ruling out VRAM pressure, drivers, and backend issues, we traced it to the SYCL kernel dispatch path. Root cause : llama.cpp's SYCL backend has a "reorder" optimization that separates quantization scale factors from weight data for coalesced GPU memory access. This was implemented for Q4_0, Q4_K, and Q6_K - but Q8_0 was never added. Q8_0's 34-byte blocks (not power-of-2) make the non-r

Got Gemma 4 running locally on CUDA, both float and GGUF quantized, with benchmarks
Spent the last week getting Gemma 4 working on CUDA with both full-precision (BF16) and GGUF quantized inference. Here's a video of it running. Sharing some findings because this model has some quirks that aren't obvious. Performance (Gemma4 E2B, RTX 3090): | Config | BF16 Float | Q4_K_M GGUF | |-------------------------|------------|-------------| | short gen (p=1, g=32) | 110 tok/s | 170 tok/s | | long gen (p=512, g=128) | 72 tok/s | 93 tok/s | The precision trap nobody warns you about Honestly making it work was harder than I though. Gemma 4 uses attention_scale=1.0 (QK-norm instead of the usual 1/sqrt(d_k) scaling). This makes it roughly 22x more sensitive to precision errors than standard transformers. Things that work fine on LLaMA or Qwen will silently produce garbage on Gemma 4: F1
Knowledge Map
Connected Articles — Knowledge Graph
This article is connected to other articles through shared AI topics and tags.
More in Products

Tech companies are cutting jobs and betting on AI. The payoff is far from guaranteed
AI experts say we’re living in an experiment that may fundamentally change the model of work Sign up for the Breaking News US email to get newsletter alerts in your inbox Hundreds of thousands of tech workers are facing a harsh reality. Their well-paying jobs are no longer safe. Now that artificial intelligence (AI) is here, their futures don’t look as bright as they did a decade ago. As US tech companies have ramped up investments in AI, they’ve slashed a staggering number of jobs. Microsoft cut 15,000 workers last year . Amazon laid off 30,000 employees in the last six months. Financial-services company Block eliminated more than 4,000 people, or 40% of its workforce, in February. Meta laid off more than 1,000 in the last six months, and, according to a Reuters report, may cut 20% of all

Resume Skills Section: Best Layout + Examples (2026)
Your skills section is the most-scanned part of your resume after your name and current title. ATS systems use it for keyword matching. Recruiters use it as a 2-second compatibility check. If it's poorly organized, buried at the bottom, or filled with the wrong skills, both audiences move on. Where to Place Your Skills Section Situation Best Placement Why Technical role (SWE, DevOps, data) Below name, above experience Recruiters check your stack before reading bullets Non-technical role (PM, marketing, ops) Below experience Experience and results matter more Career changer Below name, above experience Establishes relevant skills before unrelated job titles New grad / intern Below education, above projects Education sets context, skills show what you can do The rule: place skills where they

How AI Is Transforming Cybersecurity and Compliance — A Deep Dive into PCI DSS
The intersection of artificial intelligence and cybersecurity is no longer a future concept — it is the present reality shaping how organizations defend their data, detect threats, and demonstrate regulatory compliance. As cyber threats grow in sophistication and volume, traditional rule-based security tools are struggling to keep pace. AI is filling that gap with speed, precision, and adaptability that human analysts alone cannot match. Nowhere is this transformation more consequential than in the world of payment security and compliance. The Payment Card Industry Data Security Standard (PCI DSS) — the global framework governing how organizations handle cardholder data — has long been a compliance burden for businesses of all sizes. AI is now fundamentally changing how companies achieve,

Securing Plex on Synology NAS with Post-Quantum Cryptography via Cloudflare Tunnel
Introduction Securing remote access to a Plex media server hosted on a Synology NAS device presents a critical challenge, particularly in the face of advancing quantum computing capabilities. Traditional encryption algorithms, such as RSA and Elliptic Curve Cryptography (ECC), rely on the computational infeasibility of tasks like integer factorization and discrete logarithm problems. Quantum computers, leveraging Shor’s algorithm, can solve these problems exponentially faster, rendering traditional encryption obsolete. This vulnerability is not a speculative future concern but an imminent threat, especially for internet-exposed services like Plex. Without post-quantum cryptography (PQC), Plex servers—and the sensitive data stored on Synology NAS devices—are susceptible to quantum-enabled d


Discussion
Sign in to join the discussion
No comments yet — be the first to share your thoughts!