> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mibyanai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Import from Other Agents

> One-command import of a Claude Code (~/.claude) or OpenAI Codex CLI (~/.codex) setup into Mibyan — instructions, allowlists, MCP servers, skills, and memories.

`mibyan import-agent` imports your existing **Claude Code** or **OpenAI Codex CLI** setup into Mibyan with one command. It follows the same preview-first pattern as [`mibyan claw migrate`](/desktop/guides/migrate-from-openclaw): you always see a per-item plan before anything is written, and `--dry-run` never touches disk.

```bash theme={null}
mibyan import-agent                    # auto-detect ~/.claude or ~/.codex
mibyan import-agent claude-code        # import from ~/.claude
mibyan import-agent codex              # import from ~/.codex
mibyan import-agent claude-code --dry-run          # preview only
mibyan import-agent codex --source /path/to/.codex # custom location
mibyan import-agent claude-code --overwrite --yes  # replace conflicts, skip prompts
```

## What gets imported

### Claude Code (`~/.claude`)

| Claude Code | Mibyan |
| - | - |
| `CLAUDE.md` (global instructions) | Memory entries in `~/.mibyan/memories/MEMORY.md` |
| `settings.json` → `permissions.allow` (`Bash(...)` rules) | `command_allowlist` in `config.yaml` |
| `settings.json` → `permissions.deny` (`Bash(...)` rules) | `approvals.deny` in `config.yaml` |
| `mcpServers` (from `~/.claude.json` and `settings.json`) | `mcp_servers` in `config.yaml` |
| `skills/<name>/` (dirs with `SKILL.md`) | `~/.mibyan/skills/claude-code-imports/<name>/` |
| `commands/*.md` (slash commands) | Skipped with a note — convert them into skills |

Claude's `Bash(npm run test:*)` prefix rules become `npm run test*` globs. Non-`Bash` permission rules (`Read(...)`, `WebFetch`, ...) gate Claude-specific tools and are reported as unmapped rather than imported.

### Codex CLI (`~/.codex`)

| Codex CLI | Mibyan |
| - | - |
| `AGENTS.md` (global instructions) | Memory entries in `~/.mibyan/memories/MEMORY.md` |
| `config.toml` → `[mcp_servers.*]` | `mcp_servers` in `config.yaml` |
| `memories/*.md` | Memory entries in `~/.mibyan/memories/MEMORY.md` |
| `skills/<name>/` (dirs with `SKILL.md`) | `~/.mibyan/skills/codex-imports/<name>/` |

## What is never imported

**API keys and credentials.** Credential files (`~/.claude/.credentials.json`, `~/.codex/auth.json`) are never read, and MCP server environment variables or headers with secret-looking names (`*_TOKEN`, `*_API_KEY`, `Authorization`, ...) are stripped and listed in the report so you can re-add them deliberately. Run `mibyan setup` to configure providers, or add secrets to `~/.mibyan/.env`.

## Behavior notes

* **Preview first, always.** The command prints the full plan before applying; in non-interactive sessions it stops at the preview unless you pass `--yes`.
* **Merges, not replaces.** Memory entries are deduplicated against your existing `MEMORY.md`; allowlist/denylist patterns merge with what's already in `config.yaml`.
* **Conflicts are skipped by default.** An MCP server or skill that already exists in Mibyan is reported as a conflict; pass `--overwrite` to replace it.
* **Malformed files don't abort the run.** A broken `settings.json` or `config.toml` becomes a per-item error in the report while everything else still imports.
* Coming from OpenClaw instead? Use [`mibyan claw migrate`](/desktop/guides/migrate-from-openclaw).

## Keeping imports in sync

Every successful import registers its source (and the digest of everything it read) in `~/.mibyan/import-sync.json`. When the other agent's setup changes later — new skills, edited `CLAUDE.md`/`AGENTS.md`, added MCP servers — pull the changes in with:

```bash theme={null}
mibyan import-agent --sync            # re-import every changed source
mibyan import-agent --sync --dry-run  # preview what a sync would do
```

Sync is prompt-free and cheap: sources whose files are unchanged are skipped by digest comparison, so it is safe to run on a schedule (e.g. a daily [cron job](/desktop/user-guide/features/cron)). Rules:

* **Memory and config merges stay deduplicating** — a sync never duplicates entries or patterns you already have.
* **Skills previously imported by `import-agent` are refreshed in place** when the source copy changes.
* **Skills you created or modified under the import category yourself are never clobbered** — they keep normal conflict semantics (use `--overwrite` on a manual run to force).
* **Credential files never trigger a sync** — token refreshes in `~/.claude/.credentials.json` or `~/.codex/auth.json` are ignored by the digest, and secrets are still stripped from anything imported.

This mirrors ChatGPT Work's *Settings > Import* automatic updates, adapted to an explicit, inspectable command instead of a background service.

The manifest is per profile. A profile created with `mibyan profile create <name> --clone --sync-imports` carries it over, so `mibyan -p <name> import-agent --sync` keeps pulling from the same external trees (see [Profiles](/desktop/user-guide/profiles#keep-a-clones-imported-agent-setups-synced---sync-imports)).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.