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

ctx-switch

v2.0.7

Published

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

Readme

ctx-switch

ctx-switch cc-continue

Formerly cc-continue — existing installs still work, just use ctx-switch going forward.

Switch coding agents without losing context. Agent handoff for Claude Code, Codex, and OpenCode.

Why this exists

You're in the middle of a coding session. Things are working. Progress is being made.

And then you need to switch.

  • Maybe the session can't continue
  • Maybe something isn't working as expected
  • Maybe you just want to move to another agent

Now you're stuck.

You switch to another agent — but:

  • it has no context
  • you have to explain everything again
  • you lose momentum

Your work shouldn't reset just because you switched tools.

What ctx-switch does

npx ctx-switch

It captures your current session — code, context, decisions, errors — and generates a clean, structured handoff prompt so another agent can continue immediately.

No re-explaining. No rebuilding context. No wasted time.

Just continue where you left off.

Core idea

Switch agents. Don't restart.

Features

  • Multi-agent support: Claude Code, Codex, OpenCode
  • Smart session detection: Finds the latest session for your current project
  • Context extraction:
    • Filters noise (confirmations, filler)
    • Keeps only relevant context
  • Error awareness:
    • Includes unresolved errors
    • Skips already-fixed issues
  • Codebase state capture:
    • Recent commits
    • Diffs (staged & unstaged)
    • Untracked files
  • Decision tracking:
    • Extracts key decisions and pivots
  • Structured output:
    • Task → Errors → Decisions → Completed Work → Current State → Instructions
  • Target-aware prompts:
    • codex, cursor, chatgpt, or generic
  • Clipboard ready: Auto-copy across macOS, Linux, Windows
  • Optional LLM refinement (--refine)
  • sessions command to browse recent sessions
  • doctor command for diagnostics

How it works

  1. Select your source agent (Claude / Codex / OpenCode)
  2. ctx-switch finds the latest session for your project
  3. Parses:
    • conversation
    • tool calls
    • errors
  4. Captures git state:
    • branch
    • commits
    • diffs
  5. Builds a structured handoff prompt
  6. Copies it to clipboard and prints it

Install

# Run instantly
npx ctx-switch

# Or install globally
npm i -g ctx-switch

Usage

cd my-project

# Interactive mode
ctx-switch

# Specify source
ctx-switch --source claude
ctx-switch --source codex
ctx-switch --source opencode

# Target a specific agent
ctx-switch --source claude --target codex

# Use a specific session
ctx-switch --source claude --session <id>

# Refine output with LLM
ctx-switch --refine

# List sessions
ctx-switch sessions --source claude --limit 5

# Save to a file
ctx-switch --output ./handoff.md

# Run diagnostics
ctx-switch doctor --source codex

Example use cases

  • Continue work in another agent when switching is needed
  • Move a session across tools without re-explaining everything
  • Resume work seamlessly in a different environment
  • Preserve context when changing workflows

LLM Refinement (Optional)

Use --refine to improve the generated prompt via an LLM.

On first use:

Enter your OpenRouter API key: sk-or-v1-...
Saved to ~/.ctx-switch.json

Get a key: openrouter.ai/keys

Or set manually:

export OPENROUTER_API_KEY=sk-or-v1-...

Key Flags

| Flag | Description | | ---------------------- | ------------------------------------------- | | --source <name> | claude, codex, opencode | | --target <name> | generic, codex, cursor, chatgpt | | --output <file> | Save prompt | | --session <id\|path> | Use specific session | | --refine | Refine prompt via LLM | | --provider | Refinement provider (default: openrouter) | | --model | Override model | | --api-key | Override API key |

Session Storage

| Source | Storage Path | Format | | ----------- | ------------------------------------------------ | ------ | | Claude Code | ~/.claude/projects/<encoded-cwd>/*.jsonl | JSONL | | Codex | ~/.codex/sessions/<year>/<month>/<day>/*.jsonl | JSONL | | OpenCode | ~/.local/share/opencode/opencode.db | SQLite |

Requirements

  • Node.js >= 18
  • Claude Code, Codex, or OpenCode (used in current directory)
  • sqlite3 (only for OpenCode sessions)
  • OpenRouter API key (only if using --refine)

Migrating from cc-continue

cc-continue still works — it's now an alias for ctx-switch.

npm uninstall -g cc-continue
npm i -g ctx-switch

License

MIT