Relay: A Tool for Handing Off Claude Code Sessions to Other AI Agents

Relay is a tool that addresses a common issue for Claude Code users: when a session hits its rate limit, the entire context is lost, forcing users to restart with another agent. Relay captures the session context and hands it off to a different AI agent, allowing work to continue without interruption.
How It Works
Relay is a Rust binary (4.6 MB) that reads Claude Code's session transcripts directly from ~/.claude/projects/ JSONL files. It extracts:
- The full conversation (last 25 turns by default)
- Every tool call—files Claude read, wrote, or edited
- Every error Claude encountered
- TodoWrite state (what's done and in progress)
- Git branch, diff, and uncommitted files
- Key decisions Claude made
It then opens an interactive session with the new agent, which acknowledges the restored context and asks for next steps.
Usage and Features
The basic command is:
relay handoff --to codexAdditional options include:
--turns 10to control how much conversation context is transferred--include git,todosto select specific context elements- A PostToolUse hook for automatic detection of rate limits
Relay includes an interactive TUI with spinners, an agent picker, and color-coded output. Capture time is under 100ms.
Supported Agents
Relay supports 8 agents:
- Codex
- Claude (new session)
- Aider
- Gemini
- GitHub Copilot
- OpenCode
- Ollama (local)
- OpenAI API
Installation
Install via:
git clone https://github.com/Manavarya09/relay
cd relay && ./scripts/build.sh
ln -sf $(pwd)/core/target/release/relay ~/.cargo/bin/relay
relay initOr via npm: npm i @masyv/relay
Context
Relay is the fourth plugin in the author's Claude Code toolkit, which also includes TokenForge (for token compression via AST parsing) and SecretScan (a 47-pattern secret detector). All tools are open source and written in Rust.
📖 Read the full source: r/ClaudeAI
👀 See Also
Claude Code vs Codex: 36 vs 28 files, $2.50 vs $2.04, infinite loop caught — real-world comparison
A developer runs the same two tasks on Claude Code and Codex (Cursor): PR triage bot and real-time code review UI. Results: 36 vs 28 files, $2.50 vs $2.04 cost, Claude produced fewer TypeScript errors, Codex had an infinite React loop.

Claude-Code v2.1.111 adds Opus 4.7 xhigh effort, /ultrareview, and PowerShell tool
Claude-Code v2.1.111 introduces the Opus 4.7 xhigh effort level between high and max, adds the /ultrareview command for cloud-based multi-agent code reviews, and begins rolling out PowerShell tool support on Windows. The update also includes interactive /effort controls, auto theme matching, and numerous bug fixes.

Agent Times Skill for ClawHub Adds Real-Time News, Weather, and Token Price Queries
A new ClawHub skill called Agent Times enables AI agents to answer real-time queries about news, weather, and cryptocurrency prices. Installation is via npx clawhub install agenttimes, and it provides access to 228K+ articles from 3,576 feeds with sentiment scoring and entity extraction.

OpenClaw iOS app adds historical Apple Health data sync up to 18 months
The latest version of the OpenClaw iOS app enables historical Apple Health data export, allowing users to sync up to 18 months of health data to their agent for personalized insights or AI training.