When I set auto mode as the default at startup in Claude Code, the behavior diverged between supported and unsupported models
This page has been translated by machine translation. View original
I'm emi, a coffee lover.
Last time, I checked model by model whether auto mode could be used with Claude Code via Amazon Bedrock. On Bedrock, the supported models were Sonnet 5 / Opus 4.7 and later / Fable, and the result was that auto mode does not appear with Sonnet 4.6.
This time, I verified how behavior differs between models that support auto mode and those that don't, when the permission mode at startup is set to auto mode.
Conclusion First
- The permission mode at startup can be set to
autoviadefaultModeinpermissionsin~/.claude/settings.json- It needs to be written in the user settings (
~/.claude/settings.json); settings on the project side (.claude/settings.jsonor.claude/settings.local.json) will not take effect
- It needs to be written in the user settings (
- When launched with an auto mode-compatible model (in this case,
jp.Opus 4.8), auto mode is on immediately after startup - With a model that does not support auto mode (in this case,
jp.Sonnet 4.6),defaultMode: "auto"is ignored even if written, and it starts with manual mode on - Model specification via the
ANTHROPIC_MODELenvironment variable in.bashrctakes priority overmodelinsettings.json
Environment
- Windows + WSL2 (Ubuntu)
- Claude Code v2.1.248
- Via Amazon Bedrock (launched by injecting temporary credentials with
aws-vault)
As before, I'm using the Bedrock startup function claude-bedrock. This function launches claude inside aws-vault exec with CLAUDE_CODE_USE_BEDROCK=1, the region, and the model specified with the jp. prefix. For details, please refer to the following article.
Setting defaultMode to auto
To make auto mode the mode at startup, add defaultMode to the permissions block in the user settings ~/.claude/settings.json.
"permissions": {
"allow": [
"Read(//tmp/**)"
]
}
↓ Add defaultMode here.
"permissions": {
"defaultMode": "auto",
"allow": [
"Read(//tmp/**)"
]
}
Even if defaultMode: "auto" is written in the project-side settings (.claude/settings.json or .claude/settings.local.json), it will not take effect. You need to write it in the user settings ~/.claude/settings.json, or pass --permission-mode at each startup.
I also specify which model to use at startup via model in settings.json.
Initially, I was passing the environment variable ANTHROPIC_MODEL='jp.anthropic.claude-sonnet-4-6' inside the claude-bedrock function in .bashrc. Since this environment variable takes priority over model in settings.json, no matter what I wrote in settings.json, it would always be Sonnet 4.6 when launched via claude-bedrock.
Since I want to consolidate model specification into settings.json this time, I removed the ANTHROPIC_MODEL line from the function in .bashrc. I kept ANTHROPIC_SMALL_FAST_MODEL for the lightweight model.
claude-bedrock() {
aws-vault exec cm-kitani.emi -- env \
CLAUDE_CODE_USE_BEDROCK=1 \
AWS_REGION=ap-northeast-1 \
ANTHROPIC_SMALL_FAST_MODEL='jp.anthropic.claude-haiku-4-5-20251001-v1:0' \
claude "$@"
}
Since I changed .bashrc, I run the source ~/.bashrc command to apply the changes.
Execution result▼
emiki@<hostname>:~/work/xx$ source ~/.bashrc
emiki@<hostname>:~/work/xx$
Changes to settings.json are applied just by restarting Claude Code.
When I wrote the alias "opus" for model in settings.json, it resolved to the global model without jp. (Opus 5 in this case). Since I want to fix it to the domestic profile with the jp. prefix, I write the profile ID directly.
"model": "jp.anthropic.claude-opus-4-8",
With the compatible model jp. Opus 4.8, it launched in auto mode
I rewrite the settings and launch claude-bedrock.
▐▛███▛█ Claude Code v2.1.248
▝▜██████▀ Opus 4.8 · Amazon Bedrock
▝▝ ▝▝ ~/work/xx
● high · /effort
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
⏵⏵ auto mode on (shift+tab to cycle) · ← for agents · shift+click to native select
With jp. Opus 4.8, auto mode was on immediately after startup.
I'll exit the TUI once with /exit.
With the incompatible model jp. Sonnet 4.6, it was manual mode
Next, I change model to jp. Sonnet 4.6. defaultMode: "auto" remains as is.
"model": "jp.anthropic.claude-sonnet-4-6",
I restarted claude-bedrock.
▐▛███▛█ Claude Code v2.1.248
▝▜██████▀ Sonnet 4.6 · Amazon Bedrock
▝▝ ▝▝ ~/work/xx
auto mode unavailable for this model
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
⏸ manual mode on · ? for shortcuts · ← for agents · shift+click to native select
Even though defaultMode: "auto" is written, it shows manual mode on. The message auto mode unavailable for this model is displayed. I was able to confirm the behavior where auto is ignored for incompatible models and falls back to the built-in default of manual.
Closing
With the auto mode-compatible Opus 4.8, auto mode was active immediately after startup, while with the incompatible Sonnet 4.6, it reverted to manual even with the same settings.
For questions and requests about this article, please contact us via "Feedback for DevelopersIO" at the bottom of the screen.
