To switch AI coding tools without losing anything, save five things before you move: your work plan as a file in the repo, your instructions as an AGENTS.md, your MCP server list, your approval settings and an export of the sessions you care about. Then install the new tool alongside the old one and run both for a week.
Switching to Safeguard does not mean giving up your subscription either. Bring the Claude, ChatGPT or Codex plan you already pay for and use it inside the Safeguard CLI. Safeguard adds no extra charge for that usage; your plan's own usage limits and terms still apply. If you would rather keep working in the chat you already use, connect Claude or ChatGPT to the Safeguard MCP server and use Safeguard from there.
This post is a practical checklist with real commands for Claude Code, Codex CLI and OpenCode, plus the steps to move into the Safeguard CLI.
What you can lose when you switch
Most switching pain comes from things that live outside the code. The code is in git. These five are often not.
1. Your subscription. You picked a plan and you know its limits. A new tool that needs a new plan doubles the cost while you evaluate it. Check what your current plan covers and whether the new tool can use it under the provider's terms.
2. Your work plan. Mid-feature, the plan often lives only in the assistant's conversation: which steps are done, what you decided and why, what is next. Close the tool and that context is gone unless you wrote it down.
3. Your instructions. Build commands, test commands, code style, the folders the assistant should never touch. These live in files such as CLAUDE.md or AGENTS.md, and each tool looks in different places.
4. Your settings. Approval rules, the default model and MCP servers (the connectors that give an assistant access to tickets, docs or your security data). Each tool stores these in its own config file, in its own format.
5. Your history. Past sessions are useful for "why did we do it this way". They are stored locally, in formats that are internal to each tool, and some are cleaned up on a schedule.
The checklist below saves each of these in a form the next tool can read.
Where each tool keeps your setup
This table shows where the common tools keep the things above, using facts from each project's own docs. It is not a ranking; each tool is a reasonable choice for different teams.
| Claude Code | Codex CLI | OpenCode | Safeguard CLI | |
|---|---|---|---|---|
| Interface | Terminal, IDE extensions, desktop app, web | Terminal | Terminal, desktop app in beta | Interactive terminal; safeguard exec for CI |
| Licence | All rights reserved; Anthropic Commercial Terms | Apache-2.0 | MIT | Not described as open source |
| Sign in or plan | Claude subscription or Anthropic Console account | Sign in with ChatGPT (Plus, Pro, Business, Edu, Enterprise) or API key | /connect per provider | /login; bring your Claude, ChatGPT or Codex plan |
| Instructions | CLAUDE.md, CLAUDE.local.md, ~/.claude/CLAUDE.md; reads AGENTS.md when no CLAUDE.md exists | AGENTS.md and AGENTS.override.md, global in ~/.codex | AGENTS.md, falls back to CLAUDE.md | Attach files with @ |
| Settings | .claude/settings.json, ~/.claude/settings.json | ~/.codex/config.toml, project .codex/config.toml for trusted projects | opencode.json, global ~/.config/opencode/opencode.json | /permissions, /model |
| MCP servers | .mcp.json (project) or ~/.claude.json (local, user) | [mcp_servers.name] tables in config.toml | mcp key in opencode.json | Safeguard is itself an MCP server for Claude and ChatGPT |
| History | ~/.claude/projects/, about 30 days by default; /export | codex resume reopens recent chats | Not checked for this post | /resume in the same folder |
| Approvals | Manual, acceptEdits, plan, auto, dontAsk, bypassPermissions | Sandbox mode plus approval policy | allow, ask, deny per tool | Ask, Auto (default), Yolo |
AGENTS.md is the piece that makes switching easier. Its site calls it "a simple, open format for guiding coding agents", now stewarded by the Agentic AI Foundation under the Linux Foundation. The site lists Codex, opencode, Aider, Cursor, Gemini CLI and many others as supporting it. Put your build steps, test commands and conventions there once, and most tools read them.
Claude Code is Anthropic's agentic coding tool for the terminal, IDE, desktop and web. It can read an AGENTS.md in place of CLAUDE.md (v2.1.277 or later), and its /import command brings configuration from Codex, Gemini CLI or Cursor on your machine, including instruction files, MCP servers, commands, subagents and skills. Know before adopting: transcripts are stored as JSONL under ~/.claude/projects/ and the docs say the entry format is internal and changes between versions, so use /export rather than parsing the files.
Codex CLI is OpenAI's terminal coding agent, Apache-2.0 licensed. It reads AGENTS.md from your Codex home and then from the project root down to your current folder, joining them, with closer files taking precedence. Know before adopting: the combined instruction size defaults to 32 KiB (project_doc_max_bytes), and files beyond the limit are not added, so long instruction files should be split by folder.
OpenCode calls itself "the open source AI coding agent" and is MIT licensed, with v1.19.3 on its releases page on 16 October 2026. It reads AGENTS.md, and if there is none it falls back to CLAUDE.md and ~/.claude/CLAUDE.md, which makes a move from Claude Code simpler. Know before adopting: its providers docs note that Anthropic prohibits using Claude Pro/Max plans through third-party plugins, so check your provider's terms before connecting a subscription.
For a wider look at these tools, see AI coding agents compared.
The switching checklist
Work through it in order. Each step names what to save and how.
Before you switch
1. Write down what your plan covers. Note which subscription you use, which tools it works in and its usage limits. Claude Code's docs say most surfaces need a Claude subscription or an Anthropic Console account. The Codex README lists the Plus, Pro, Business, Edu and Enterprise ChatGPT plans, and an API key also works.
2. Save the work plan as a file. Ask your current assistant to write it down while it still has the context:
Write docs/HANDOFF.md with: the goal of this branch, the steps done,
the steps left, decisions we made and why, and any commands I need to run.
Read it, fix anything wrong, and commit it. This one file carries most of what you would otherwise lose.
3. Export the sessions you care about. In Claude Code, /export writes the current conversation to a plain-text file:
/export notes/session-auth-refactor.txt
Claude Code keeps transcripts for about 30 days by default (cleanupPeriodDays), so export the ones you need before they age out. In Codex, codex resume reopens a recent chat from the current repository, so you can ask it for a summary to paste into your handoff file.
4. Move your instructions into AGENTS.md. If your rules are in CLAUDE.md, move the shared parts into AGENTS.md and keep Claude-specific notes below an import:
@AGENTS.md
## Claude Code
Use plan mode for changes under src/billing/.
Claude Code's docs show this exact pattern. On macOS and Linux a symlink also works (ln -s AGENTS.md CLAUDE.md), but the docs advise the import if anyone on the team uses Windows.
5. List your MCP servers. Write down each server's name, URL or command, and how it signs in. Look in:
- Claude Code:
.mcp.jsonin the project root, and~/.claude.jsonfor local and user servers./mcpshows status inside a session. - Codex: the
[mcp_servers.name]tables in~/.codex/config.toml, or runcodex mcp list. - OpenCode: the
mcpkey inopencode.json.
Do not copy tokens into a committed file. Note where each secret lives and re-enter it in the new tool.
6. Record your approval rules. In Claude Code, run /permissions to see allow, ask and deny rules by scope, and check permissions.defaultMode in .claude/settings.json. In Codex, note your sandbox mode and approval policy. In OpenCode, copy the permission block. These rules took effort to tune; carry the intent over even if the syntax differs.
7. Tag a clean starting point.
git add -A && git commit -m "Handoff before switching assistants"
git tag before-assistant-switch
During the switch
8. Install the new tool alongside the old one. Do not uninstall anything yet. A week of overlap costs little and saves you if something was missed.
9. Point it at the same instructions. Codex and OpenCode read AGENTS.md directly. Moving into Claude Code, preview what /import would bring before it writes anything:
/import codex --dry-run
Claude Code's /init also reads Cursor rules and .github/copilot-instructions.md when it generates a CLAUDE.md. OpenCode's /init improves an existing AGENTS.md in place.
10. Re-add MCP servers with the new tool's command.
# Claude Code, remote server shared with the team
claude mcp add --transport http shared-server --scope project https://example.com/mcp
# Codex, local stdio server
codex mcp add context7 -- npx -y @upstash/context7-mcp
For OpenCode, add an entry under mcp in opencode.json. Codex's docs note that the ChatGPT desktop app, Codex CLI and IDE extension share this MCP configuration.
11. Start with the strictest approvals. A new tool means new defaults. Use Manual in Claude Code, read-only in Codex, ask rules in OpenCode, or Ask in the Safeguard CLI, until you know what the tool does unprompted.
12. Run one real task in both tools. Same branch point, same prompt, separate branches. Compare the diffs. This tells you more than any feature list.
After you switch
13. Scan what changed before you merge. Whichever assistant wrote the code, scan it:
safeguard scan --dir .
Results are JSON files under ./output, such as vuln.json and license.json. We cover this workflow in checking coding agent changes with the Safeguard CLI.
14. Keep the old config for a month. Leave the old tool's files where they are. Delete them once nobody has reached for them in 30 days.
15. Update the team's docs. Point the README at AGENTS.md, note which tool is the default, and record where MCP secrets now live.
Do the work properly with the Safeguard CLI
The Safeguard CLI scans code, container images and SBOMs on your own machine, sends only the results to the platform, and includes an assistant that can fix what it finds. It is also a general assistant for your terminal. The assistant has tools for your local files and for your Safeguard data and picks whichever the question needs. It writes code, not only scans it, and with your approval it can find and read files, edit code and run commands.
Install
curl -fsSL https://cli.safeguard.sh/install | bash
On Windows, in PowerShell:
irm https://cli.safeguard.sh/install.ps1 | iex
It is a single static binary with no Node, Python or JVM to install. It runs on macOS, Linux and Windows, on x86_64 or arm64; Windows is x86_64 only.
First session: carry your plan over
cdinto the repository where you committeddocs/HANDOFF.md.- Run
safeguardwith no arguments to open the interactive terminal. - Type
/loginto sign in through the browser. - Type
/permissionsand choose Ask for the first session. - Type
@, pickdocs/HANDOFF.md, then do the same forAGENTS.md, and ask:
Read the handoff and the project instructions. Summarise where we are,
then propose the next step from the plan before changing anything.
- Type
/scan .to see where the project stands on vulnerabilities.
Attaching the two files gives the assistant the same plan and rules your old tool had. Tomorrow, start in the same folder and /resume picks up the last session there.
Writing and fixing code
Ask in plain language, for example "fix the lodash CVE in this repo" or "how many critical vulns do we have". Tools that change things (writing a file, editing code, running a command) ask before they act, according to your approval mode. Because the same assistant sees your findings, a fix and its security check happen in one session.
Using your Claude, ChatGPT or Codex plan
This is the part that makes switching cheap. Bring the Claude, ChatGPT or Codex plan you already pay for and use it inside the Safeguard CLI. Safeguard adds no extra charge for that usage; your plan's own usage limits and terms still apply. /model shows or switches the AI model; for connecting a model, see the CLI docs.
The second route keeps you in the chat you already use. This walkthrough connects Claude to the Safeguard MCP server with OAuth and lets you choose which tools Claude can use.
Click through it at your own pace, or open it full screen.
ChatGPT users get the same route: connect ChatGPT to the Safeguard MCP server with OAuth and choose which tools it can use.
Click through it at your own pace, or open it full screen.
If you are weighing the two assistants themselves, see Claude vs ChatGPT for coding.
Approvals
/permissions sets Ask (prompt before every action), Auto (approve known actions, ask for anything new; the default) or Yolo (approve everything). Map your old rules onto these: if you ran Claude Code in Manual or Codex in read-only, start in Ask.
CI with safeguard exec
safeguard exec "summarise the critical findings in this repository"
That runs one non-interactive assistant turn, for CI. safeguard validate checks CycloneDX, SPDX and VEX documents. When the local runner runs platform scan jobs, your source code never leaves the machine; only SBOMs and findings are uploaded. Policies and gates are evaluated in the platform, not by the CLI.
Beyond the terminal
The download page lists one platform on every surface, so switching to the CLI does not lock you to one window. Start in the terminal, continue in the desktop app (3.2.2, Windows, macOS and Linux), where you ask your supply chain anything in plain English, and check findings on your phone with the iOS or Android app. There are also IDE extensions for VS Code, JetBrains and Open VSX, a browser extension, and cloud options with nothing to install, including a cloud sandbox against a seeded demo repo that is free for seven days with no card.
Common mistakes
Uninstalling the old tool on day one. You will find a missing rule or server on day three. Keep both installed for a week.
Leaving the plan in the chat. If the next steps exist only in a conversation, they leave with the tool. Write docs/HANDOFF.md before you close it.
Keeping two instruction files that drift. A CLAUDE.md and an AGENTS.md with different test commands will confuse every tool. Keep one source (AGENTS.md) and import it.
Copying MCP secrets into a committed file. Project config such as .mcp.json is meant to be shared through git. Keep tokens out of it and re-enter them per user.
Assuming defaults carry over. Approval defaults differ between tools. Claude Code's auto mode is the starting mode from v2.1.283 on, Codex's default for local work is workspace-write, and the Safeguard CLI defaults to Auto. Set the mode yourself on day one.
Parsing another tool's transcript files. Claude Code's docs say its JSONL format is internal and changes between versions. Use /export and summarise instead.
Connecting a plan where the provider does not allow it. OpenCode's providers docs note that Anthropic prohibits using Claude Pro/Max plans through third-party plugins. Read your provider's terms first.
Skipping the scan after the first week. A new assistant brings new habits, including how it upgrades packages. Run safeguard scan --dir . on the first few branches it produces.
FAQ
Will I lose my chat history when I switch AI coding tools?
Not if you export it first. Claude Code's /export writes a conversation to a text file, and its transcripts are kept for about 30 days by default. Codex's codex resume reopens recent chats. Summarise what matters into a handoff file in the repo, which every tool can read.
Can I switch to Safeguard and keep my Claude, ChatGPT or Codex plan?
Yes. Bring the Claude, ChatGPT or Codex plan you already pay for and use it inside the Safeguard CLI. Safeguard adds no extra charge for that usage; your plan's own usage limits and terms still apply. You can also connect Claude or ChatGPT to the Safeguard MCP server and use Safeguard from the chat you already use. See the CLI docs or /model for connecting a model.
Do I have to rewrite my CLAUDE.md?
No. Move the shared content into AGENTS.md and put @AGENTS.md at the top of CLAUDE.md. Codex and OpenCode read AGENTS.md, Claude Code reads it through the import, and in the Safeguard CLI you attach it with @.
How do I move MCP servers between tools?
List them from the old tool's config, then add each one with the new tool's command, such as claude mcp add or codex mcp add, or an mcp entry in OpenCode's opencode.json. Claude Code's /import can bring MCP servers over from Codex, Gemini CLI or Cursor.
Which approval mode should I start with in a new tool?
The strictest one, for the first week: Ask in the Safeguard CLI, Manual in Claude Code, read-only in Codex. Loosen it once you know what the tool does on its own.
Can I use two AI coding tools at once?
Yes. One workable pattern is to write code with the assistant you prefer and use the Safeguard CLI to scan what changed before you merge.
Does my source code leave my machine with the Safeguard CLI?
When the local runner runs platform scan jobs, your source code stays on your machine; only SBOMs and findings are uploaded.
What should go in a handoff file?
The goal of the branch, steps done, steps left, decisions and their reasons, and any commands to run. Commit it so it travels with the code. More on the assistant side is in the security aware coding assistant post.
Try it yourself
This walkthrough is the install and first start: set up the runner on your own machine, pick the platform, start it, approve it with its device code, then use the same CLI to scan from the terminal.
Click through it at your own pace, or open it full screen.
Ready to switch without losing anything? Download the Safeguard CLI, open your repository, type /login, attach your handoff file with @ and pick up where you left off. The full reference is in the CLI docs.
Quick check
Which file lets most AI coding tools share the same project instructions?
AGENTS.md. Codex and OpenCode read it directly, and Claude Code reads it when there is no CLAUDE.md or through an @AGENTS.md import.
What is the safest way to carry a work plan from one assistant to another?
Ask the old assistant to write it to a file such as docs/HANDOFF.md, check it, commit it, then attach it in the new tool. In the Safeguard CLI you attach it with @.
Sources
- Safeguard CLI overview
- Safeguard CLI interactive terminal
- Safeguard downloads
- AGENTS.md
- Claude Code overview
- Claude Code memory and AGENTS.md
- Claude Code commands
- Claude Code sessions
- Claude Code MCP
- Claude Code permission modes
- Claude Code licence file
- Codex CLI docs
- Codex AGENTS.md guide
- Codex config basics
- Codex MCP
- Codex sandboxing
- Codex repository and README
- OpenCode repository
- OpenCode licence file
- OpenCode releases
- OpenCode rules
- OpenCode config
- OpenCode providers
Last reviewed: 21 October 2026.