A scripted run should ignore each developer's local CLAUDE.md and setup so that results are repeatable. What do you use?
Why A is the answer
--bare, which skips auto-discovery
The docs recommend --bare for scripted and SDK calls because it skips auto-discovery, including CLAUDE.md.
In detail
- Normal runs discover local setup, including CLAUDE.md, and that setup varies between machines.
- The docs recommend --bare for scripted and SDK calls because it skips auto-discovery.
- Pass what the run needs explicitly, because discovery no longer provides it.
Use case
An illustrative scenario, not a real incident.
A nightly script gives different results on two machines, because each developer has their own local setup. With --bare, auto-discovery is skipped, so both runs start from the same place.
See it in different ways
flowchart LR
A["CI job"] --> B["claude -p with JSON output"]
B --> C{"Exit code"}
C -->|"0"| D["Parse the result"]
C -->|"Non-zero"| E["Fail the job"]sequenceDiagram participant CI as CI job participant C as claude -p CI->>C: Prompt, --output-format json, --json-schema C-->>CI: structured_output and exit code CI->>CI: Pass or fail the step
flowchart TD
Q{"What kind of run?"}
Q -->|"Interactive"| A0["Auto-discovery is helpful"]
Q -->|"Scripted"| A1["Use --bare"]Key point: Scripted runs should not depend on a machine's local setup.
Why the other options are wrong
- B. A longer prompt telling Claude to ignore what it has loaded
- The files are already in context by then, so a prompt cannot reliably undo that.
- C. --continue, which resumes the last session on that machine
- --continue resumes earlier local state, which reduces repeatability.
- D. --verbose, which prints every step for later comparison
- --verbose adds output. It does not change what gets loaded.

