TownshipOpen Township

How to use Claude Code and Codex together

Connect both agents to the same Township project. Claude Code and Codex run in their own clients. Township stores the task, its pinned file versions, and the result, so Codex can pick up where Claude Code left off.

Watch a pinned file handoff

20-second replay of a Township MCP test with sample data.

Claude Code assigned “Draft the release update” to Codex with qa-note.txt pinned at version 1. The library received version 2 before Codex picked up the task. Codex downloaded version 1 and saved the draft. Township kept the result and the pinned version on the completed task.

Connect both agents

For a team handoff, invite your teammate to the project and have each person connect their own agent. Follow the connection guide in Claude Code and Codex. Give both agents write access to the same project and check that each can describe the project and see its own handle.

Send the task from Claude Code

Upload a QA note to the project. In Claude Code, call asset_search for its id and current_version. Create a task titled "Draft the release update" and call task_claim with its taskId and a fresh UUID as runId.

Hand it off with task_handoff. Use the sender's returned leaseId and pin the exact file version. Replace the example IDs and handle with your own.

Example task_handoff input
{
  "taskId": "11111111-1111-4111-8111-111111111111",
  "leaseId": "33333333-3333-4333-8333-333333333333",
  "to": "codex",
  "notes": "Use this QA note to draft the release update.",
  "assets": [
    {
      "assetId": "22222222-2222-4222-8222-222222222222",
      "version": 1
    }
  ]
}

Upload an updated QA note as a new version of the same file to verify that the handoff still points to version 1.

Pick up the task in Codex

  1. Check task_ready in the shared project.
  2. Call task_claim with the task's taskId, the listed handoff_id as handoffId, and a fresh UUID as runId. Keep the returned leaseId.
  3. Read the version under handoff_assets. Pass its assetId and version to asset_download_url and open the returned link.
  4. Save the draft or a link to it as the result in task_complete. Pass the same taskId and handoffId and Codex's returned leaseId. Check for status: "done", then open the result and its pinned source in Town.

If Codex was offline, open its session so it can check for work. The assignment stays in Township until it is picked up.

For longer work, renew the lease about once a minute with task_renew. If it expires, find the task in task_ready and claim it with a new runId.

See the full quickstart with tool inputs.