fix: remove --bare flag that breaks auth#198
Merged
kris-hansen merged 1 commit intomainfrom Mar 28, 2026
Merged
Conversation
The --bare flag skips OAuth/credential loading, causing 'Not logged in' errors when running Claude Code in -p mode. Removing it restores normal auth behavior while keeping the other agentic flags.
PR Analysis
PR Feedback
How to useInstructions
|
| // --bare skips hooks, plugins, MCP server discovery, and OAuth | ||
| args := []string{"-p", "--bare"} | ||
| // Start with -p for subprocess/one-shot mode and for subprocess mode | ||
| // Note: --bare was removed as it breaks auth on some Claude Code versions |
There was a problem hiding this comment.
Consider adding a comment or a log entry to indicate the removal of the --bare flag and its impact on authentication, to help future developers understand the reason behind this change. [medium]
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.
PR Type:
Bug fix
PR Description:
--bareflag from the command line arguments in thebuildArgsAgenticfunction to fix authentication issues.--bareflag.--bareflag was causing 'Not logged in' errors by skipping OAuth/credential loading.PR Main Files Walkthrough:
files:
utils/models/claudecode.go: Removed the--bareflag from theargsarray in thebuildArgsAgenticfunction. This change ensures that OAuth/credential loading is not skipped, thereby fixing the authentication issues.utils/models/claudecode_test.go: Updated multiple test cases inTestClaudeCodeBuildArgsAgenticto remove the--bareflag from thecontainsarray. This aligns the test expectations with the updated behavior of thebuildArgsAgenticfunction.User Description:
The
--bareflag skips OAuth/credential loading, causing 'Not logged in' errors when running Claude Code in-pmode.Symptoms:
claude -p --bare ...returns:{"result":"Not logged in · Please run /login"}Root cause:
--barewas added based on research suggesting it provides 'deterministic subprocess behavior' but it also skips auth loading.Fix: Remove
--bare, keep other flags (-p,--dangerously-skip-permissions,--allowedTools,--output-format json).