fix: use --permission-mode bypassPermissions instead of --dangerously-skip-permissions#4
Merged
melanie531 merged 1 commit intoaws-samples:mainfrom Mar 19, 2026
Conversation
…-skip-permissions CodeBuild runs as root. Claude Code v2.1.79 refuses to use --dangerously-skip-permissions with root/sudo privileges: '--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons' This caused ALL Claude Code invocations to silently fail with empty output, resulting in 0 tokens, 0 tool calls, and artificially low scores in any CI/CD environment running as root. Fix: Replace --dangerously-skip-permissions with --permission-mode bypassPermissions, which achieves the same effect but is allowed for root users.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CodeBuild (and many CI/CD systems) runs as root. Claude Code v2.1.79 refuses
--dangerously-skip-permissionsfor root users:This causes ALL Claude Code invocations to silently produce empty output (0 tokens, 0 tool calls), resulting in artificially low eval scores.
Fix
Replace
--dangerously-skip-permissionswith--permission-mode bypassPermissionsin both_build_cmd_with_skill()and_build_cmd_without_skill(). This achieves the same permission bypass but is allowed for root users.Testing
--permission-mode bypassPermissionsworks with Claude Code