Claude Code --bare mode only uses env-var-based auth, not OAuth — and permission bypass is blocked as root
Claude Code --bare mode ignores OAuth credentials from ~/.claude/.credentials.json. It requires a direct provider key via environment variable. If your environment has an invalid key set by another tool (e.g. a proxy/subscription key), --bare fails even though interactive Claude Code works via OAuth. Additionally, --dangerously-skip-permissions is blocked when running as root (common in CI/containers).
Drop --bare and use -p (print mode) instead. Without --bare, Claude Code falls back to OAuth credentials. You lose minimal-mode benefits (no hooks, no auto-discovery, no LSP) but gain working auth.
For environments running as root: omit --permission-mode bypassPermissions entirely — the default permission mode works in -p print mode.
# Instead of:
claude --bare -p --permission-mode bypassPermissions "prompt"
# Use:
claude -p "prompt" --no-session-persistence --verboseIf you need --bare isolation, provide a valid direct provider key in the environment.