Codex bridge
alc --codex <agent> starts a loopback adapter and points one agent's session
at it. One codex login serves every agent alc launches. The Antigravity CLI
keeps its own Google login for its own models and gains the Codex models next to
them (On the Codex login). The same bridge
also puts every other agent, Claude Code included, on that Google login:
alc --agy <agent> (Antigravity).
codex login
alc --codex claude
alc --codex opencode # or pi, copilot, goose, qwen, kimi
alc --codex agy # the Codex models in agy's own /model picker
| Agent | What the bridge serves it | How it picks a model |
|---|---|---|
| Claude Code | Anthropic Messages | /model picker, mid-session |
| OpenCode, Pi, Kimi Code CLI | OpenAI Responses | one model, chosen at launch |
| Copilot CLI, Goose, Qwen Code | OpenAI Chat Completions | one model, chosen at launch |
| Antigravity CLI | Its own Code Assist API, beside its Google models | /model picker, mid-session |
Claude Code and the Antigravity CLI can switch mid-session, because they name
the model and effort in every request, so alc pins neither on the adapter.
agy is pointed at the adapter with CLOUD_CODE_URL and lists one Codex entry
per effort; whatever is not a Codex model goes on to Google. The others are
wired through the same mechanism each already uses for the openai
kind, pointed at the adapter with a placeholder key — see
Agents for what each one receives.
Models
Claude Code lists these in its own /model picker:
| Model | Use case | Codex default effort |
|---|---|---|
gpt-6.1-sol | GPT-6.1 Sol. Latest workhorse for coding and everyday work; recommended starting point | low |
gpt-6-astra | GPT-6. Complex, demanding work | medium |
gpt-6-sol | GPT-6. Everyday coding and agentic work | medium |
gpt-5.6-sol | Previous generation; complex professional work | low |
gpt-5.6-terra | Previous generation; balanced everyday coding | medium |
gpt-5.6-luna | Previous generation; fast, affordable work | medium |
gpt-6-luna | GPT-6. Fast and the cheapest; quick fixes and high-volume work | medium |
See OpenAI's GPT-6.1 Sol reference and GPT-6 Luna reference for current upstream details.
The bridge keeps no allowlist: whatever slug it is handed goes upstream and
chatgpt.com decides, so a model alc does not track is still reachable with
--model. That is why a new model works on the day Codex ships it rather than
on the day alc catches up.
Every Claude model becomes a Codex model
Under alc --codex claude no request reaches a Claude model: the /model
picker lists these seven, plus any models discovery adds. Every alias Claude
Code has — opus, sonnet, haiku, fable, best, opusplan — lands on a
Codex model, and a Claude model named in full is answered by the same tier.
opus and fable use GPT-6.1 Sol; haiku and small-fast work stay on GPT-6 Luna;
sonnet follows the session's starting model.
Claude Code's own background work goes the same way, so a title or a summary is
Codex quota rather than a request to Anthropic. Background
sessions has
the whole table, alias by alias.
Effort
/model's left and right arrows move the effort slider; /effort sets one
directly. Every model takes low, medium, high, xhigh or max. Higher
effort gives the model more room to reason, and uses more of your quota.
Every model but the two Lunas also offers ultra, which native alc codex can
reach but the bridge cannot. alc clamps it to max and says so at launch,
rather than letting the request be refused mid-session.
Context window
Each model starts on the window Codex itself gives it: 500K tokens for GPT-6.1
Sol, 272K for the others. Every one of them can run with up to 872K, and
--context max asks for that:
alc --codex claude --context max # this run only
alc config upsert codex --context max # the Codex profile's default
Past the standard window a turn uses your plan limits faster. OpenAI documents
the larger window as opt-in in Codex too (model_context_window in Codex's own
config), and alc keeps it opt-in the same way: standard is the default and is
never written, max is saved as context = "max" on the Codex profile, and
the configuration TUI has a
Context row for it right after Reasoning effort.
alc models prints both numbers — Codex context: 500K (max 872K) — and
alc doctor adds / max context to the bridge row of a profile set to it. The
profile's choice reaches every agent on the bridge, not only Claude Code. The
per-run --context, like --effort, belongs to alc claude and is refused
off a Codex or Antigravity provider.
Starting somewhere else
An unconfigured session starts on GPT-6.1 Sol at low effort. A model or effort
you already selected on the alc profile or in your Codex config still wins.
alc --codex claude --model gpt-6-luna --effort low
alc --codex claude --model gpt-6.1-sol --effort low --save
alc --codex claude --context max --save
--save stores the model, the effort and the context choice on the provider
profile. Without them a session starts on the profile's values, then the
selected Codex profile, then the model's own default; the context choice comes
only from --context or the profile, and is the standard window otherwise.
Anything after -- goes to the agent untouched and wins.
A model chosen with /model applies to that session only; the next launch
starts from the profile again.
Your plain claude still reaches Anthropic
Claude Code writes the model you settle on to ~/.claude/settings.json as your
default for new sessions, and every session on the machine reads that file —
including the ones alc did not start, which have no adapter in front of them
and would ask Anthropic for a GPT model.
alc reads that one key before the launch and puts it back when the session exits. Nothing else in the file is touched, and nothing is written at all unless the value it finds is one only the adapter can serve.
Two cases it leaves alone. A real Claude model you switched to mid-session is
your choice about your own default, so it stands. A session killed outright
runs no cleanup — alc doctor names the file and the line, and the next
bridged launch clears it.
Do not try to isolate this with CLAUDE_CONFIG_DIR: that moves Claude Code's
whole configuration home, login included.
Model catalog
Synced from your ChatGPT account — the same party the adapter posts every turn
to — so a model that account can drive is offered even when the installed Codex
CLI has never heard of it. codex debug models is the fallback when that fetch
cannot happen, and the catalog bundled into the binary is a floor neither of
them can drop below: a synced list may add models, never remove one. The sync
runs once a day, and again as soon as Codex is upgraded.
alc declares at least Codex client version 0.160.0, the client the bundled
catalog was captured with, or your installed version if newer. This operational
floor is separate from the upstream model row's literal minimal_client_version
of 0.153.0; you do not need to upgrade Codex just to see the bundled model.
alc models
alc models --refresh
alc models --json
The window the profile chose — the model's standard one, or its maximum under
context = "max" — reaches Claude Code as
CLAUDE_CODE_MAX_CONTEXT_TOKENS,
so a GPT model compacts at the real Codex limit rather than the 200k Claude
Code assumes for an ID it does not know. The other agents get the same number
in their own window fields, and alc --codex --dry-run claude shows it in the
settings it would pass.
Auto mode and prompt caching
No setup or extra flags are needed.
Auto mode still works. Codex cannot perform Claude Code's server-side check,
so Claude Code uses its own classifier instead, running on the session's model.
Classifier calls go through Codex and consume Codex quota. Every other provider
except the anthropic kind works the same way — see Auto mode on every
provider.
Prompt-cache routing is automatic. alc keeps a Claude Code session on a stable Codex cache route. Reuse still needs the same prompt prefix, so changing the model, effort, tools or prompt, compacting the conversation, cache expiry, and Claude Code upgrades can cause misses.
Use alc usage to see what Codex actually reused. CACHED is the
number of input tokens read from cache, and CACHE % is their share of total
input—not a request hit rate. Cache reuse does not guarantee lower quota use or
billing.
After upgrading alc, start a new session to receive these defaults; running
background sessions keep their launch settings. Your own --settings can still
override alc's Claude Code defaults.
How it works
The bridge is alc's own code. For Claude Code it runs as a background process
of its own on a loopback port it keeps (alc bridge), because a session moved
into the background outlives the alc that started it — see Background
sessions. For every other
agent it runs inside the alc process on a random port, serving only the agent
it launched and stopping when that session ends. It reads and may refresh
~/.codex/auth.json; no credential is ever copied into alc's own
configuration. New helpers and hosts are pinned to their runtime generation;
updates leave existing hosts/session routes in place and new launches use the
new generation. New alc-managed refreshes lock the canonical auth path across
processes and reread after locking. Older hosts and external Codex CLI do not
cooperate with that lock, so shared-login rotation can still affect them.
This adapter is not an official OpenAI or Anthropic integration. Review the
project's THIRD_PARTY.md and your provider terms before using subscription
credentials through it.