Can Claude Code ask Codex for a second opinion before it changes my code?
Get a second opinion from another coding agent
Yes. In Trek, Claude Code can ask Codex, or another agent or model you have set up, for a read-only review before it changes anything, then decide what to do. It can also hand a scoped task to a sub-agent, or start a thread of your own for longer work. Without Trek, Claude Code can run codex exec, which is read-only by default, or use OpenAI’s Codex plugin, whose review commands check changes Claude has already made.
Ask another agent before it changes code
The composer has a Consult button. Its menu lists the models you can ask, each with its reasoning effort, then two settings: how they work together, and what happens after.
How they work together
- Advise: they review and suggest, and the thread’s agent decides.
- Discuss: the thread’s agent and the models it asks go back and forth until they agree, for three rounds at most.
- Arena: the thread’s agent sets out the problem, two to four models each draft a design on their own, another model judges them without knowing whose is whose, and the thread’s agent builds on the best.
What happens after
- Then implement: the thread’s own agent makes the change.
- Just report: it stops and tells you, without changing files.
Pin the choice to keep it for every message. You can also type it, as in /consult sol high, opus max: your message, with each model and its effort before the colon.
Trek tells the thread’s agent to ask them read-only. An advising sub-agent runs at Supervised, which asks before every edit and command, and Trek declines each of those requests on the spot. A plan it offers becomes its advice.
The agent it asks sees only the brief the thread’s agent writes, not your conversation. It reads the files itself, in the same folder. A thread on an API key or a local model can’t start a consult, because those models can’t use Trek’s tools, but they can be asked.
Without Trek, the Codex plugin or codex exec
OpenAI’s Codex plugin for Claude Code runs Codex from a Claude Code session, according to its README on 4 December 2026. /codex:review and /codex:adversarial-review are read-only Codex reviews of changes Claude has already made, and /codex:rescue hands Codex a task. An optional review gate runs a Codex review each time Claude stops, and the README warns that it can drain usage limits quickly. The plugin needs a ChatGPT plan, Free included, or an OpenAI API key.
With no plugin, Claude Code can run codex exec from its shell, which runs read-only by default. The side-by-side guide shows the commands.
Sub-agents
Claude Code has subagents of its own. Each runs in its own context window with its own prompt and tools, on the Claude model you set for it. In Trek, an agent can hand a task to another agent or model, Codex included, through Trek’s delegate_task tool. The sub-agent is a thread of its own that runs in the same folder, worktree included. It shows as a row in the parent’s transcript, with its agent’s logo, its state and a clock. Open it to follow along, or stop it.

- To advise, a sub-agent is read-only.
- To implement, it changes files and asks for approval the way its parent thread does.
- When it needs your approval, the parent shows Sub-agent “name” is asking with Open it, and the Inbox row says Sub-agent needs you.
Threads of your own, and handoff
For longer work, an agent can start a thread of your own in the sidebar with start_thread: in this project, in another project Trek knows, or in a new git worktree. It can follow and steer the threads it started. When one finishes while you’re elsewhere, Trek says so, with Open thread.
When its context runs low, an agent can hand off: it writes a short brief, and Trek starts a fresh thread in the same folder with that brief as its first message. Both threads link to each other.
Limits
| What | Limit |
|---|---|
| Sub-agents running at once, per thread | 4 |
| Sub-agents per message you send | 12 |
| Sub-agents of sub-agents | One level, then no more |
| Threads an agent started, working at once | 8 |
| Threads an agent may start per message you send | 16 |
| Handoffs in a row with no message from you | 3 |
Who can be asked
Any agent and model you have set up in Trek, which means Claude Code, Codex, OpenCode, Droid, Cursor, GitHub Copilot and other ACP agents, and API and local models. Each runs on your own sign-in or key, so its answer counts against that agent’s plan or that key’s usage.
Google’s agents on a personal Google plan are the exception. These are Gemini CLI signed in with a Google account, and Antigravity CLI, and they run only in threads you drive yourself. Gemini CLI’s terms say that using its Google sign-in through third-party tools breaks them. In a thread you drive, Trek runs Google’s own CLI through its ACP mode, which signs in itself, and Trek never reads the token. Antigravity’s terms, read on 4 December 2026, allow calling the unmodified CLI as a subagent, but Trek still treats both the same. It leaves them out of Consult and refuses to delegate to them.
The tools, and turning them off
All of this comes from one MCP server Trek gives each session, trek-orchestrate. Its tools include list_models, delegate_task, task_status, task_result, cancel_task, start_thread, send_to_thread, read_thread and handoff.
Turn off Sub-agent tools in Settings › Tools & MCP › Sub-agents, and agents can no longer start others. Consult is off then too.
Questions
What does the thread’s agent get back from the one it asks?
Its last message, after any plan it offered. Trek tells each one that only its last message goes back, so it puts its findings first, then recommendations with file paths.
What if the agent it asks has used up its usage limit?
Trek doesn’t start it, and tells the thread’s agent which limit is used up and to pick another agent.
Can Gemini CLI be consulted?
Not when it is signed in with a personal Google account, because its terms rule out using that sign-in through third-party tools. You can still use it in a thread yourself, and a Gemini model on an API key can be consulted.
Sources
- Consult and sub-agent limits (crates/trek-core/src/orchestrate.rs)
- The trek-orchestrate tools (crates/trek-ipc/src/lib.rs)
- The personal Google plan rule (crates/trek-core/src/google.rs)
- Advice is read-only, and usage limits (crates/trek-app/src/workspace/orchestrate.rs)
- Codex plugin for Claude Code
- Antigravity terms, section 6
- Gemini CLI terms and privacy
- Create custom subagents, Claude Code docs
- Non-interactive mode, Codex docs
- What sub-agents see (crates/trek-mcp/src/orchestrate.rs)
- Thread and handoff limits (crates/trek-core/src/lineage.rs)
- Google sign-in is never read (crates/trek-core/src/google.rs)