Skip to content
Productivity
Skill

/import

Import an existing OpenClaw agent from its workspace directory into the current project. Triggers on /agent:import, "importar agente", "traer de openclaw", "import agent".

From plugin
agent
6421 skills10 hooks1 MCP

Claude Code

$ npx -y skills add crisandrews/ClawCode --skill import --agent claude-code

SKILL.md

import.SKILL.md
name: import
description: Import an existing OpenClaw agent from its workspace directory into the current project. Triggers on /agent:import, "importar agente", "traer de openclaw", "import agent".
user-invocable: true
argument-hint: [agent-id]

Import an OpenClaw Agent

Import an existing agent from an OpenClaw installation into this directory, then offer the same setup steps a new agent gets (QMD, messaging, crons).

Part 1: Copy the agent

1. **Discover OpenClaw workspaces** across plausible source locations. Users commonly run OpenClaw as `root` and then run ClawCode as a non-root user (e.g. inside an LXC where the service user is `claude`), so checking only `~/.openclaw` misses those setups. Look in every readable root below and union the results:

   for root in \
     "${CLAWCODE_OPENCLAW_ROOT:-}" \
     "$HOME/.openclaw" \
     "/root/.openclaw"; do
     [[ -z "$root" ]] && continue
     [[ -r "$root" ]] || continue
     ls -d "$root"/workspace* 2>/dev/null
   done | sort -u

Override the search roots with the `CLAWCODE_OPENCLAW_ROOT` env var when OpenClaw data lives in a non-standard location (e.g. a mounted volume).

If the loop returns nothing, ask the user for an absolute path to the source workspace instead of silently falling back.

For each workspace found, read `IDENTITY.md` to show the agent's name. Typical layouts:

  • `<root>/workspace/` — default agent (main)
  • `<root>/workspace-eva/` — agent "eva"
  • `<root>/workspace-jack/` — agent "jack"

2. **Let the user choose** which agent to import (or use argument if provided).

3. **Determine the source path**: use the absolute path from the chosen workspace (e.g. `/root/.openclaw/workspace-eva/` or `/home/claude/.openclaw/workspace/`). Do NOT re-expand `~` from an agent-id alone — the discovered path already carries the correct root.

4. **Copy bootstrap files** to the current project root: Files to copy from the source workspace:

  • `SOUL.md`, `IDENTITY.md`, `USER.md`, `AGENTS.md`, `TOOLS.md`, `HEARTBEAT.md`

Also copy CLAUDE.md from the plugin templates (NOT from OpenClaw):

   cp ${CLAUDE_PLUGIN_ROOT}/templates/CLAUDE.md ./

5. **Import memory** (ask user first):

  • Copy `MEMORY.md` to `./memory/MEMORY.md`
  • Copy recent memory files from `memory/` (last 30 days by default, or all if user wants full history)
  • Create `./memory/.dreams/` directory with empty `short-term-recall.json`
  • **NEVER copy** files with `credential`, `password`, `secret`, `.env` in their name

**5a. Channel-content guard (privacy / scope provenance) — mandatory.** OpenClaw daily logs often summarize WhatsApp/Telegram chats. Copied verbatim into top-level `memory/*.md` they are classified `local` provenance and **bypass channel-scope filtering** until manually moved or curated — a log imported as local is never promoted to the `.scoped` lane by dreaming, so once scope is later armed in `enforce` that channel content stays visible to operators who should not see it. After copying the dated daily logs, scan their *contents* for channel markers and **flag, never auto-classify**:

      CHANNEL_MARKERS='whats[[:space:]-]?app|\bwsp\b|\bwacli\b|baileys|@g\.us|@s\.whatsapp\.net|\btelegram\b|t\.me/|(nota|mensaje|audio) de voz|voice (note|message)'

      # Dated daily logs only — `find` avoids the zsh no-match glob error.
      find ./memory -maxdepth 1 -type f \( -name '????-??-??.md' -o -name '????-??-??-*.md' \) -print0 |
        while IFS= read -r -d '' f; do
          if LC_ALL=C grep -qiE "$CHANNEL_MARKERS" "$f"; then
            markers=$(LC_ALL=C grep -Eio "$CHANNEL_MARKERS" "$f" | sort -fu | paste -sd ', ' -)
            printf '%s\t%s\n' "$f" "$markers"
          fi
        done

If any dated file is flagged, use `AskUserQuestion` (counts + sample file names and matched markers only — **never the content**):

      AskUserQuestion(
        question: "<N> imported memory files contain channel-derived content (e.g. WhatsApp). Kept as plain memory they bypass scope filtering if you later arm enforce. What should I do with them?",
        options: [
          { label: "Quarantine (recommended)", description: "Move to ./import-quarantine/ (gitignored, NOT indexed). Preserved for manual curation; no scope leak." },
          { label: "Skip them", description: "Delete the copies; don't import these files." },
          { label: "Import as local anyway", description: "Keep as memory/*.md. I accept they bypass scope filtering under enforce." }
        ]
      )

Apply the choice to the flagged files only:

  • **Quarantine**: `mkdir -p ./import-quarantine && mv <flagged> ./import-quarantine/`,

then ensure `import-quarantine/` is gitignored in the target project (append it to `.gitignore`, creating the file if absent). Files outside `memory/` are never indexed by builtin or QMD, so `memory_search` won't surface them.

  • **Skip**: `rm <flagged>`.
  • **Import as local anyway**: leave in place; record the acknowledged bypass in the backlog.

**Also scan `./memory/MEMORY.md` warn-only** with the same `CHANNEL_MARKERS`. `MEMORY.md` is the curated index and IS indexed — but never auto-quarantine it (gutting it breaks the agent). If it matches, record it in the backlog for manual curation instead of moving it.

Record every flagged file in `IMPORT_BACKLOG.md` under `## Memory — Channel-content flagged` (file name + marker matched + chosen action; **never the content**), noting that mixed personal+channel logs need manual split/curation to be both searchable-as-personal and scope-filtered.

6. **Adapt AGENTS.md** for Claude Code: After copying, remove or comment out sections referencing OpenClaw-specific tools:

  • `sessions_spawn`, `message tool`, `browser tool`
  • `gateway`, `cron tool` (native OpenClaw cron), OpenClaw CLI comm
Read more
@crisandrews
Ships withagent

Persistent agents for Claude Code as a plugin, not a harness. Memory, personality, messaging across WhatsApp, Telegram, and Discord, plus a service mode for 24/7 runs. Imports from OpenClaw.

6421 skills1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
64
Star history of crisandrews/ClawCode on GitHub, a chart by star-history.com

Other skills on agent.

about

about

Show the plugin source — name, version, and repo URL. Works from CLI or messaging. Triggers on /about, /version, /agent:about,…

@crisandrews@crisandrewsInstall Skill
channels

channels

Show messaging channel status (WhatsApp, Telegram, Discord, iMessage, Slack, Fakechat) and the launch command to load them.…

@crisandrews@crisandrewsInstall Skill
compact

compact

Flush important session context to daily log (manual memory flush). Does NOT invoke native /compact. Triggers on /compact,…

@crisandrews@crisandrewsInstall Skill
create

create

Create a new agent in the current directory with personality files and bootstrap ritual. Triggers on /agent:create, "crear…

@crisandrews@crisandrewsInstall Skill
crons

crons

Manage scheduled reminders (crons) — list, add, delete, pause, resume, reconcile, or import from OpenClaw. Triggers on…

@crisandrews@crisandrewsInstall Skill
doctor

doctor

Run diagnostic checks on the agent workspace. Triggers on /agent:doctor, "diagnóstico", "diagnostico", "doctor", "health check",…

@crisandrews@crisandrewsInstall Skill

More skills from other plugins.

i-have-adhd

i-have-adhd

Shape output for a reader with ADHD: lead with the next action, number multi-step work, restate state across turns, suppress…

@ayghri@ayghriInstall Skill
ab-test-analysis

ab-test-analysis

Analyze A/B test results with statistical significance, sample size validation, confidence intervals, and ship/extend/stop…

@phuryn@phurynInstall Skill
distilly

distilly

Set up the owner profile so a personal agent knows who it works for (first-run setup, \"get to know me\"), or distill colleague,…

Questions about import.

Which coding agents can use import?
import installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.