/auto-mode-setup fails: removeFromPermissionsAllow[0] is not a rule string the removal offer could have produced
Status Open
Reported on v2.1.238
Maintainer reply None cached
Activity 0 comments · opened Aug 21, 2026
Bug: /auto-mode-setup fails with "removeFromPermissionsAllow[0] is not a rule string the removal offer could have produced"
Claude Code version: 2.1.238
OS: Linux (Ubuntu 24.04, EC2), kernel 6.17.0-1019-aws, x86_64
Surface: Claude Code CLI, interactive session
Steps to reproduce
- In a project with a large, long-lived permissions config (project
.claude/settings.json~138permissions.allowentries,.claude/settings.local.json~1152 entries, user~/.claude/settings.json4 entries), run/auto-mode-setup. - Command prints local-command-stdout:
Gathering data and drafting your auto-mode setup; back soon. - Command then fails with:
````
Auto-mode setup scan failed: removeFromPermissionsAllow[0] is not a rule string the removal offer could have produced.
Expected behavior
/auto-mode-setup completes and returns a drafted auto-mode configuration (or a proposed diff of permission rules to remove/add), or fails with an error that identifies which specific rule/entry triggered the problem.
Actual behavior
The command fails every time with the same internal-consistency error. Retrying (same session and a fresh invocation) reproduces the identical failure.
Investigation so far
- Checked all three applicable
permissions.allowarrays (project.claude/settings.json, project.claude/settings.local.json, user~/.claude/settings.json) for non-string entries — none found; every entry is a well-formed string. - The error message implies the command computed a
removeFromPermissionsAllowlist internally and then validated element[0]against the set of rule strings it should be able to produce from the current config — and that validation failed. Since the on-disk config has no malformed entries, this looks like a bug in the command's own rule-generation/removal-offer logic (possibly related to the very largesettings.local.jsonallow list, or to how rules from multiple settings files are merged/deduplicated before the removal offer is built) rather than corrupted user config.
Additional context
- Not project-specific in an obvious way, but this project's config is unusually large (1150+ local allow rules), which may be relevant to reproducing it.