Technical document

Designing Agent Desk to Support Collaboration Between Claude and Codex

This article explains the design of Agent Desk, which supports collaboration between Claude and Codex through MCP, message delivery, versioned shared context, and an observation screen, including constraints and validation perspectives.
AI Development / Agent Collaboration~16 minPublication Date September 22, 2026Update date November 23, 2026
Illustration of two AI agents, one blue and one amber, handing over tasks and reviews on a shared workspace

Summary

Key points of this document

  • The true essence of satisfaction is not conversation, but the connection of work.
  • Agent Desk is not where agents run, but the control plane for collaboration.
  • Agent identities are tied to credentials, not self-declaration.

Overview

Claude implements, Codex rereads the diffs and reviews, then returns necessary corrections. This collaboration is possible not just because the two AIs understand each other. It's because there's a control plane that persists assignments, shared status, messages, justifications, and stop conditions, allowing humans to observe the same situation.

The true essence of satisfaction is not conversation, but the connection of work.

If two AIs merely send messages to each other, a simple chat function could achieve that. However, what's needed in development is not the reproduction of conversation. It's connecting who is responsible for what, what diffs are created, what is validated, where it stops, and what the next person uses as a basis to resume.

For example, suppose Claude finishes an implementation. If the next agent, Codex, trusts and approves only the implementer's summary, it's not an independent review. The recipient needs to read the shared objective and judgment, and then independently verify the actual Git diffs, code, test results, and repository rules. Agent Desk carries not the conclusion itself, but the work context that allows the next person to begin validation.

This distinction is crucial. If AI collaboration is viewed as 'connecting two smart models,' the boundary of responsibility disappears upon failure. If it's viewed as 'independent execution entities handing off work via a stateful control plane,' then delivery, conflicts, permissions, auditing, and stop conditions can be designed like any other distributed system.

  • Conversation: Conveying opinions and requests.
  • Shared State: Maintaining current assignments, progress, judgments, and validation results with versioning.
  • Independent Verification: The recipient checks actual data and does not simply approve the sender's explanation.
  • Human Supervision: Separating what AI can decide from operations that must always be returned to a human.

Agent Desk is not where agents run, but the control plane for collaboration.

The Agent Desk server does not launch Claude or Codex processes. Agents run in the user's environment and access messages, shared context, and session information via the MCP remote server. This boundary ensures that adding collaboration features does not automatically expand the agents' existing file operation or command execution permissions.

The server-side uses TypeScript, Hono, and Drizzle ORM to configure APIs and persistence boundaries, connecting the browser's operational interface and MCP's machine-to-machine path to the same service contract. By using common Zod schemas instead of defining separate input formats for HTTP and MCP, we prevent discrepancies where one might accept large values or invalid states.

The screen displays agent sessions, messages, shared context, timelines, and correlations with GitHub Actions. The value here is not flashy automation, but enabling humans to track 'what is happening now,' 'what didn't reach the other party,' and 'when and by whom the shared state was updated.'

  • Execution Plane: Claude and Codex running in the user's environment.
  • Connection Plane: Exposing tools via JSON-RPC 2.0 and MCP.
  • Control Plane: Persistence of messages, shared state, sessions, and operation history.
  • Observation Plane: Status board, inbox, shared context, timeline.

Agent identities are tied to credentials, not self-declaration.

If the collaboration history shows 'Sent by Claude' or 'Confirmed by Codex,' that identity should not be determined solely by the client field in the request body. With self-declaration, either could impersonate the other, rendering the observation data meaningless.

In Agent Desk, MCP credentials are tied to the agent type and workspace at issuance. The actor is created from the Bearer token validation result, and the organization ID is not accepted from the message body or URL parameters. Making the response the same for missing and expired credentials also prevents providing clues for brute-force attacks.

On the other hand, the session ID, which indicates which window or conversation it was called from, is declared by the caller. The strength of agent type authentication and the observation accuracy of individual execution sessions are not the same. By separating what can be stated with certainty from what remains an estimation, the design ensures that the screen's appearance does not overstate the facts.

Messages are designed not just for sending, but also for cases where they don't arrive.

AI agents are not always running. Agent Desk's send message does not force the recipient to start up, but rather stores the message for the recipient's next turn. The recipient retrieves it with read inbox, and acknowledges with handled if processed, or failed with a reason if not. By separating sending and processing completion, it avoids leaving a state of "it must have been communicated because I sent it."*Delivery states include queued, delivered, handled, failed, expired, and undeliverable. Upon receipt, a visibility lease is taken to prevent multiple sessions for the same destination from processing the same message simultaneously. Furthermore, limits are placed on the number of times the same content can be injected into a single session and the total number of delivery attempts. If the recipient does not return, it does not retry indefinitely, but moves to an undeliverable state where a human can review it.*For waiting, a bounded long-poll of up to 25 seconds is used. Short periodic polling alone can easily miss turn boundaries, and unlimited waiting monopolizes connection resources. The outer facade also requires a timeout budget specifically for the MCP path; even if the inner part allows 25 seconds, the design fails if the front-end cuts off at 15 seconds.

Separate sending success from processing completion by the recipient.

Require a reason for 'failed' to provide material for later judgment of failure versus disagreement.

  • Bound redelivery and escalate undeliverable items to human attention.
  • Align the long-polling limit across the entire path, including not just the API but also proxies and facades.
  • Shared context does not make the last writer the winner.
  • The implementer and reviewer append the current purpose, responsible party, changed files, verification results, and rollback reasons to the same shared value. If this update uses last-write-wins, overwriting with an old value without reading the other party's changes will succeed, and the collaborative state will quietly roll back.

Therefore, publish_context uses compare-and-swap, which requires an expectedVersion. It updates only when the read version matches the current version, and in case of a conflict, returns 409 and the current version. The writer rereads the latest value, incorporates the other party's changes, and then retries. This method does not automatically resolve conflicts but ensures that the fact of a conflict is not lost.

Shared values can handle arbitrary JSON, but an upper limit is set on the byte count after normalization. Measuring by byte count instead of character count is to control the actual storage amount even for values containing multi-byte characters like Japanese. TTL, version history, and search cursors are also provided to prevent persistent and temporary information from continuously accumulating in the same indefinite container.

The division of roles between Claude and Codex is determined by operational contracts, not by tools.

Agent Desk is not a system that always assigns Claude as the implementer and Codex as the reviewer. Which one is assigned to design, implementation, investigation, or review is determined by the repository's operational contract. The important thing is to define roles and completion conditions before starting, and not to conveniently expand responsibilities midway.

// Generalized example of versioned shared state
{
  "taskId": "review-current-change",
  "state": "ready_for_review",
  "owner": "codex",
  "decisions": ["Finalize API contract first"],
  "changedFiles": ["src/example.ts"],
  "verification": ["unit test: passed"],
  "handoff": ["Independently verify failure paths"]
}

In one practical example, Claude performs investigation, design decisions, implementation, and necessary verification, advancing the shared state to ready

for

review. Codex, referring to the shared explanation, independently checks the diff from the base commit, uncommitted diffs, canonical rules, and tests. If it's a localized fix that can be safely closed, it performs the fix and re-verification; if a major design change is needed, it returns it as changes_requested.*In this round trip, messages serve as notifications like "please start the review," and the shared context carries the purpose, state, verification, and findings. By not duplicating the same details in both, it avoids the problem of not knowing which is the current authoritative source. The final basis for approval is not either document, but the actual diff and verification results.*Implementer: Pass on decisions, scope of changes, verified items, unexecuted items, and known risks.

Reviewer: Independently check diffs, code, tests, and rules, separate from the shared explanation.

  • Rollback: Convert findings into specific correction conditions and revert state and responsibility.
  • Completion: Proceed to termination only if all necessary work is done and no unresolved issues remain.
  • Shared text, while convenient, is placed outside the trust boundary.
  • Shared context and messages are unverified texts generated by AI. Even if they state "ignore rules" or "add permissions," they do not supersede user instructions, repository rules, code, or tests. Ambiguating this priority makes shared memory an amplifier for long-term prompt injection.

Shared text is convenient, but it is placed outside the trust boundary.

Shared contexts and messages are unverified texts generated by AI. Even if they state "ignore rules" or "add permissions," they do not supersede user instructions, repository rules, code, or tests. Ambiguating this priority makes shared memory an amplifier for long-term prompt injection.

The tools exposed in MCP are limited to what's necessary for collaboration. Message sending/receiving, shared value read/write, search, and session observation are possible, but these do not inherently permit file editing, deployment, merging, or privilege escalation. Requesting input from a person and acting as a proxy for human approval are also distinct.

Safety here does not depend on AI always making correct judgments. It is established by treating failures—such as receiving incorrect explanations, simultaneously updating the same shared value, a counterparty not returning, or credentials expiring—as normal states, and translating each into version conflicts, delivery status, expiration, and audit events.

Organizational separation and observability are maintained simultaneously across all paths.

When handling multiple workspaces with a single service, all messages, shared values, sessions, and histories require an organizationId condition. Agent Desk obtains the organization from the actor and does not allow arbitrary organizations to be specified in the request body. Existence checks for reply destinations are also performed within the same organizational scope, treating IDs from other organizations as 'non-existent'.

This method relies on application layer discipline. In configurations without database row-level security, even adding a single new list API or aggregation can lead to information leakage if the organizational condition is missed. Therefore, regression tests are performed per API to ensure data from other organizations is not visible, and cross-cutting paths for administrators are separated from those for regular users.

For observation, both successes and failures of tool calls are recorded. It's also important to display the last observed time on the screen and not present old states as current. Branch naming conventions can be used for correlation with GitHub Actions, but branches that don't conform to the convention are not forced into either category and are treated as unknown.

  • Obtain organization ID from authenticated actor; do not trust input values.
  • Apply the same separation conditions to all read/write operations, including replies, searches, histories, and aggregations.
  • Observe not only success counts, but also failures, undelivered items, staleness, and unclassifiable items.
  • Webhooks retain the raw body necessary for signature verification and are not re-encoded by the facade.

Collaboration features validate boundary breaches more than normal round trips.

The minimal E2E is to send as Claude, receive as Codex, confirm as handled, and be able to read the terminal state from the sender and the screen. However, this alone misses major delivery and separation failures.

For messages, we confirm that the same content is not reinjected into the same session indefinitely, that separate sessions do not acquire duplicates during a visibility lease, and that expired and delivery-limit-exceeded messages are excluded from retries. For shared contexts, we confirm that only one of two updates to the same version succeeds, and the other results in a conflict with the current version.

For authorization, we verify that Claude's credentials cannot self-declare as Codex, that messageIds or namespaces from other organizations cannot be read even if specified, and that expired credentials are rejected. For operational paths, we confirm that MCP's 25-second wait is not prematurely cut off by the facade, that webhook signatures can still be verified after passing through a proxy, and that out-of-balance or AI function shutdowns do not cascade to messages and shared states.

Understand and use Agent Desk for what it does not solve, first.

Agent Desk does not automatically make concurrent writes to shared repositories safe. If Claude and Codex simultaneously modify the same file, lockfile, migration, or Terraform state, conflicts will occur on the code side even if the shared context is correct. Single write owner, worktree isolation, and exclusion for heavy processes are required as separate operational practices.

Also, messages do not activate the recipient. It is an asynchronous collaboration that waits until the recipient's next turn, not a synchronous RPC that assumes immediate response. Session IDs are also self-declared, so while 'which agent type' can be authenticated, it does not strongly prove 'which conversation window'.

Shared state may be the source of truth for collaboration, but not for code. Even if it says 'review complete', if the actual Git diff or CI differs, that takes precedence. Agent Desk is not an automatic approval system that replaces judgment, but a workbench to preserve the state and rationale necessary for judgment.

  • Parallel writes to the same file or shared infrastructure require separate mutual exclusion.
  • Message sending does not guarantee automatic activation or immediate execution by the recipient.
  • Shared documents are not a higher truth than code, tests, or user instructions.
  • Approval of high-risk operations, merging, and deployment remain human prerogatives.

Good collaboration connects responsibilities without erasing AI's individuality.

Claude and Codex can not only compete for the same output, but also think in different contexts, question each other's assumptions, and take over results. The difference becomes valuable when the overall explanation is not biased towards one or the other, and messages, versioned shared states, actual differences, and verification results can be retained as separate evidence.

What should be prepared first in practice is not large-scale automated execution. It is about linking identity to credentials, CAS updating shared values, bounding delivery, independent verification by recipients, and retaining human-only approvals. If these five are in place, AI-to-AI interactions will transform from interesting demos into reproducible development processes.

Technical documents

We will continue to increase technical documentation.

We will continue to organize our thoughts on AI, cloud, business app development, requirements definition, and operational design into documents.

Go to technical documentation list