30.5 Configuration that travels
- Approved by
- Panaversity ·
In everyday life. A shop has two sets of rules. The staff handbook tells each assistant how to work, and each shift adds its own habits. The price list tells customers what they pay, and it must be the same whoever is on shift. When the list leaves an item out, each assistant charges what they remember, and the same item costs a different amount each day. In this section, the price list is the worker's own configuration. The handbook and the habits are the coding agent's files on each machine, and the remembered price is a default.
What you will learn. You practice this in Lab 30, Task 4.
- Which two configurations does a project have?
- What does a run read when you set nothing?
- Which model runs when a file and a variable disagree?
- How do plugin versions travel?
- What goes in row 5 of the table?
Why it matters. The worker's code is the same in all three environments. What it reads around the code is not. A setting you never wrote is not empty. A default fills it, and each machine's default can differ.
At work. It is Monday, May 17, 2027, on your laptop. The change adds the extraction prompt's next version, which Ana tried first in her Claude project. Before you open the pull request, you ask one question of each place the request runs. Which files does this run read, and which of them did I write for it?
Which two configurations does a project have?
The coding agent's and the worker's. Only the worker's should reach staging and production. Here, a configuration is everything a run reads besides its code: files, settings and environment variables. A project like Brightline's has two, and they are read by different programs.
| The coding agent's configuration | The worker's configuration | |
|---|---|---|
| What it holds | CLAUDE.md or AGENTS.md, the settings files, plugins, and environment variables such as ANTHROPIC_MODEL | config/prompts.yaml, the prompt files it names, agents/ap-worker.md and its lock file |
| Who reads it | Claude Code, on your laptop or in a CI job | The worker's code, the portal's morning job and the hosted agent |
| Where it belongs | Your laptop, and CI's review job | Development, staging and production |
The coding agent's side follows 12.4: "keep one short, true AGENTS.md in the repository". The worker's side follows 23.6: "The settings file does not travel." The hosted worker reads no settings file at all.
config/prompts.yaml holds one entry for staging and one for production. Tuesday's change adds the model and its fallbacks, so a difference between environments is a difference you can read in one file. This is the file as Lab 30 leaves it:
# config/prompts.yaml: one entry for each environment, as Lab 30 leaves it
staging:
prompt: prompts/extract-invoice.v[N].md # the prompt version this place runs
model: "[model id]" # the pin (added Tuesday)
fallbacks: [] # models it may end on, after the pin (30.4)
workspace: staging # the only ids it reads (30.3)
production:
prompt: prompts/extract-invoice.v[N].md
model: "[model id]"
fallbacks: []
workspace: production
fileExpirySeconds: [n] # how long an uploaded file is kept (30.2, Task 4)How a prompt version is kept, logged and promoted is 25.1's rule: "a prompt reaches production only as a named version that the suite has read". This file is where each environment names that version.
What does a run read when you set nothing?
On the Claude Agent SDK, everything Claude Code would read on that machine. An SDK run takes a list called settingSources, which says which settings files it loads. Anthropic's page is plain about the default: "Omitting settingSources is equivalent to ["user", "project", "local"]."1 And CLAUDE.md comes with them: "Default query() options enable both sources, so CLAUDE.md loads automatically."2
So an SDK run with the list left out reads your own ~/.claude files on your laptop, and whatever the CI runner holds in CI. The same code reads different rules in each place, and no file in the worker's configuration says so.
The kit sets the list empty. Lab 22's claude-agent.ts has settingSources: [], and the line's comment reads "read no settings files from this computer", 22.9's rule. That one line moves the run from the left side of the table above to the right side. The extraction itself is one Messages API call, which reads no settings file anywhere.
Which model runs when a file and a variable disagree?
A flag at startup wins, then an environment variable, then a settings file. The order of the settings files, highest first, is in 12.8. This chapter adds three facts that change which model a run ends on.
- A flag beats a variable. Claude Code's model order, highest first, is
/modelduring a session,--modelat startup, the variableANTHROPIC_MODEL, themodelkey in settings, and lastANTHROPIC_DEFAULT_MODEL.3 - A variable beats a file. "
ANTHROPIC_MODELexported in your shell applies over themodelkey from any file, whileANTHROPIC_DEFAULT_MODELapplies only when no file setsmodel."4 - A managed model is not a lock. Managed settings are the ones your organization sends to every computer. Even there, "A managed
modelis a starting default, not a lock".4 The locks are two lists,availableModelsanddeniedModels: the models a person may choose, and the ones they may not. Naming one model only sets where a session starts.
These facts are about Claude Code, the coding agent. The worker's model is the pin in config/prompts.yaml, which the worker's code passes on every request. So a variable on the laptop does not choose it. That is one more reason to keep the two configurations apart.
How do plugin versions travel?
By the range you write. Without one, each install takes the newest version. A plugin's manifest can list dependencies, other plugins it relies on (16.10). Anthropic's page says: "Each dependency tracks the latest version its marketplace provides unless you declare a version constraint".5 A version range is a rule such as ^2.0 or ~2.1.0, which allows any version inside it. Four results follow:5
| You write | What installs |
|---|---|
| No range | The latest version the marketplace has, on the day of the install |
A range, such as ^2.0 | "the highest git tag that satisfies this range" |
| Two plugins whose ranges cannot both hold | The install fails with "has conflicting version requirements", and what was installed stays as it was |
An exact pin, =2.1.0 | "The dependency stays at 2.1.0. Auto-update skips newer versions" |
So a range is a value that can differ by place. Your laptop installed a dependency last month. CI installs it fresh on every run. Both obey ^2.0, and they can still hold different versions. Where two environments must run the same plugin, pin it exactly, and change the pin in a pull request.
What goes in row 5 of the table?
For each environment, which configuration the run reads, and a file that proves it. The worked run fills these cells:
- Development. The worker's configuration:
config/prompts.yaml, the prompt version in itsstagingentry, because the laptop runs with the staging key, andsettingSources: []. Proof:src/sdk/claude-agent.ts#settingSources. If someone deletes that line, the check finds the cell and the file in disagreement. - Staging. The portal's morning job (the extraction) and the hosted worker read only the worker's configuration. Proof: for the extraction, the prompt file that
config/prompts.yaml#staging.promptnames exists and the suite's report names that version. For the hosted worker,claude-lock.staging.json. - Staging, CI's review job. This job runs Claude Code on the pull request. It is not the worker, and it reads the coding agent's configuration. Its workflow passes
--modelinclaude_args, which beats the settings file (30.7). Proof: thatclaude_argsline in the workflow file. - Production. The same as staging. Proof: for the extraction, the prompt file that
config/prompts.yaml#production.promptnames exists. For the hosted worker, waiting:claude-lock.production.json, made by the production apply. And by a person: the run log, the portal's record of each morning run, names the prompt version of every answer. It holds ids and versions, not the content of questions or answers.
Figure 30.5. Two configurations in one repository. Staging and production read only the worker's. A run that leaves settingSources out reads the coding agent's files too. CI's review job is not the worker, and reads the coding agent's.
The operating rule: let each run read only the configuration written for it. Set every default that loads files to empty, pin what may change, and write each environment's value in row 5.
Do this now. Ask your coding agent to find what each run reads. Copy this line:
List every place this project starts a model run: an SDK call, an Agent SDK run, a CI job and a script. For each one, say which configuration it reads: settings files, CLAUDE.md or AGENTS.md, environment variables, plugins, and the worker's own config file. Mark any run that leaves
settingSourcesout, any job that sets a model through an environment variable, and any plugin dependency with no exact version. Change no file.
Check yourself
Question 1 / 6
0 answered
A worker's Agent SDK run leaves settingSources out. It behaves one way on your laptop and another way in CI, with the same code. What explains the difference?
Sources
- Owner
- Panaversity