Saltar al contenido principal
CodeRelayHub

← Volver al digest de ingeniería

Split Work Between Gemini CLI and Claude Code

Running two coding agents against the same repository can accelerate work, but only when their responsibilities do not overlap. A useful starting arrangement is Gemini CLI for investigation and independent review, with Claude Code responsible for implementation. This is a workflow choice, not a claim that either tool is inherently better at a particular task. Adjust the split using results from your own repository.

1. Define one outcome and two bounded assignments

Start with an issue that has observable acceptance criteria. For example: add cursor pagination to an endpoint while preserving authorization checks and existing response fields. Give both agents the same requirements, but different deliverables.

  • Gemini CLI: Locate the request handler, storage query, response serializer, and relevant tests. Produce a file map and identify compatibility risks. Do not edit files.
  • Claude Code: Implement the agreed change, add regression tests, and report the commands executed and their results.

Avoid asking both agents to “solve pagination.” That creates competing patches instead of complementary work.

2. Separate client setup from model selection

Gemini CLI and Claude Code are agent clients, not interchangeable names for the models behind them. Their permissions, repository instructions, tool behavior, and configuration conventions matter independently of model choice.

CodeRelay Hub provides pay-as-you-go access through one endpoint, with the API base https://api.coderelayhub.com. Use the documented integration for each client rather than assuming that an OpenAI SDK configuration can be copied unchanged into either CLI. Confirm the required protocol, authentication settings, model identifier, and endpoint path before starting repository work.

If you select Gemini 3.1 Pro for investigation and Claude Sonnet 5.5 for implementation, treat those selections as an initial configuration to evaluate, not evidence of a guaranteed quality advantage.

3. Ask for an evidence-based repository map

Have Gemini CLI inspect only the files needed to understand the change. Request exact file paths, relevant symbols, current behavior, and unresolved questions. Ask it to distinguish code it actually inspected from assumptions.

A useful instruction is: “Trace how this endpoint reaches the database and returns its response. Identify authorization boundaries, ordering guarantees, and tests that constrain pagination. Do not modify the repository. Return a concise implementation brief with supporting file references.”

Review that brief yourself. A plausible explanation is not sufficient evidence that the agent found the active execution path.

4. Hand off a compact implementation contract

Pass Claude Code the reviewed brief rather than the entire investigation transcript. Include the objective, permitted files, invariants, acceptance checks, and open questions. Specify exclusions such as dependency upgrades, unrelated refactoring, and generated-file changes.

For pagination, the contract might require stable ordering, rejection of malformed cursors, unchanged authorization behavior, and tests covering empty pages and repeated requests. If the desired behavior remains ambiguous, resolve it before authorizing edits.

Keep the contract in a task document or issue comment so both agents can reference the same version.

5. Give one agent ownership of the working tree

Let Claude Code edit while Gemini CLI remains read-only. Two agents modifying the same checkout can overwrite changes or invalidate each other’s assumptions. For genuinely independent implementation tasks, use separate branches and worktrees, then integrate through ordinary code review.

Approve tool permissions deliberately. Repository access does not imply permission to read secrets, contact production services, install dependencies, or run destructive commands. Require explicit approval for actions outside the agreed scope.

6. Review the patch independently and run checks

After implementation, ask Gemini CLI to review the diff against the contract. Request concrete findings: affected file, failure scenario, severity, and suggested verification. Tell it not to rewrite the patch.

Have Claude Code evaluate each finding and make justified corrections. Then run the relevant tests, formatting checks, and static analysis in your actual environment. Record which checks passed, failed, or could not run. Agreement between agents is not a substitute for execution.

7. Keep the split only if it reduces friction

For each completed task, note review effort, duplicated investigation, missed requirements, and available usage data. If the handoff costs more effort than it saves, use one agent. Reserve the two-agent pattern for work where independent investigation or review meaningfully reduces uncertainty.

Open a free workspace on CodeRelay Hub.

Pruébalo con una tarea real: crea un espacio de trabajo y usa el saldo de prueba.

Registrarse