# Migrating from Claude Code to OpenAI Codex on macOS — Step-by-Step

## claude-code-to-codex-macos.md

# Migrating from Claude Code to OpenAI Codex on macOS

**A practical, step-by-step migration and validation guide**

Last verified: **October 5, 2026**

This guide shows how to move a Claude Code setup to OpenAI Codex on a Mac using the current **official OpenAI import workflow**. It covers instructions, settings, MCP servers, hooks, skills, slash commands, subagents, project memories, and recent chats, then walks through how to verify that each part actually works.

The goal is not just to complete an import. The goal is to finish with a Codex setup you have tested and can trust.

> **Important:** OpenAI's import flow is designed to leave the original agent setup in place. Still, make a backup before changing developer tooling, especially on a work machine.

---

## 1. What Codex can import from Claude Code

According to OpenAI's current import documentation, Codex can migrate the following Claude Code concepts:

| Claude Code | Codex destination / behavior |
|---|---|
| Instruction files such as CLAUDE.md | AGENTS.md |
| settings.json | config.toml |
| Skills | Skills |
| Plugins | Plugins |
| Existing project folders | Projects using the same folders |
| Project memories | Codex memories |
| Recent chats | ChatGPT/Codex chats |
| MCP server configuration | Codex MCP configuration |
| Hooks | Codex hooks |
| Slash commands | Skills |
| Subagents | Codex subagents |

For the Codex CLI, OpenAI currently documents importing **up to 50 chats from the last 30 days**.

The importer does not mean every feature is guaranteed to behave identically. OpenAI specifically recommends reviewing permissions, MCP authentication, hooks, plugins, and prompts that depend on arguments, shell interpolation, or file-path placeholders.

---

# 2. Before you begin

You should have:

- macOS
- Terminal access
- Your existing Claude Code setup still available
- Access to the repository or repositories you want to migrate
- A ChatGPT/OpenAI account that can use Codex
- A few minutes to run post-import checks

Do **not** uninstall Claude Code first. Keep it available until you are satisfied that Codex is functioning correctly.

If this is a company-managed Mac, also remember that organization policy can affect which Codex settings, MCP servers, hooks, or features are permitted.

---

# 3. Install or update Codex

Open Terminal.

OpenAI's current macOS/Linux install command is:

~~~sh
curl -fsSL https://chatgpt.com/codex/install.sh | sh
~~~

Confirm that Codex is installed:

~~~sh
codex --version
~~~

Then start it:

~~~sh
codex
~~~

Follow the sign-in flow.

If Codex was already installed, running the official installer again updates the local installation according to OpenAI's CLI quickstart.

**Official reference:**  
https://learn.chatgpt.com/docs/codex/cli

---

# 4. Make a backup first

OpenAI's importer is designed not to delete your existing Claude setup, but a backup makes rollback and comparison much easier.

Run the following from the root of the repository you plan to migrate:

~~~sh
BACKUP="$HOME/codex-import-backup-$(date +%Y%m%d-%H%M%S)"

mkdir -p "$BACKUP/home"
mkdir -p "$BACKUP/project"

# User-level Claude and Codex data
[ -d "$HOME/.claude" ] && cp -a "$HOME/.claude" "$BACKUP/home/"
[ -f "$HOME/.claude.json" ] && cp -a "$HOME/.claude.json" "$BACKUP/home/"
[ -d "$HOME/.codex" ] && cp -a "$HOME/.codex" "$BACKUP/home/"
[ -d "$HOME/.agents" ] && cp -a "$HOME/.agents" "$BACKUP/home/"

# Common project-level files
[ -f ./CLAUDE.md ] && cp -a ./CLAUDE.md "$BACKUP/project/"
[ -d ./.claude ] && cp -a ./.claude "$BACKUP/project/"
[ -f ./.mcp.json ] && cp -a ./.mcp.json "$BACKUP/project/"
[ -f ./AGENTS.md ] && cp -a ./AGENTS.md "$BACKUP/project/"
[ -d ./.codex ] && cp -a ./.codex "$BACKUP/project/"
[ -d ./.agents ] && cp -a ./.agents "$BACKUP/project/"

echo "Backup created at:"
echo "$BACKUP"
~~~

Save the path printed at the end.

## Optional: inventory the Claude setup before importing

This gives you a useful "before" list.

~~~sh
echo "=== User-level Claude files ==="
find "$HOME/.claude" -maxdepth 4 -type f 2>/dev/null | sort

echo
echo "=== Project migration-related files ==="
find . -maxdepth 4 (   -name 'CLAUDE.md' -o   -name 'AGENTS.md' -o   -name '.mcp.json' -o   -path '*/.claude/*' -o   -path '*/.codex/*' -o   -path '*/.agents/*' ) -type f 2>/dev/null | sort
~~~

Do not paste this output into a public ticket, chat, or document without reviewing it. File names and paths can reveal internal project names or tooling.

---

# 5. Run the official Claude Code import

Move into the repository you want to use:

~~~sh
cd /path/to/your/repository
~~~

Start Codex:

~~~sh
codex
~~~

At the Codex prompt, enter:

~~~text
/import
~~~

Then:

1. Choose **Claude Code**.
2. Select the supported setup/configuration you want to import.
3. Select any project files you want included.
4. Select recent chats if you want them.
5. Review what Codex plans to import.
6. Continue with the migration.

OpenAI documents the same general import workflow for Claude Code and Cursor.

## If /import is unavailable

OpenAI notes that the CLI import command is not available when:

- A task is currently running
- You are in a remote session
- The CLI is connected to a local app-server daemon

Exit that context and start a normal local Codex CLI session, then run /import again.

**Official reference:**  
https://learn.chatgpt.com/docs/import

---

# 6. Alternative: import from the ChatGPT/Codex desktop experience

If you prefer the desktop UI, OpenAI also documents an import flow there.

Open the application and go to:

**Settings → Import**

Depending on the current UI, this may appear under **General → Import other agent setup**.

Choose Claude Code and follow the review flow.

The CLI route is particularly useful for developers because you can immediately inspect the resulting files and run terminal-based validation.

**Official reference:**  
https://learn.chatgpt.com/docs/import

---

# 7. Understand where things should land

After the import, do not assume success just because Codex says it completed. Check each major surface.

## Instructions

Typical locations:

~~~text
~/.codex/AGENTS.md
/path/to/repo/AGENTS.md
/path/to/repo/some/subdirectory/AGENTS.md
~~~

Codex uses AGENTS.md as its primary instruction-file convention.

A global AGENTS.md applies broadly, while project and nested AGENTS.md files can add or override instructions closer to the working directory.

Codex also supports AGENTS.override.md.

**Official reference:**  
https://learn.chatgpt.com/docs/agent-configuration/agents-md

---

## Configuration

User-level configuration:

~~~text
~/.codex/config.toml
~~~

Project-level configuration:

~~~text
<repo>/.codex/config.toml
~~~

OpenAI documents configuration precedence roughly from most specific to least specific as:

1. Command-line flags
2. Project configuration, with the closest trusted project layer winning
3. Selected profile
4. User configuration in ~/.codex/config.toml
5. Managed/cloud configuration
6. System configuration

A key detail: **project-level .codex configuration is only loaded for trusted projects.**

**Official reference:**  
https://learn.chatgpt.com/docs/config-file/config-basic

---

## MCP servers

MCP configuration is stored in Codex configuration, commonly:

~~~text
~/.codex/config.toml
~~~

or:

~~~text
<repo>/.codex/config.toml
~~~

MCP server tables use the Codex mcp_servers configuration structure.

**Official reference:**  
https://learn.chatgpt.com/docs/extend/mcp

---

## Hooks

Codex can load hooks from locations including:

~~~text
~/.codex/hooks.json
~/.codex/config.toml
<repo>/.codex/hooks.json
<repo>/.codex/config.toml
~~~

Project hooks are subject to project trust.

**Official reference:**  
https://learn.chatgpt.com/docs/hooks

---

## Skills and imported slash commands

Current Codex skill locations include:

User skills:

~~~text
$HOME/.agents/skills
~~~

Repository skills:

~~~text
<repo>/.agents/skills
~~~

Each skill directory contains a SKILL.md file.

A useful migration detail: Claude Code slash commands are imported as **Codex skills**, not necessarily as identical slash commands.

**Official reference:**  
https://learn.chatgpt.com/docs/build-skills

---

## Subagents

Personal custom agents:

~~~text
~/.codex/agents/
~~~

Project-scoped custom agents:

~~~text
<repo>/.codex/agents/
~~~

Custom agent files use TOML.

**Official reference:**  
https://learn.chatgpt.com/docs/agent-configuration/subagents

---

## Memories

Local Codex memories live under:

~~~text
~/.codex/memories/
~~~

Codex local memories and ChatGPT's general web/app memory are related concepts but should not be treated as the same storage mechanism.

OpenAI recommends using AGENTS.md for instructions that must reliably govern work. Memory is better suited to learned or reusable context, not hard policy.

**Official reference:**  
https://learn.chatgpt.com/docs/customization/memories

---

# 8. Validate AGENTS.md instructions

This is one of the most important checks.

From the repository root, run:

~~~sh
codex --ask-for-approval never "Summarize the current instructions and list the instruction files you loaded."
~~~

Compare the answer with your former CLAUDE.md and other Claude instruction files.

You are checking for:

- Missing global instructions
- Missing repository instructions
- Incorrect nesting or override behavior
- Rules that were accidentally converted into a less reliable mechanism
- References to old Claude-only paths or command names

If the repository has nested instruction files, test from a nested directory too:

~~~sh
cd path/to/nested/component

codex --ask-for-approval never "List the instruction sources you loaded and summarize the rules that apply here."
~~~

## What belongs in AGENTS.md?

Put deterministic rules here, such as:

- Required test commands
- Repository conventions
- Branch or pull-request rules
- Build commands
- Infrastructure safety rules
- Formatting requirements
- Paths Codex should or should not modify
- Required approval boundaries
- Architecture conventions

Do not rely on memory alone for a rule that must always be followed.

---

# 9. Validate config.toml

Check whether the files exist:

~~~sh
test -f "$HOME/.codex/config.toml" && echo "User config found"
test -f ./.codex/config.toml && echo "Project config found"
~~~

Inspect them locally:

~~~sh
test -f "$HOME/.codex/config.toml" && sed -n '1,240p' "$HOME/.codex/config.toml"

test -f ./.codex/config.toml && sed -n '1,240p' ./.codex/config.toml
~~~

Look for:

- Expected MCP definitions
- Model or profile configuration you intentionally use
- Sandbox and approval settings
- Hook configuration
- Project-specific settings
- Any path still pointing to a Claude-only directory

> **Security note:** Do not post the complete config.toml publicly without reviewing it. It may contain internal URLs, environment variable names, or other sensitive configuration.

If Codex starts cleanly without TOML/config parsing errors, that is a useful first syntax check, but it does not prove every setting behaves as intended.

---

# 10. Validate MCP servers

First list what Codex sees:

~~~sh
codex mcp list
~~~

For available MCP CLI options:

~~~sh
codex mcp --help
~~~

Inside an interactive Codex session, also run:

~~~text
/mcp
~~~

Compare the resulting list against the MCP servers you used with Claude Code.

## Re-authenticate where necessary

OpenAI specifically warns that imported MCP servers may need authentication again, especially when they use:

- OAuth
- Custom authorization
- Custom HTTP headers
- Environment variables
- Non-default transports

For OAuth-capable servers, Codex supports:

~~~sh
codex mcp login <server-name>
~~~

## Test each important server

Do not stop at "it appears in the list."

For every important MCP server, ask Codex to perform a harmless read-only task that requires that server.

Examples:

- List one accessible repository
- Read a known documentation page
- List a small set of tickets
- Fetch a test resource
- Run a safe health/status method

Verify:

- The correct server was called
- Authentication succeeded
- Expected resources are visible
- No environment variable or header is missing

---

# 11. Validate hooks carefully

Hooks deserve manual review because lifecycle semantics may differ between tools.

Start Codex and run:

~~~text
/hooks
~~~

Review the hook sources Codex found.

Codex may require you to trust new or changed hooks. If a hook changes later, its hash can require review again.

Check for hook files:

~~~sh
test -f "$HOME/.codex/hooks.json" && echo "User hooks.json found"
test -f ./.codex/hooks.json && echo "Project hooks.json found"
~~~

If hooks call local scripts, verify that the referenced files exist:

~~~sh
ls -l /path/to/hook/script
~~~

If a script should be executable:

~~~sh
test -x /path/to/hook/script && echo "Executable" || echo "Not executable"
~~~

## Hook migration gotchas

OpenAI currently supports lifecycle events including events such as:

- PreToolUse
- PermissionRequest
- PostToolUse
- PreCompact
- PostCompact
- UserPromptSubmit
- SubagentStart
- SubagentStop
- Stop
- Interrupt
- SessionStart
- SessionEnd

However, do not assume a Claude hook has identical semantics after conversion.

Review:

- Event name and timing
- Tool-match rules
- Input JSON shape expected by scripts
- Exit-code behavior
- Whether the hook blocks or merely reports
- Paths to shell scripts
- Environment variables
- Whether project trust prevents the hook from loading

Also remember that matching hook definitions from more than one supported source can all run. Avoid accidentally defining the same action twice in hooks.json and config.toml.

## Smoke-test hooks safely

Use a harmless event.

For example, if a hook logs tool activity, temporarily point it at a test log file and perform a read-only command. Verify that it fires exactly once and receives the expected data.

Do **not** test a migrated hook for the first time against production infrastructure, destructive shell commands, deploys, or credentials.

**Official reference:**  
https://learn.chatgpt.com/docs/hooks

---

# 12. Validate skills and migrated slash commands

List discovered skill definitions:

~~~sh
echo "=== User skills ==="
find "$HOME/.agents/skills" -name SKILL.md -type f 2>/dev/null | sort

echo
echo "=== Project skills ==="
find ./.agents/skills -name SKILL.md -type f 2>/dev/null | sort
~~~

Compare the list with the Claude skills and slash commands you relied on.

Then test one or more representative skills from Codex.

For a skill named example-skill, invoke it using the supported Codex skill mechanism, for example:

~~~text
$example-skill
~~~

or ask Codex to use it for an appropriate task.

## Slash-command gotcha

OpenAI maps Claude Code slash commands to Codex skills.

If an old command depended on:

- Positional arguments
- Shell interpolation
- File placeholders
- Claude-specific variables
- Claude-specific plugin behavior

review it manually after import.

The intent may migrate even when the invocation style is different.

**Official references:**  
https://learn.chatgpt.com/docs/build-skills  
https://learn.chatgpt.com/docs/reference/slash-commands

---

# 13. Validate subagents

List custom agent definitions:

~~~sh
echo "=== Personal agents ==="
find "$HOME/.codex/agents" -name '*.toml' -type f 2>/dev/null | sort

echo
echo "=== Project agents ==="
find ./.codex/agents -name '*.toml' -type f 2>/dev/null | sort
~~~

A custom Codex agent definition should include the required agent metadata and developer instructions.

Test an imported agent with a read-only task.

For example:

~~~text
Use the <agent-name> subagent to inspect this repository and summarize its architecture. Do not modify files.
~~~

In an interactive CLI session, use the agent/thread controls documented by Codex to inspect which agent is active.

Verify that:

- The agent exists
- Its description makes sense
- Its instructions survived conversion
- Its model/sandbox settings are appropriate
- It does not still reference Claude-specific tools that no longer exist

**Official reference:**  
https://learn.chatgpt.com/docs/agent-configuration/subagents

---

# 14. Validate memory

In Codex, run:

~~~text
/memories
~~~

You can also inspect whether the local memory directory exists:

~~~sh
ls -la "$HOME/.codex/memories" 2>/dev/null
~~~

OpenAI documents local memories as an opt-in feature. If you want them enabled, the relevant feature configuration is:

~~~toml
[features]
memories = true
~~~

Review imported memories for:

- Old project assumptions
- Stale paths
- References to Claude-only commands
- Secrets or credentials that should never have been stored
- Rules that should really live in AGENTS.md instead

## Memory is not policy

If something is mandatory, such as:

- Never deploy without approval
- Always run a particular test
- Never edit generated files
- Use a specific architecture convention

put it in AGENTS.md rather than relying on memory.

**Official reference:**  
https://learn.chatgpt.com/docs/customization/memories

---

# 15. Validate recent chats

If you chose recent chats during the CLI import, remember the documented CLI scope:

- Up to 50 chats
- From the last 30 days

Do not treat the import as a complete historical archive.

Pick a few recent sessions you recognize and verify that they appear where expected.

For long-term project knowledge, important decisions should live in durable project artifacts such as documentation, AGENTS.md, source-controlled configuration, or intentionally managed memories rather than depending only on conversation history.

---

# 16. Run a complete smoke-test checklist

A migration is not complete until the important behaviors work.

Use a small test matrix like this:

| Area | Test | Pass condition |
|---|---|---|
| Instructions | Ask Codex to summarize loaded rules | Correct AGENTS files and expected rules are reported |
| User config | Start Codex | No config parsing errors |
| Project config | Open the intended repository | Trusted project settings are active |
| MCP | Run codex mcp list and a read-only MCP task | Server appears, authenticates, and returns expected data |
| Hooks | Trigger a harmless lifecycle event | Correct hook runs once and produces expected result |
| Skills | Invoke a representative skill | Skill loads and follows its instructions |
| Slash-command migration | Exercise a converted command/skill | Behavior is equivalent or deliberately updated |
| Subagents | Delegate a read-only task | Correct agent activates and follows its instructions |
| Memories | Run /memories and inspect a sample | Expected memory is present and appropriate |
| Recent chats | Open a known recent session | Expected imported session is available |

---

# 17. Verify Claude was not modified

OpenAI states that importing does not change or delete the existing source-agent setup.

You can check the original Claude directory still exists:

~~~sh
ls -la "$HOME/.claude" 2>/dev/null
~~~

If you kept the BACKUP variable in the same shell, compare it:

~~~sh
if [ -d "$BACKUP/home/.claude" ] && [ -d "$HOME/.claude" ]; then
  diff -ru "$BACKUP/home/.claude" "$HOME/.claude" || true
fi
~~~

Differences are not automatically bad if Claude itself wrote new state after the backup, but unexpected migration-induced changes deserve review.

---

# 18. Compare Codex before and after

If you already had Codex configured before the migration, the backup lets you inspect exactly what changed.

~~~sh
if [ -d "$BACKUP/home/.codex" ] && [ -d "$HOME/.codex" ]; then
  diff -ru "$BACKUP/home/.codex" "$HOME/.codex" || true
fi
~~~

For the repository:

~~~sh
if [ -d "$BACKUP/project/.codex" ] && [ -d ./.codex ]; then
  diff -ru "$BACKUP/project/.codex" ./.codex || true
fi
~~~

If an AGENTS.md existed before the import:

~~~sh
if [ -f "$BACKUP/project/AGENTS.md" ] && [ -f ./AGENTS.md ]; then
  diff -u "$BACKUP/project/AGENTS.md" ./AGENTS.md || true
fi
~~~

The point is not that "no differences" is correct. The point is to understand the differences.

---

# 19. Common gotchas

## 1. Project trust can make configuration appear "missing"

Project-level .codex configuration, hooks, and related settings may not load until the repository is trusted.

If global behavior works but project-specific behavior does not, check trust first.

---

## 2. MCP appearing in the list does not prove authentication works

Always exercise a real, safe MCP call.

OAuth tokens may need to be refreshed or recreated after migration.

---

## 3. Hooks are not a blind 1:1 copy

Review event timing, input shape, paths, exit behavior, permissions, and trust.

A hook that enforces a safety boundary should be tested explicitly.

---

## 4. Multiple hook sources can all execute

If the same logical hook is present in hooks.json and config.toml, you may get duplicate behavior.

Prefer a clear source of truth for each layer.

---

## 5. User skills are under .agents, not .codex

The current documented user-level skill path is:

~~~text
$HOME/.agents/skills
~~~

Repository skills similarly use:

~~~text
<repo>/.agents/skills
~~~

This is easy to miss if you assume every Codex artifact lives under ~/.codex.

---

## 6. Imported slash commands become skills

Do not expect every Claude slash command to remain an identical slash command.

Check the imported skill and update documentation or team habits accordingly.

---

## 7. Prompt arguments and interpolation deserve review

OpenAI specifically calls out prompts that depend on command arguments, shell interpolation, or file-path placeholders.

Test those workflows with harmless inputs.

---

## 8. Plugin/marketplace integrations may need manual work

An imported configuration can reference capabilities that still require installation, connection, sign-in, or a Codex-compatible equivalent.

Treat "imported" and "operational" as separate states.

---

## 9. Memory should not hold mandatory engineering policy

Use AGENTS.md for rules Codex must reliably follow.

Use memory for durable contextual knowledge that is useful but not a hard enforcement boundary.

---

## 10. Do not publish configuration blindly

Before sharing any of these files, inspect them for:

- Tokens
- API keys
- Internal hostnames
- Internal repository names
- Employee/customer names
- Private paths
- Environment variable values
- Organization IDs
- Account IDs

---

## 11. Company-managed Codex settings may override local choices

If your organization centrally manages Codex, some local configuration may be constrained or overridden.

If a setting looks correct locally but does not take effect, check organizational policy before assuming the import failed.

---

# 20. Roll back safely if needed

Because the original Claude setup remains available, rollback usually means restoring any prior Codex configuration you backed up.

First exit Codex.

If you had a Codex configuration before the migration:

~~~sh
mv "$HOME/.codex" "$HOME/.codex.after-import"

if [ -d "$BACKUP/home/.codex" ]; then
  cp -a "$BACKUP/home/.codex" "$HOME/.codex"
fi
~~~

For project-level Codex config:

~~~sh
if [ -d ./.codex ]; then
  mv ./.codex ./.codex.after-import
fi

if [ -d "$BACKUP/project/.codex" ]; then
  cp -a "$BACKUP/project/.codex" ./.codex
fi
~~~

If the import created or changed AGENTS.md and you had a previous version:

~~~sh
if [ -f "$BACKUP/project/AGENTS.md" ]; then
  cp -a "$BACKUP/project/AGENTS.md" ./AGENTS.md
fi
~~~

If no prior Codex files existed, keep the post-import files renamed instead of deleting them immediately. That gives you an easy way to inspect or recover pieces later.

---

# 21. Final migration checklist

Before calling the migration complete, verify all of the following:

- [ ] Codex is installed and starts successfully
- [ ] You can sign in
- [ ] A pre-migration backup exists
- [ ] /import completed
- [ ] Claude Code files still exist
- [ ] Global instructions were converted and load correctly
- [ ] Repository AGENTS.md loads correctly
- [ ] Nested instruction behavior is correct
- [ ] config.toml loads without errors
- [ ] Project trust is correct
- [ ] All required MCP servers appear
- [ ] MCP authentication works
- [ ] Every critical MCP server passes a read-only test
- [ ] Hooks were manually reviewed
- [ ] Critical hooks pass a harmless smoke test
- [ ] Skills were discovered
- [ ] Important migrated slash commands work as skills
- [ ] Custom subagents exist and run correctly
- [ ] Memory behavior is intentionally enabled or disabled
- [ ] Imported memories were reviewed
- [ ] Required rules were moved to AGENTS.md rather than memory
- [ ] Expected recent chats are present
- [ ] Any plugin or marketplace follow-up is complete
- [ ] No secrets were accidentally moved into shareable files
- [ ] You understand the differences between the old and new configuration

Only after this checklist is clean should you consider retiring the old Claude Code workflow.

---

# 22. Suggested migration strategy for a team

For an organization moving multiple developers, do not have everyone independently migrate and hope the results match.

A safer pattern is:

1. Pick one representative repository.
2. Run the import on one Mac.
3. Review the generated AGENTS.md and project .codex configuration.
4. Validate MCP servers and hooks.
5. Normalize repository-scoped instructions and skills.
6. Commit only the project artifacts that should be shared.
7. Keep personal/user-level settings out of the repository.
8. Document any required MCP sign-in steps.
9. Have a second developer run the same validation checklist.
10. Roll out to the broader team.

This turns the first migration into a tested reference implementation instead of repeating ad-hoc conversions.

---

# 23. Official OpenAI references

This guide intentionally relies on current OpenAI/Codex documentation rather than third-party migration scripts.

## Import from another agent

https://learn.chatgpt.com/docs/import

Covers the official Claude Code/Cursor import flow, supported data, import mappings, CLI limitations, and post-import review items.

## Codex CLI

https://learn.chatgpt.com/docs/codex/cli

Covers installing, updating, starting, and signing in to Codex.

## Codex configuration

https://learn.chatgpt.com/docs/config-file/config-basic

Covers ~/.codex/config.toml, project .codex/config.toml, trust, and configuration precedence.

## AGENTS.md

https://learn.chatgpt.com/docs/agent-configuration/agents-md

Covers global and project instruction discovery, overrides, and validation.

## MCP

https://learn.chatgpt.com/docs/extend/mcp

Covers MCP configuration, codex mcp commands, authentication, and MCP usage.

## Hooks

https://learn.chatgpt.com/docs/hooks

Covers lifecycle hooks, hook files, trust, supported events, and execution behavior.

## Skills

https://learn.chatgpt.com/docs/build-skills

Covers skill structure, SKILL.md, and user/repository skill locations.

## Subagents

https://learn.chatgpt.com/docs/agent-configuration/subagents

Covers custom Codex agent definitions and scopes.

## Memories

https://learn.chatgpt.com/docs/customization/memories

Covers local Codex memory storage, enabling memory, and how memories differ from hard instructions.

## Slash commands

https://learn.chatgpt.com/docs/reference/slash-commands

Covers Codex interactive commands and current slash-command behavior.

---

# Short version

If you only need the core migration path:

~~~sh
# 1. Install/update Codex
curl -fsSL https://chatgpt.com/codex/install.sh | sh

# 2. Verify
codex --version

# 3. Enter your repository
cd /path/to/repository

# 4. Start Codex
codex
~~~

Then inside Codex:

~~~text
/import
~~~

Choose **Claude Code**, review the proposed import, and continue.

Afterward, at minimum verify:

~~~sh
codex --ask-for-approval never "Summarize the current instructions and list the instruction files you loaded."
codex mcp list
~~~

Then use:

~~~text
/hooks
/mcp
/memories
~~~

and test one representative skill, hook, MCP server, and subagent before retiring the old workflow.

---

**Document scope:** This is a migration and verification guide, not a guarantee that every third-party Claude plugin or custom script has an exact Codex equivalent. When a behavior is security-sensitive or production-critical, validate it directly before relying on it.
