Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (agent-thread) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
agent-thread
Claude Code and Codex session uploader and share viewer built with Bun, Next.js, shadcn/ui, OpenNext, and Cloudflare Workers.
What works now
bunx agent-threadstyle CLI entrypoint via theagent-threadbinary- Claude session discovery from
~/.claude/projects - Codex thread discovery from
~/.codex/sessions - Interactive selection of sessions for the current directory
- Shared thread imports back into Claude Code or Codex
- Upload endpoint as a Next route handler
- Server-rendered share page backed by D1 metadata and R2 session storage
Install
bun installRun the CLI locally
Start the Next app first:
bun run devThen run the CLI against that local app:
AGENT_THREAD_SERVER_URL=http://127.0.0.1:3000 bun run cliOr upload the latest session without a prompt:
AGENT_THREAD_SERVER_URL=http://127.0.0.1:3000 bun run cli --latestUpload Codex threads instead of the default Claude provider:
AGENT_THREAD_SERVER_URL=http://127.0.0.1:3000 bun run cli --codexImport a shared thread into Claude Code or Codex:
AGENT_THREAD_SERVER_URL=http://127.0.0.1:3000 bun run cli --import 0c5a0y4a406r
AGENT_THREAD_SERVER_URL=http://127.0.0.1:3000 bun run cli --import http://127.0.0.1:3000/t/0c5a0y4a406r --to codexIf --workspace is omitted, imports are attached to the current directory. Use --dry-run to inspect target paths without writing files and --force to overwrite an existing local import.
Without AGENT_THREAD_SERVER_URL, the CLI defaults to the deployed Worker:
bunx agent-thread
npx agent-thread --codex
npx agent-thread --import 0c5a0y4a406r --to codexCurrent default: https://agent-thread.com
Cloudflare setup
Create an R2 bucket and a D1 database, then update wrangler.toml with the real binding values.
Apply the D1 migration:
bunx wrangler d1 migrations apply agent-threadTest
bun testDeploy
Next.js is deployed to Cloudflare Workers through OpenNext:
bun run preview
bun run deploy