Single logo
  • Courses
  • Blog
  • About
Join on SkoolJoin on Skool

In this topic

Claude
  • CLAUDE.md, settings.json and Plugins: Which Claude Code File Advises, Which Enforces, Which Packages
  • Authoring a Claude Skill: SKILL.md, Frontmatter, Progressive Disclosure and the Description That Triggers It
  • One Change, Four Environments: Where a Claude Config Edit Lands in Dev, Staging, Prod and CI
  • Claude in the SDLC: Prompts in Git, a Change Gate by Path, a Claude Review That Advises and a Person Who Merges
  • Hooks That Block Destructive Actions: a PreToolUse Gate That Allows, Asks or Denies
  • Choosing a Claude Code Extension: Skill, Hook, Rules File, Subagent, Slash Command or Plugin
  • Rolling Out Claude Code to a Team: Settings Precedence, dontAsk in CI, a Hook for Every-Time Rules and a Plugin for Five Repos
  • A Claude Code Review Bot in CI: Headless -p, JSON Findings, Team Rules in Git and a Person on the Merge
  • Lab: Three Planted Bugs in a Claude Code CI Repo, a Permission Mode, a Plugin Path and an MCP Token Variable
  • Configuring MCP Servers in Claude Code: A Command or a URL, Three Scopes, and Three Moves When One Breaks
  • The Claude Messages API: Your First Call, Field by Field
  • Claude Tool Use: How tool_use and tool_result Work in the Messages API
  • Claude Client SDKs Wrap One REST API: Raw HTTP, Python, TypeScript and Async Calls Compared
  • Anthropic SDK Timeouts, Retries and Error Classes: Configure the Client Once, Then Give 429, 529, 400 and Timeouts Their Own Move
  • Claude Streaming Events: The Event Order, message_stop, Tool Arguments, Stop Reasons and a WebSocket Relay
  • Images, PDFs and Thinking Blocks in the Claude Messages API: Typed Blocks In, Typed Blocks Out
  • Getting Data Into Claude: PDF Documents, the Files API, Search Results and Citations
  • Opus, Sonnet or Haiku: Pick the Claude Model per Job, and Test the Request When a New Release Arrives
  • Adaptive Thinking and Effort in Claude: Two Dials, Set per Workload, and the Thinking Block You Must Pass Back
  • Claude Cost Tracking From usage: Count Before, Cap During, Read After, Then Find the Line That Drives the Bill
  • Claude Cache Breakpoints: Where to Put cache_control, How to Move It With the Chat, and Why the Reads Stay at Zero
  • Claude Message Batches or Real Time: Choose by Who Is Waiting, Match by custom_id, Resend Only the Failures
  • Calling Claude Through Amazon Bedrock, Google Cloud and Microsoft Foundry: Same Call, Different Door
  • The Life Cycle of a Claude App: Six Phases, a Model That Retires, and a Release Gate for Every Change
  • Pinning Claude Model IDs and Upgrading Safely: One Change at a Time, a Golden-Set Replay and a Staged Rollout
  • Content Boundaries and Schema Design for Claude: Fence the Input in a Tag, Let the Output Say I Don't Know
  • The Agentic Loop and stop_reason: Keep Turning on tool_use, Stop on end_turn, Cap the Turns
  • The Claude Agent SDK: query(), ClaudeAgentOptions and @tool, in Python and TypeScript
  • Fix the Agent: Four Broken Claude Agent SDK Configs, From the Symptom to the One Wrong Line
  • Claude Managed Agents: Cloud Sandbox, Self-Hosted Sandbox or Self-Hosted Service
  • Agent SDK Hooks for Deterministic Actions: PreToolUse, PostToolUse, and Four Hooks That Fail Silently
  • Memory and Context-Window Patterns for Claude Agents: Context Editing, Compaction and the Memory Tool
  • Reading an Agent Trace: Five Signatures, Five Missing Patterns, and How Long a Fact Must Live
  • Tool Descriptions for Claude: How Claude Picks a Tool, and How to Stop It Picking the Wrong One
  • Tool Input Schemas and Error Responses for Claude: Required Fields, Enums, is_error and a Retry Flag
  • Tool Response Shaping and a Lean Tool Set: Give Claude a Sticky Note, Not the Filing Cabinet
  • Fix the Tool Schema: Read the Trace, Fix the Card, Re-Run (Four Real Schema Bugs)
  • Client Tools, Server Tools and Approval Gates: Who Runs the Tool, and Who Says Yes First
  • Built-in Tool, Custom Tool, Skill or MCP Server? Pick the Lightest One That Fits
  • System Prompt or User Turn: Where Each Instruction Goes, and Output Limits Your Code Enforces
  • Refine the Prompt One Line at a Time, Then Clean and Fence the Customer's Text
  • Prompt Revision Driven by Evals: Name the Cause, Change One Thing, Rerun the Whole Suite
  • Long-Running Sessions: Compact, Prune, Isolate or Start Fresh, Decided by Naming the Failure
  • Context Isolation Through Subagents: Read the Logs Elsewhere, Keep One Line
  • Defensive Parsing of Claude Replies: Check the Stop Reason, Read the Block or the Text, Then Validate the Values
  • Full Context or Retrieval: Choose by Corpus Size, Cost and Freshness
  • Skepticism Toward Confident Output: Check the Quote, the Record and the Sum Before You Send
  • Debugging a Claude App: Three Error Types, the Recovery Each One Earns, and the First Failing Row
  • Six Ways a 200 Can Still Be Wrong: Hallucination, Refusal, Under-Acting, Context Loss, Format Drift and Inconsistency
  • Fix the Cause, Not the Symptom: Four Recovery Drills for an LLM App, Each Checked on a New Input
  • Integration Layer or Model Output? Three Taps and Three Questions to Find Where a Wrong Answer Lives
  • Which Test Layer Owns the Failure? Unit, Functional, Integration and End-to-End Tests for a Claude App
  • Designing an Overnight Document Pipeline on Claude: Batch Lane, Live Lane, a Cached Prefix and a custom_id Reconcile
  • Proving a Model Upgrade Is Ready: A Frozen Golden Set, a Calibrated Judge, the Right Layer and a Release Gate
  • From Requirement to Design for a Claude App: Eight Requirements, Five Elements and a Trace With No Gaps
  • Build a Claude Refund App: the Messages API, Two Tools, an MCP Server and a Hook in One Loop
  • Ship a Claude App: an Eval Gate, Two Guardrail Layers, a Cost Check From usage and a Pinned Model
  • Lab: a 30-Case Golden Set, a Calibrated Judge and a Per-Slice CI Gate on a Claude Refund App
  • Lab: Cut a Claude App's Bill by 62 Percent With Usage Data, Layered Cache Breakpoints and a Batch Job
  • Lab: Three Planted Bugs in a Claude App, a Vague Prompt, a Mistyped Tool Schema and a Broken Stream Handler
  • Lab: Three Planted Bugs in a Claude Code CI Repo, a Permission Mode, a Plugin Path and an MCP Token Variable
  • Lab: Harden a Claude App, an Uncalibrated Judge, a Retry Loop That Retries Everything and a Hook Matcher With a Gap
  • Lab: Turn a Claude App Into a Reusable Template, One Pinned Model Id, No Key in Code and Evals Built From Data
  • Building an MCP Server: Tools, Resources and Prompts in Python and TypeScript
  • MCP Transports: stdio or Streamable HTTP, and Who Starts the Server
  • Deploying and Authenticating an MCP Server: Environment Keys for stdio, Bearer Tokens and Scopes for HTTP
  1. Blog
  2. /
  3. Claude
  4. /
  5. Claude Code

CLAUDE.md, settings.json and Plugins: Which Claude Code File Advises, Which Enforces, Which Packages

Three needs in one repo: a test command, a rule that Claude must never read .env, and a shared deploy skill. See which file each belongs in, how the settings layers merge, and what a plugin manifest carries.

Chaand Sheikh

·27 November 2026Claude Code

What you will learn

  • Tell advice (CLAUDE.md) from enforced rules (settings.json) and packaged tools (plugins)
  • Predict the effective settings when user, project and local files disagree
  • Explain why permission lists combine and deny rules are checked first
  • Read a plugin manifest and know what enabling a plugin does and doesn't do

Before you start

  • A first session in Claude Code
  • Basic JSON

Meet bookshop-bot, a small project with a small team. Three files shape how Claude Code behaves in it, and each one has a different job: one advises, one enforces, and one packages. Put a rule in the wrong file and it won't hold when it matters.

Three needs, three homes

The team has three needs:

  1. Run pytest -q before calling a job done. That's a request, so it goes in CLAUDE.md.
  2. Never read the .env file, whatever Claude decides. That has to hold, so it's a deny rule in settings.json.
  3. Everyone gets the same deploy skill. That's a package, so it becomes a plugin.

Think of an office. The staff handbook says "please lock up at night": it's written down and staff are trusted to follow it. That's CLAUDE.md. The safe needs a keycard, and nobody opens it without one, even if they never read the handbook. That's settings.json. The starter kit, a toolbox handed to every new hire, is the plugin. Advice can be ignored. A lock cannot.

CLAUDE.md is advice

Here is the project's CLAUDE.md:

# bookshop-bot

## Tests
- Run the tests with: pytest -q

## Code style
- Python 3.12, with type hints on every function.
- Format with: ruff format
- Never read the .env file.

The test command and the style rules are exactly what this file is for. The last line sounds strict, but it's still only advice. Claude Code loads CLAUDE.md as context, not as enforced configuration. A rule that must never be broken needs the lock.

Settings stack by scope

Settings files stack. From lowest to highest precedence:

Claude Code settings layers managed settings (your organisation) command line (one session) .claude/settings.local.json (you, this project) .claude/settings.json (shared, committed) ~/.claude/settings.json (you, every project) higher wins plain value (model): project sonnet, local opus -> opus wins list (permissions.allow): every layer adds -> 4 rules from 3 files
A higher layer overrides a plain value; permission lists from every layer combine. Your own files can't override managed settings.

Two rules come out of that stack:

  • For a plain value, the highest layer wins. The project says Sonnet, the local file says Opus, so Opus wins, for you only.
  • For a permission list, every layer adds. Nothing gets dropped.

.claude/settings.json: the shared file

{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "model": "claude-sonnet-5",
  "permissions": {
    "allow": ["Bash(pytest *)", "Bash(ruff check *)"],
    "deny": ["Read(./.env)", "Read(./.env.*)"]
  },
  "enabledPlugins": {
    "deploy-tools@bookshop-plugins": true
  }
}
  • model is a plain value: the team's model.
  • allow lets pytest and ruff check run without asking.
  • deny blocks reads of .env. Deny rules are checked before allow rules.
  • enabledPlugins turns a plugin on by its id, name@marketplace.

Commit this file so everyone who clones gets it. It must be strict JSON: no comments, no trailing commas.

.claude/settings.local.json: yours only

{
  "model": "claude-opus-5-5",
  "permissions": {
    "allow": ["Bash(git status)"]
  }
}

Same model key, higher layer, so this value wins, but only on your machine. It adds an allow rule for git status without losing anything from the other files. When Claude Code creates this file it keeps it out of git; if you make it by hand, add it to .gitignore yourself.

The sample user file, ~/.claude/settings.json, sets "spinnerTipsEnabled": false and allows Bash(git diff *).

A model of the merge: resolve.py

The project includes a small Python model of these rules. It's a simplified model of the documented behaviour, not Claude Code itself:

LAYERS = [("user", "user-settings.json"),
          ("project", ".claude/settings.json"),
          ("local", ".claude/settings.local.json")]
LISTS = ("permissions.allow", "permissions.deny")


def resolve():
    value, source = {}, {}
    for name, rel in LAYERS:
        for key, val in flatten(read(rel)).items():
            if key in LISTS:
                old = value.get(key, [])
                value[key] = old + [v for v in val if v not in old]
                source[key] = source.get(key, []) + [name]
            else:
                value[key], source[key] = val, [name]
    return value, source


def decide(call, value):
    for rule in value["permissions.deny"]:
        if fnmatch.fnmatch(call, rule):
            return f"denied by {rule}"
    for rule in value["permissions.allow"]:
        if fnmatch.fnmatch(call, rule):
            return f"allowed by {rule}"
    return "no rule matches"

The layers are listed lowest first. A list key combines and skips duplicates; any other key is simply replaced by the later layer. decide() checks deny before allow.

Running run_all.py (plain Python reading the sample files, no model call) printed:

effective settings
model               claude-opus-5-5  <- local
spinnerTipsEnabled  false  <- user
permissions.allow   4 rules  <- user+project+local
  Bash(git diff *) Bash(pytest *) Bash(ruff check *) Bash(git status)
permissions.deny    2 rules  <- project
enabledPlugins      deploy-tools@bookshop-plugins: true  <- project
permission checks
Read(./.env)        denied by Read(./.env)
Bash(pytest -q)     allowed by Bash(pytest *)
Bash(git status)    allowed by Bash(git status)
Bash(rm -rf build)  no rule matches
plugin deploy-tools
version 1.2.0 | needs secrets-vault | /deploy-tools:deploy
  • The model comes from local: local beat project, as the stack says.
  • Four allow rules from three files, none dropped.
  • Reading .env is denied by the project's deny rule.
  • rm -rf build matches no rule at all. No rule means no free pass: it isn't pre-approved.
  • The plugin brings one skill, /deploy-tools:deploy.

The plugin manifest: plugin.json

A plugin keeps its manifest in a .claude-plugin folder, with its skills beside it:

{
  "name": "deploy-tools",
  "version": "1.2.0",
  "description": "Staging deploy skill for the bookshop team",
  "author": { "name": "Bookshop Team" },
  "dependencies": ["secrets-vault"]
}
  • name becomes the prefix of every skill in the plugin, so the deploy skill runs as /deploy-tools:deploy.
  • version is the version users are on until the string changes.
  • dependencies lists other plugins that must be enabled for this one to work.

Enabled is not installed. enabledPlugins in the shared settings turns the plugin on for the project, but each teammate still installs it once on their machine.

Common mistakes

PlacementWhy it fails for "never read .env, for everyone"
A line in CLAUDE.mdAdvice, not a lock
A deny rule in each developer's user settingsNot shared; a new teammate won't have it
A deny rule in settings.local.jsonPersonal and kept out of git
A deny rule in the committed .claude/settings.jsonThe right home: enforced, and everyone gets it

For the wider choice between skills, hooks, rules files, subagents, slash commands and plugins, see Choosing a Claude Code Extension. To write the skill a plugin carries, see Authoring a Skill.

Quick recap

FileJobShared?
CLAUDE.mdAdvise: loaded as contextYes, committed
.claude/settings.jsonEnforce: permissions, model, enabled pluginsYes, committed
.claude/settings.local.jsonYour overrides for this projectNo, kept out of git
~/.claude/settings.jsonYour defaults for every projectNo
Plugin (.claude-plugin/plugin.json)Package: skills as one unitInstalled on each machine

Try it yourself

Add "deny": ["Bash(rm *)"] to the user settings file. Which layer does permissions.deny now come from, and what does decide() say about Bash(rm -rf build)? Then remove model from the local file: which model wins?

Tried the exercise? Share your answer or ask a question.

The StudyEasy AI Community is free to join, with the lesson files, notebooks and code.

Join free on Skool

Keep going in Claude · 1 of 66

Next post
Authoring a Claude Skill: SKILL.md, Frontmatter, Progressive Disclosure and the Description That Triggers It

Related course on Udemy

Claude Certified Developer - Foundations (CCDV-F) Exam Prep

Build and ship Claude apps: the API, agents, tools and MCP, prompts, evals, security and model choice.View on Udemy ↗: Claude Certified Developer - Foundations (CCDV-F) Exam Prep (paid course, opens in a new tab)

Related posts

Authoring a Claude Skill: SKILL.md, Frontmatter, Progressive Disclosure and the Description That Triggers It

Pack a support team's ticket-triage routine into one skill folder, then watch three requests load one, two or all three levels: the catalog, the SKILL.md body, and a script whose code never enters the context.

One Change, Four Environments: Where a Claude Config Edit Lands in Dev, Staging, Prod and CI

Change one line in a repo and ask where it lands. A small resolver for bookshop-bot shows that a new model id in settings.json reaches only CI, a prompt bump reaches dev and CI, and a prod block edit reaches only prod.

Claude in the SDLC: Prompts in Git, a Change Gate by Path, a Claude Review That Advises and a Person Who Merges

Follow one prompt edit from a branch to a merge: version prompts and the model pin like code, keep the API key in GitHub Secrets, gate changes by path, let Claude review the diff, and leave the merge to a person.

Hooks That Block Destructive Actions: a PreToolUse Gate That Allows, Asks or Denies

A coding agent is told to clean up the data folder and picks rm -rf data/. A PreToolUse hook sees the call before the tool runs: tests and single-file deletes pass, a force push asks a person, and rm -rf, DROP TABLE and a write to .env are denied with a reason.

On this page

  • Three needs, three homes
  • CLAUDE.md is advice
  • Settings stack by scope
  • .claude/settings.json: the shared file
  • .claude/settings.local.json: yours only
  • A model of the merge: resolve.py
  • The plugin manifest: plugin.json
  • Common mistakes
  • Quick recap
  • Try it yourself
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

Claude Certified Developer - Foundations (CCDV-F) Exam Prep

Build and ship Claude apps: the API, agents, tools and MCP, prompts, evals, security and model choice.View on Udemy ↗: Claude Certified Developer - Foundations (CCDV-F) Exam Prep (paid course, opens in a new tab)

Single logo

Empowering Education, One Course at a Time

About
About usContact usFAQs
Legal
Terms of ServicePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.