Omnara + Claude Code Auth Failure On M3
Date: 2026-06-30
Context
M5 Omnara UI was used to create and inspect sessions running on M3-Laptop-Server.local.
Claude Code appeared signed in, but Omnara-created Claude Code sessions were failing with:
Claude Code: Failed to authenticate. API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid authentication credentials"}}
Example request IDs from failing UI sessions:
req_011CcaFXFZuKjoZ5Pf7KeDWTreq_011CcaFva6GMhQ5xgNyWT2ey
What Worked
- Direct Claude Code on M3 worked:
/opt/homebrew/bin/claude, version2.1.172. - Direct
~/.omnara/bin/omnara-claude, version2.1.118, worked. - Direct stream-json style runs with Omnara-like environment worked.
- Manual Omnara daemon started over SSH worked through the M5 Omnara UI:
env CLAUDE_CODE_SAFE_MODE=1 ~/.omnara/Omnara.app/Contents/MacOS/omnara daemon run-service
Verified successful UI sessions:
d927e245-a07a-4a3a-ba2e-4f642d6abf25returnedmanual daemon ui ok.243eee21-f068-413b-aa9d-576a16c779b4returnedno shim manual ok.
What Did Not Fix It
- Adding
CLAUDE_CODE_SAFE_MODE=1to the persistent LaunchAgent. - Wrapping the LaunchAgent in
/usr/bin/envwhile strippingXPC_SERVICE_NAME,XPC_FLAGS, andSSH_AUTH_SOCK. - Temporarily adding
~/.omnara/bin/claude -> ~/.omnara/bin/omnara-claude.
Current State
- Manual Omnara run-service PID on M3:
78942. com.omnara.daemonLaunchAgent is unloaded.- LaunchAgent plist was restored to its original file but not loaded.
clauderesolves to/opt/homebrew/bin/claude.claude --versionreports2.1.172 (Claude Code).~/.omnara/bin/claudeshim is absent.
This is a working workaround, not a durable fix. It likely will not survive logout or reboot.
Best Diagnosis
The failure appears specific to the Omnara daemon/session context when started by launchd. It does not look like a basic Claude login problem, wrong Claude binary, bad visible env var, or M5 UI problem.
Some hidden launchd/process/session context may be causing Claude Code to select or send invalid credentials even though the visible child environment did not show ANTHROPIC_API_KEY, Bedrock, Vertex, or related provider settings.
Questions For Omnara / Claude Code Team
- Does Claude Code have known differences when launched under macOS launchd versus a login shell or PTY?
- Which files or keychain entries does Claude Code read for subscription/OAuth auth, and can launchd context change which token store is selected?
- Does Omnara's daemon or Claude wrapper ever inject, cache, or translate Anthropic credentials separately from the user's Claude Code login?
- Can Omnara expose the exact Claude child process argv, environment, parent PID chain, stdio type, and resolved auth source for failed runs?
- Are 401 request IDs enough for Anthropic/Claude Code support to identify whether the request used OAuth, an API key, or some invalid cached credential?
- Is
CLAUDE_CODE_SAFE_MODE=1expected to affect auth behavior, or only shell/tool initialization? - Is there a supported way for Omnara to start its daemon from a login-shell/PTY-equivalent context on macOS?
Suggested Next Tests
- Compare full process ancestry, session, TTY, and security context for a working manual daemon versus failing LaunchAgent daemon.
- Test a persistent wrapper that starts Omnara run-service from a login shell or tmux/PTY context rather than directly from launchd.
- Instrument the Claude child process under both daemon modes: argv, cwd, env, stdio, parent PID chain, and config/cache paths.
- Re-test after a full M3 logout/reboot to confirm the workaround is not persistent and the LaunchAgent path still fails.
- Try a second authenticated macOS user or clean Claude Code config only if the team thinks token-store selection is the likely cause.