npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rajdevxd/agentrelay

v2.0.7

Published

Switch coding agents without losing context. Generate handoff prompts across Claude Code, Codex, and OpenCode.

Readme

AgentRelay

npm version license

AgentRelay helps you switch coding agents without losing momentum.

It reads your current AI session, captures real project state (including git context), and generates a high-quality continuation prompt so the next agent can continue from where you actually stopped.

Problem

When you switch agents mid-task, context usually breaks.

  • Important decisions are scattered in chat history
  • Errors and failed attempts get repeated
  • The next agent starts from an incomplete picture

Solution

AgentRelay builds a clean handoff prompt from:

  • Session messages
  • Tool calls and outputs
  • Open errors and failed approaches
  • Current git state and changed files

Result: faster context transfer, less repetition, better continuity.

Supported Sources

  • Claude Code
  • Codex
  • OpenCode

Supported Targets

  • generic
  • claude
  • codex
  • cursor
  • chatgpt

Features

  • Smart latest-session detection for the current project
  • Focused context extraction with noise reduction
  • Error-aware prompt generation
  • Git-aware summaries (status, diffs, untracked files)
  • Optional prompt refinement via OpenRouter
  • Clipboard copy on macOS, Linux, and Windows
  • Built-in diagnostics with doctor command
  • Session browsing with sessions command

Install

Run once with npx:

npx @rajdevxd/agentrelay

Install globally:

npm i -g agentrelay

Quick Start

cd your-project
agentrelay

You will:

  1. Pick source agent (if not provided)
  2. Parse latest session for current repo
  3. Capture git/project context
  4. Generate continuation prompt
  5. Copy output to clipboard

Usage

# Basic
agentrelay

# Choose source
agentrelay --source claude
agentrelay --source codex
agentrelay --source opencode

# Choose target style
agentrelay --source claude --target codex

# Use exact session
agentrelay --source codex --session <id-or-path>

# Save output to file
agentrelay --output ./handoff.md

# Refine with OpenRouter
agentrelay --refine

# Pick preserved context start interactively
agentrelay --pick-user

# Start preserved context from nth user prompt
agentrelay --from-user 2

# Diagnostics
agentrelay doctor --source claude

# List sessions
agentrelay sessions --source codex --limit 5

Commands

  • continue (default): generate handoff prompt
  • doctor: validate environment, source availability, git, clipboard, and API key state
  • sessions: list recent sessions for current project

Flags

| Flag | Description | | --- | --- | | --source | Source agent: claude, codex, opencode | | --target | Target format: generic, claude, codex, cursor, chatgpt | | --session <id|path> | Use specific session | | --pick-user | Pick starting user message interactively | | --from-user | Start preserved context from nth user message | | --output, -o | Write final prompt to file | | --refine | Refine prompt with provider | | --provider | Refinement provider (default: openrouter) | | --model | Override model | | --api-key | Override provider API key | | --limit, -n | Session rows limit for sessions command | | --help, -h | Show help | | --version, -v | Show version |

LLM Refinement

Refinement is optional.

  • Provider: openrouter
  • API key resolution order: CLI flag, env variable, local config

Environment variable:

OPENROUTER_API_KEY=your_key_here

Local config file path:

~/.agentrelay.json

Session Storage Paths

| Source | Path | Format | | --- | --- | --- | | Claude Code | ~/.claude/projects//.jsonl | JSONL | | Codex | ~/.codex/sessions////.jsonl | JSONL | | OpenCode | ~/.local/share/opencode/opencode.db | SQLite |

Requirements

  • Node.js 18+
  • One supported source agent with existing session data
  • sqlite3 CLI only for OpenCode source
  • Git repository recommended for best code-state capture

Troubleshooting

  • No sessions found:
    • Run source agent once in the current project
    • Run agentrelay sessions --source
    • Run agentrelay doctor --source
  • OpenCode parsing issues:
    • Ensure sqlite3 CLI is available
  • Refinement failed:
    • Check OPENROUTER_API_KEY
    • Retry without --refine to use raw mode

Maintainer

  • GitHub: https://github.com/codewithevilxd
  • Portfolio: https://nishantdev.space
  • Email: [email protected]

License

MIT