switch-agent

switch-agent is a skill for Codex from nerln/claude-codex-bridge. It costs 91 tokens per session (1,308 once invoked), scanned A, original, MIT.

A workflow for moving an active coding conversation between Claude Code and Codex while preserving its transcript, project state, task lane, and next step. A task lane is the named stream used to keep related handoffs connected.

In plain words
What is it for?
Use it when switching agents, handing work to another coding assistant, or continuing the same task in a different tool. It can install the handoff bridge and create a resumable target session.
Why use it?
It prevents context and work state from being lost when changing coding agents. It also checks the project directory, branch, and uncommitted changes before creating the new session.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: mentions Claude Code; mentions Codex.

Good fit Use it when switching agents, handing work to another coding assistant, or continuing the same task in a different tool. It can install the handoff bridge and create a resumable target session.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nerln/claude-codex-bridge/switch-agent
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add nerln/claude-codex-bridge --skill switch-agent
Clone the repo
git clone --depth 1 https://github.com/nerln/claude-codex-bridge

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for switch-agent

README.md
[![agentmods](https://agentmods.dev/badge/skills/nerln/claude-codex-bridge/switch-agent/github.svg)](https://agentmods.dev/skills/nerln/claude-codex-bridge/switch-agent)
Your own site
<a href="https://agentmods.dev/skills/nerln/claude-codex-bridge/switch-agent"><img src="https://agentmods.dev/badge/skills/nerln/claude-codex-bridge/switch-agent/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for switch-agent

Your own site · 80×15
<a href="https://agentmods.dev/skills/nerln/claude-codex-bridge/switch-agent"><img src="https://agentmods.dev/badge/skills/nerln/claude-codex-bridge/switch-agent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,308 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00091 $0.01308
Opus 5.5 $0.00036 $0.00523
Sonnet 5.5 $0.00018 $0.00262
Haiku 4.5 $0.00009 $0.00131

Measured 1mo ago against content hash a9e5f38c157c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

switch-agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/ask.py, scripts/bridge.py, scripts/transcode.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/switch-agent/SKILL.md · 113 lines

How it starts

The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Switch Agent

Resolve SKILL_DIR as the directory containing this file. Use python3 "$SKILL_DIR/scripts/bridge.py"; do not assume the skill or project is the current directory.

The normal workflow

  1. Infer the source agent from the runtime and the requested target. Require different agents. Finish or explicitly interrupt the active model turn so the source session is no longer changing; identify background work that cannot transfer.

  2. Resolve the exact project root, directory/worktree, branch, and dirty state. Never commit, reset, stash, checkout, or create a worktree unless separately requested.

  3. If .agent-bridge/config.json is absent, install the bridge:

    python3 "$SKILL_DIR/scripts/bridge.py" install --hooks "$PROJECT_ROOT"
    

    Preserve existing hooks. Explain any one-time local hook review.

  4. Choose a stable task lane, defaulting to main. Reuse the same --task for later hops of one chat; use a different name for unrelated chats. When the lane is new or several sessions share the same cwd, pass the exact native --source-session instead of guessing.

  5. Run the native switch. Prefer the shortest command; it infers the source as the other agent:

    python3 "$SKILL_DIR/scripts/bridge.py" to "$TARGET" --task "$TASK" --project "$PROJECT_ROOT"
    

    The explicit equivalent, useful for audits, is:

    python3 "$SKILL_DIR/scripts/bridge.py" switch --from "$SOURCE" --to "$TARGET" --task "$TASK" --project "$PROJECT_ROOT"
    

    Keep the default --transcript auto: transfer the visible transcript plus the deterministic capsule, with capsule-only fallback when parsing is not compatible. Use --transcript required when the user requires transcript continuity and prefers a hard stop. Use --transcript off only when the user wants capsule-only transfer or transcript privacy.

  6. Let the main command create and open a new native target session. Codex opens codex://threads/<id> and Claude resumes with claude --resume <id>; do not ask the user to submit a prefilled prompt or press Enter. If opening is unavailable, rerun the identical switch with --no-open and provide the printed resume command.

  7. Report the transfer ID, task, source and target session IDs, continuity mode, redaction/truncation counts, preserved project state, and any fallback or background-process warning. State that visible history was transcoded; do not claim hidden reasoning, permissions, or live tool state transferred.

Read the full file on GitHub · 113 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 113 lines · 91 tokens per session scan A a9e5f38c157c

Subscribe to this mod's changes

switch-agent is a skill published in the GitHub repository nerln/claude-codex-bridge (2 stars, last pushed 2mo ago), licensed MIT. It adds 91 tokens to every session and 1,308 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

crit-cli

Use when an agent needs to author or reply to crit inline comments programmatically (including multi-agent workflows commenting on shared code/plans/docs/proposals), publish or unpublish a crit review with crit share, sync a crit review to or from a GitHub PR or GitLab MR, or read/interpret a crit review JSON file.…

tomasz-tomczyk/crit · 110 tokens

crit

Review code changes, a plan, a live page (running dev server), or a local HTML file with Crit inline comments and structured human feedback. Use only when the user explicitly invokes /crit or directly asks to use Crit; a generic review request does not count.

tomasz-tomczyk/crit · 55 tokens

crit-story

Author a crit story and continue the interactive review loop only when the user explicitly invokes crit-story or directly asks you to generate a crit story. Do not infer this skill from generic review, PR, or diff-review requests.

tomasz-tomczyk/crit · 47 tokens

ospec

Document-driven OSpec workflow for initialization, change/goal routing, validation, archiving, and durable project knowledge.

clawplays/ospec · 26 tokens

ospec-change

Create or advance a lightweight OSpec change using the classic fast workflow.

clawplays/ospec · 18 tokens

test-harness

Install vigiles and test a Claude Code harness — hooks, skills, agents, settings, CLAUDE.md — by picking the right tier (unit / deterministic / eval) and writing a test that passes. Use to check that a hook fires or blocks, that a skill triggers, that injected context lands; or to observe a run — which tools it…

zernie/vigiles · 103 tokens