Docs
Home GitHub npm

Platform Adapters

SaveState ships with 6 built-in adapters. Each knows how to extract and restore state for a specific AI platform.

Overview

Adapters are checked in priority order during auto-detection. The first adapter whose detect() method returns true is used. You can override this with --adapter <id>.

AdapterPlatformExtractRestoreMethod
clawdbotClawdbot / Moltbot✅ Full✅ FullDirect file access
claude-codeClaude Code✅ Full✅ FullDirect file access
openai-assistantsOpenAI Assistants API✅ Full✅ FullAPI (v2)
claude-webClaude (claude.ai)✅ Full⚠️ PartialData export
chatgptChatGPT✅ Full⚠️ PartialData export
geminiGoogle Gemini✅ Full⚠️ PartialTakeout + API

Full restore means SaveState can programmatically recreate your AI state. Partial restore means a restore guide is generated for manual re-entry (the platforms don't provide import APIs).

Detection Order

When you run savestate snapshot without --adapter, adapters are tried in this order:

  1. Clawdbot — looks for SOUL.md, memory.md, AGENTS.md, or memory/ directory
  2. Claude Code — looks for CLAUDE.md or .claude/ directory
  3. Claude Web — checks SAVESTATE_CLAUDE_EXPORT env var, or claude-export/, or .savestate/imports/claude/
  4. OpenAI Assistants — checks for OPENAI_API_KEY env var or .openai/ directory
  5. ChatGPT — checks SAVESTATE_CHATGPT_EXPORT env var, or chatgpt-export/, or conversations.json
  6. Gemini — checks SAVESTATE_GEMINI_EXPORT env var, Gemini Apps/ directory, or GOOGLE_API_KEY

🤖 Clawdbot Full Support

First-party adapter for Clawdbot / Moltbot workspaces. Captures the complete agent identity.

What it captures

  • Identity: SOUL.md, USER.md, AGENTS.md, TOOLS.md
  • Memory: memory.md, MEMORY.md, all files in memory/ directory (.md, .json, .txt)
  • Skills: All skills/*/ directories — SKILL.md, config files, scripts
  • Scripts: personal-scripts/ including cron wrappers
  • Extensions: Config files from extensions/*/ (no node_modules)
  • Conversations: Session logs from ~/.clawdbot/agents/*/sessions/*.jsonl
  • Config: .env, config.json, config.yaml

Detection

Looks for any of: SOUL.md, memory.md, AGENTS.md, memory/

Restore capabilities

Full restore: all identity files, memory, skills, scripts, extensions, and config are written back to the workspace. Existing files are backed up with .bak.

🖥️ Claude Code Full Support

Adapter for Anthropic's Claude Code coding agent. Captures project-level and global instructions.

What it captures

  • Identity: CLAUDE.md at project root + subdirectories (up to 3 levels), global ~/.claude/CLAUDE.md
  • Memory: .claude/todos.md, .claude/memory/ directory
  • Settings: .claude/settings.json, .claude/settings.local.json, ~/.claude/settings.json (global)
  • Project metadata: package.json, pyproject.toml, Cargo.toml, go.mod, etc.
  • File manifest: Project file tree (paths + sizes, not content) up to 6 levels deep

Detection

Looks for CLAUDE.md or .claude/ directory in the current project.

Restore capabilities

Full restore: CLAUDE.md files, .claude/ settings, and memory files are written back. Global ~/.claude/ settings are also restored.

⚡ OpenAI Assistants Full Support

Full API adapter for OpenAI Assistants API v2. Extracts and restores assistants, files, vector stores, and threads.

Environment variables

OPENAI_API_KEYRequired. Your OpenAI API key (sk-...)
SAVESTATE_OPENAI_ASSISTANT_IDOptional. Target a specific assistant. Without it, SaveState lists all assistants and uses the first one.

What it captures

  • Identity: Assistant instructions, name, description, model, temperature, top_p, response_format
  • Tools: Code interpreter, file search, custom functions (with schemas)
  • Files: All files in code_interpreter and file_search tool_resources (downloaded as binary)
  • Vector stores: Store configurations, file lists, metadata, expiration settings
  • Threads: Messages from cached thread IDs (stored in .savestate/openai-threads.json)

Detection

Checks for OPENAI_API_KEY env var, or .openai/ directory in home or project.

Restore capabilities

Full restore via API: creates a new assistant with the original configuration, uploads files, creates vector stores, and optionally recreates threads with messages. The new assistant ID is printed on completion.

ℹ️ Thread caching: OpenAI has no "list all threads" API. To capture threads, maintain .savestate/openai-threads.json with your thread IDs. Format: {"assistant_id": "asst_...", "thread_ids": ["thread_..."]}

🟣 Claude Web (claude.ai) Extract + Partial Restore

Export-based adapter for the Claude consumer web interface. Different from Claude Code.

Data sources (checked in order)

  1. SAVESTATE_CLAUDE_EXPORT env var → path to export directory
  2. claude-export/ or claude_export/ in current directory
  3. .savestate/imports/claude/
  4. Standalone claude-memories.md or claude-memories.txt file

What it captures

  • Conversations: All conversations from the export (JSON format with messages, attachments)
  • Memories: Claude memory entries (text/markdown or JSON format)
  • Projects: Claude Project instructions and uploaded files
  • Account info: User profile from account_info.json

Restore capabilities

Partial — Claude.ai has no import API. SaveState generates:

  • claude-restore-guide.md — step-by-step manual restore instructions
  • memories-to-import.md — individual memories formatted for manual re-entry
  • projects/project-instructions.md — project instructions for manual recreation

💬 ChatGPT Extract + Partial Restore

Export-based adapter for ChatGPT. Uses the data export from Settings → Data Controls → Export Data.

Data sources

  1. SAVESTATE_CHATGPT_EXPORT env var → path to extracted export directory
  2. chatgpt-export/ in current directory
  3. conversations.json directly in current directory
  4. .savestate/imports/chatgpt/

What it captures

  • Conversations: Full tree-structured conversation history (walks the mapping/branching structure)
  • Memories: ChatGPT memories from memories.json
  • Custom instructions: "About user" and "Response preferences" from custom_instructions.json
  • User profile: Account metadata from user.json

Restore capabilities

Partial — ChatGPT has no import API. Generates:

  • chatgpt-restore-guide.md — comprehensive restore instructions
  • chatgpt-memories.md — memories formatted for manual re-entry
  • chatgpt-custom-instructions.md — custom instructions for copy-paste

✨ Google Gemini Extract + Partial Restore

Captures Gemini conversations from Google Takeout exports and API data (tuned models, cached content).

Data sources

SAVESTATE_GEMINI_EXPORTPath to Google Takeout "Gemini Apps" export directory
GOOGLE_API_KEY or GEMINI_API_KEYFor API-based capture (tuned models, cached content)

Also checks: Gemini Apps/, Takeout/Gemini Apps/, .savestate/imports/gemini/

What it captures

  • Conversations: All conversations from Takeout export (JSON files)
  • Gems: Custom agent configurations (name, instructions, model) from gems.json or Gems/ directory
  • Tuned models: Model configs, hyperparameters, state (via API)
  • Cached content: Cached content entries and metadata (via API)

Restore capabilities

Partial — generates:

  • gemini-restore-guide.md — complete restore instructions
  • Individual Gem JSON files for manual recreation at gemini.google.com/gems
  • Conversation index for archival reference