Skip to content

[codex] Fix Claude Code auth preflight for Codex host - #1767

Closed
spacegeologist wants to merge 1 commit into
garrytan:mainfrom
spacegeologist:codex/fix-claude-codex-auth-preflight
Closed

spacegeologist wants to merge 1 commit into
garrytan:mainfrom
spacegeologist:codex/fix-claude-codex-auth-preflight

Conversation

@spacegeologist

@spacegeologist spacegeologist commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix the Codex-hosted gstack-claude skill so it does not reject a working Claude Code install just because $HOME/.claude/.credentials.json is absent.

With increased use of Codex, I have been experimenting heavily with the gstack setup and trying to smooth out the Codex <-> Claude Code handoff. This came from that dogfooding: claude -p works in the host environment even when .credentials.json is absent.

Root Cause

The generated Codex skill preflighted Claude authentication by probing an implementation detail: $HOME/.claude/.credentials.json or ANTHROPIC_API_KEY. Modern Claude Code auth may be stored in OS Keychain or another host-managed location, so credential-file probing can false-negative before the skill ever invokes Claude.

Fix

  • Remove the .credentials.json authentication preflight.
  • Treat the first claude -p invocation as the real auth check.
  • Parse Claude JSON output so is_error still surfaces CLAUDE_ERROR: true, and auth/login failures also surface CLAUDE_AUTH_ERROR: true.
  • Keep the generated Codex regression test from reintroducing .credentials.json probing.

Safety Boundary

The safety boundary is unchanged:

  • review/challenge modes still run tool-less Claude calls
  • consult mode remains read-only with Read,Grep,Glob
  • Bash, Edit, and Write remain disallowed

Validation

  • claude -p "Reply with exactly OK." --output-format json --disable-slash-commands --tools "" returned result: "OK" when run with host auth/keychain access.
  • bun test test/gen-skill-docs.test.ts -t "Codex output includes Claude outside-voice skill"
  • bun run scripts/gen-skill-docs.ts --host codex --dry-run
  • git diff --check

@time-attack

Copy link
Copy Markdown
Contributor

@16francej Merge this version because it passes the Mac checks and correctly handles Claude Code authentication preflight on the Codex host.

@capy-ai

capy-ai Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for this, @spacegeologist. The fix is now on main: the claude-code skill no longer checks ~/.claude/.credentials.json and only reports auth problems from a real invocation (claude-code/SKILL.md.tmpl) (fixed in v1.86.0.0, #2850). Closing as superseded; if you still see the problem on the latest gstack, please open an issue with ./setup --status output.

@capy-ai capy-ai Bot closed this Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants