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.
What you will learn
- List which files a developer laptop, a deployed app and a CI run each read
- Predict where an edit to settings.json, app_config.json or CLAUDE.md takes effect
- Explain why a CI checkout never sees settings.local.json
- Ship one change per release by pinning model id and prompt version per environment
Before you start
- CLAUDE.md, settings.json and plugins
- Git basics
bookshop-bot is one small repo with one small team. Today we change one line and ask a simple question: where does it land? On a developer laptop, in staging, in prod, or in the CI run?
That's four places, and each one reads a different set of files. So a change that matters in one place can do nothing at all in another. The rule for the whole article: a change lands where it is read.
One repo, four places
- Dev, a developer laptop. Claude Code reads
CLAUDE.md, the shared settings and the developer's own local file. The app config and the plugin come along. - Staging and prod run the deployed app. It reads one file,
app_config.json. No Claude Code settings, noCLAUDE.md. - CI starts from a fresh checkout. It gets the committed files only, so the local settings file isn't there.
Five files, each read for one thing
| File | Read for | Value today |
|---|---|---|
CLAUDE.md | Claude's rules | The test command; change one thing per release |
.claude/settings.json | Claude Code's pinned model | claude-sonnet-5-5 |
.claude/settings.local.json | One developer's own model | claude-opus-5-5, that laptop only |
app_config.json | The app's model id and prompt version per environment | Prod runs triage_v2 |
review-tools/.claude-plugin/plugin.json | Plugin version and what it needs | 1.2.0, needs lint-rules |
Model id, prompt version and plugin version are all plain text in the repo, so every one of them can be diffed and reviewed.
.claude/settings.json
{
"model": "claude-sonnet-5-5",
"permissions": {
"deny": ["Read(./.env)", "Read(./.env.*)"]
},
"enabledPlugins": {
"review-tools@bookshop-plugins": true
}
}
The model line pins Claude Code's model, the deny rule blocks .env wherever this file loads, and the plugin id switches the review tools on. The file is committed, so every clone and every CI checkout gets it. The developer's .claude/settings.local.json holds just {"model": "claude-opus-5-5"}, and .gitignore lists it together with .env.
app_config.json
{
"default": {"model": "claude-sonnet-5-5", "prompt": "triage_v2"},
"staging": {"prompt": "triage_v3"},
"prod": {"model": "claude-sonnet-5-5", "prompt": "triage_v2"}
}
The default block sets a model id and a prompt version. Staging overrides only the prompt, trying the new triage_v3 while prod stays on the old one. Prod pins both, so it never drifts when the default moves. The app reads this file and never the Claude Code settings.
A model of who reads what: envconfig.py
The project's resolver is a simplified model of the documented rules, not Claude Code or GitHub:
def tracked(files):
"""A CI checkout holds only what git does not ignore."""
rules = files[".gitignore"].split()
return {rel: text for rel, text in files.items()
if not any(fnmatch.fnmatch(rel, r) for r in rules)}
def claude_model(files):
"""Claude Code: the local file wins over the shared file."""
model = None
for rel in LAYERS:
if rel in files:
model = json.loads(files[rel]).get("model", model)
return model
def app_settings(files, env):
"""The app: default block, then this environment's block."""
cfg = json.loads(files["app_config.json"])
return {**cfg["default"], **cfg.get(env, {})}
def resolve(files, env):
seen = tracked(files) if env == "ci" else files
app = app_settings(seen, env)
row = {"claude model": "-", "claude.md": "-",
"app model": app["model"], "prompt": app["prompt"]}
if env in ("dev", "ci"):
row["claude model"] = claude_model(seen)
row["claude.md"] = digest(seen["CLAUDE.md"])
return row
- CI keeps only the files git doesn't ignore.
- For Claude Code, a later settings file replaces the model, so the local file wins.
- The app takes the default block, then its own environment's block.
- Only dev and CI run Claude Code, so only they get a Claude model and a
CLAUDE.md(shown as a short hash).
Today's state, from python envconfig.py:
env claude model claude.md app model prompt
dev claude-opus-5-5 7b484f claude-sonnet-5-5 triage_v2
staging - - claude-sonnet-5-5 triage_v3
prod - - claude-sonnet-5-5 triage_v2
ci claude-sonnet-5-5 7b484f claude-sonnet-5-5 triage_v2
The workflow that runs in CI
The CI run is described by a plain text file in the repo, .github/workflows/claude-review.yml:
name: Claude Review
on:
pull_request:
types: [opened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
id-token: write
steps:
- uses: actions/checkout@v6
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
plugin_marketplaces: |
https://github.com/bookshop/plugins.git
plugins: review-tools@bookshop-plugins
prompt: "/review-tools:review"
- run: python envconfig.py ci
- Checkout brings the committed files and nothing else. Anything git ignores stays behind.
- The Claude Code action starts Claude Code inside that checkout. The key comes from a repository secret, never from the file.
- The plugin is installed from the
pluginsline,name@marketplace. - There's no model argument, so CI follows the committed settings. A model argument here would win over the file.
Predict first: which places move?
Before running anything, read the files and predict.
Change 1: move the model in .claude/settings.json to claude-haiku-5-5. Dev stays the same, because the local file wins there. Staging and prod stay the same, because the app never reads this file. Only CI moves.
Change 2: move the default prompt in app_config.json to triage_v3. Dev and CI move, because both read the default. Staging already has triage_v3, and prod is pinned.
Now what_if.py applies four changes in memory and diffs every environment:
change 1 .claude/settings.json: model -> claude-haiku-5-5
ci claude model claude-sonnet-5-5 -> claude-haiku-5-5
same dev, staging, prod
change 2 app_config.json: default prompt -> triage_v3
dev prompt triage_v2 -> triage_v3
ci prompt triage_v2 -> triage_v3
same staging, prod
change 3 CLAUDE.md: one more rule
dev claude.md 7b484f -> 51eb3e
ci claude.md 7b484f -> 51eb3e
same staging, prod
change 4 app_config.json: prod prompt -> triage_v3
prod prompt triage_v2 -> triage_v3
same dev, staging, ci
Both predictions hold. Change 3 adds a rule to CLAUDE.md, which dev and CI read. Change 4 edits the prod block, so only prod moves: that's a release, one change at a time.
The answer comes from reading who loads the file, not from the size of the edit.
The CI log
A stand-in runner, ci_run.py, writes the log of one CI run after change 1:
workflow Claude Review on pull_request
step 1 actions/checkout@v6
14 files checked out
ignored: .claude/settings.local.json
step 2 anthropics/claude-code-action@v1
settings .claude/settings.json
settings .claude/settings.local.json: not here
model: claude-haiku-5-5
CLAUDE.md 7b484f
plugin: review-tools@bookshop-plugins 1.2.0
needs: lint-rules
prompt: /review-tools:review
step 3 python envconfig.py ci
env claude model claude.md app model prompt
ci claude-haiku-5-5 7b484f claude-sonnet-5-5 triage_v2
The local settings file never left the laptop. The new model id reached the CI run. The plugin is there at version 1.2.0, and the app row still shows triage_v2, because change 1 touched only the model.
Common mistakes
- "The new model in settings.json applies everywhere." The deployed app reads its own file, and a developer with a local model keeps that model. CI and every session without a local model follow the shared file.
- Testing a setting only on your laptop. Your local file may be hiding the shared value. CI shows what the committed files really say.
- Leaving prod on the default block. Then a change meant for staging or dev drifts into prod. Pin prod's model id and prompt version.
- Changing two things in one release. If the model and the prompt move together, you can't tell which one changed the behaviour.
For how the settings layers merge, see CLAUDE.md, settings.json and Plugins. For a review bot built on the same kind of workflow, see A Claude Code Review Bot in CI.
Quick recap
| Step | Question to ask |
|---|---|
| Read the set | Which files hold the model id, the prompt version and the plugin version? |
| Predict each place | Does dev, staging, prod or CI read the file that changed? |
| Check the run | Who moved, and who held? |
Try it yourself
Delete the developer's settings.local.json and apply change 1 again. Which environments move now? Then add a staging model of claude-haiku-5-5 to app_config.json: which single row changes?
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
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.
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.
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.