How to continue a Claude Code task in Codex without re-explaining it
Hit a usage limit in Claude Code halfway through a task? Here is how to hand the task, progress and decisions to Codex with pas-agent, a small open-source CLI, so the next agent picks up where you stopped.
On this page
If you use more than one AI coding agent, you have probably hit this. Claude Code stops at a usage limit halfway through a task. You open Codex to keep going, and it knows nothing: not the task, not what is done, not what you decided, not what is blocking. So you explain everything again from scratch.
I ran into this often, so I built pas-agent, a small open-source CLI that carries a task from one agent to the next. This post shows how to use it to move a task from Claude Code to Codex.
Why the next agent starts blank
Every AI coding agent keeps its own private session. When you switch agents, that session does not come with you.
But most agents read an instruction file when they start. Claude Code reads CLAUDE.md. Codex, Cursor and OpenCode read AGENTS.md. Gemini CLI reads GEMINI.md.
pas-agent uses that. It keeps a small, local record of the task, the progress and the decisions in .pas-agent/session.json. When you switch, it writes that record into the file the next agent already reads at startup.
Install
pas-agent needs git on your PATH.
You can download a prebuilt binary for Linux, macOS or Windows from the latest release, or install it with Cargo (Rust 1.85+):
cargo install --git https://github.com/gfirik/pas-agent pas-agent-cliEither way you get a single binary called pas-agent.
Step 1: start a session
In your project (any subdirectory works, the session lives at the git root):
pas-agent init --task "Add JWT auth"Step 2: record progress as you go
pas-agent update --completed "Login endpoint" \
--remaining "Token refresh" --remaining "Tests" \
--decision "Use jose, not jsonwebtoken, for edge runtime support" \
--next "Implement refreshToken()"Flags can be repeated. You can also add blockers with --blocker.
Step 3: checkpoint
pas-agent checkpoint "Login flow done"A checkpoint snapshots the task, the git state and the changed files. pas-agent status shows the session with numbered lists, and pas-agent update --done 1 marks remaining item #1 as finished.
Step 4: hand off to Codex
pas-agent export --to codex
codexThe export writes the session into AGENTS.md, and Codex reads it at startup. It now knows the task, what is done, what was decided and what comes next.
One thing to know: agents read their instruction file only when a session starts. So export before you launch the next agent. If it is already running, restart it or ask it to read AGENTS.md.
Let the agent keep it updated
You do not have to run these commands yourself. pas-agent is an ordinary command, so your agent can run it. Add something like this to your own part of CLAUDE.md or AGENTS.md:
## Session handoff (PAS-Agent)
When you finish a piece of work, record it with
`pas-agent update --completed "..." --next "..."` (plus `--decision` / `--blocker` as needed).
At a milestone or before the session ends, run `pas-agent checkpoint "<summary>"`.Your own files stay safe
export never overwrites a hand-written CLAUDE.md or AGENTS.md. It writes only inside a marked block (<!-- pas-agent:start --> to <!-- pas-agent:end -->) and leaves the rest of the file alone. Later exports replace only that block.
Which agents it supports
Right now export --to works for Claude Code, Codex, OpenCode, Cursor, Kiro CLI, Antigravity and Gemini CLI. Use --output <path> to write the context anywhere else.
Where the data lives
Everything is in .pas-agent/session.json at the project root. Commit it to carry the session across machines, or add it to .gitignore to keep it local. The CLI makes no network requests.
Since the session ends up in a file your agent treats as instructions, review changes to .pas-agent/ the same way you review changes to CLAUDE.md.
Status
pas-agent is in alpha. It works end to end, but the session format and commands may still change before 1.0. Next on the roadmap: shell hooks that update and export automatically when you switch agents.
It is MIT licensed. The code is on GitHub, and the docs are at gfirik.github.io/pas-agent. If you work with more than one AI coding agent, I would like to hear how it fits your workflow.