Migrating Context Assets in AI Coding Assistants: A Universal Backup and Portability Solution for Instructions, Rules, and Memory
AI coding assistants accumulate highly personalized "context assets" over months of use — global instructions, rule files, long-term memory, and project-level configurations. This guide explains where these assets are typically stored, why most built-in import features leave critical pieces behind, and how to design a script-based migration pipeline that reliably transfers your full context between tools. It closes with practical advice on treating context as an engineering asset that deserves versioned backups and open formats.
Why You Can Start Over with a New Account, but Not with a New Context
AI coding assistants have rapidly become a core part of developers’ daily workflows. After months of use, what these tools accumulate goes far beyond chat history — they build a complete set of “development context assets”:
- Global instructions: your coding style, language preferences, and descriptions of your usual tech stack;
- Rule files: specific requirements covering code standards, security constraints, and directory structure;
- Long-term memory: project background, decision history, and lessons learned that the tool records automatically during collaboration;
- Project-level configurations: role definitions and workflow conventions maintained per repository.
These assets are highly personal and incrementally accumulated. They aren’t documents written once — they are the result of continuous iteration over months of interaction. When account restrictions, risk controls, or platform policy changes force a service interruption, re-registering only restores “a working tool,” not “a tool that knows you.” A fresh account puts the assistant back at zero understanding, requiring weeks or even months of re-training.
A more practical problem: most tools’ import capabilities cover only surface-level assets. In typical migration scenarios, native import features usually support conversation history, plugins, and skill files, while rule files and long-term memory are excluded because their storage paths are hidden and their formats undocumented. Developers who click “one-click import” often assume the migration is complete — when in fact they’ve lost the most critical parts.
Where Context Assets Usually Live
To migrate universally, you first need to understand the typical storage structure of these tools. Implementations vary, but common patterns exist across the industry:
1. A hidden configuration directory in the user’s home directory
Most terminal-based coding assistants maintain a config directory in the home folder, typically at a path like .toolname, containing:
~/.assisttool/├── config.json # Global configuration├── instructions.md # Global instructions├── rules/ # Rule file collection│ ├── code-style.md│ ├── security.md│ └── ...└── memory/ # Long-term memory├── project-a.md└── project-b.md
2. Project-level local configurations
Beyond the global directory, each code repository usually has its own project-level configuration files recording repo-specific conventions. This part is the easiest to miss during migration — it’s scattered across dozens of repositories with no central entry point.
3. The memory format problem
Long-term memory is usually stored as Markdown or Markdown-like structured text, but parsing conventions differ across tools: some use specific heading levels to separate memory entries, some use metadata headers with timestamps and confidence scores, and some bind memory to index files. This means simply redirecting a directory path into another tool’s read scope won’t work — format conversion is required.
Three Migration Approaches and Their Pitfalls
Approach 1: Manual copy and paste
Open the old directory, read through memory and rule files one by one, and manually transcribe them into the new tool. This is most people’s first instinct, with obvious drawbacks:
- Memory entries can easily number in the hundreds — time-consuming and error-prone;
- Manual transcription often loses metadata (entry source, update time, scope of applicability);
- No incremental maintenance: if the old environment remains briefly usable after migration, the two sides quickly diverge.
Approach 2: Path redirection
Pointing the new tool directly at the old directory is theoretically attractive but almost guaranteed to fail in practice:
- The two tools use different file-naming conventions (rule file prefixes, memory file granularity, etc.);
- Memory entries carry different semantic markers — the new tool may treat an entire memory block as plain text, losing retrieval capability;
- Some tools validate directory structure at startup and silently ignore non-native formats.
Approach 3: Scripted format conversion (recommended)
Write or reuse a synchronization script that runs a “read — parse — convert — write” pipeline. The core value: it’s repeatable, covers all assets, and can be version-controlled. This is a general engineering practice: turn a one-time migration problem into a continuously runnable synchronization problem.
A Reusable Migration Script Design
Even without off-the-shelf tools, implementing a migration script yourself isn’t complicated. The core logic has four steps:
Step 1: Enumerate source assets. Traverse the old tool’s config directory, collecting instruction, rule, and memory files, while also scanning repositories for project-level configurations:
from pathlib import Pathdef collect_assets(base: Path):assets = {"instructions": [], "rules": [], "memory": []}assets["instructions"] += list(base.glob("instructions*.md"))assets["rules"] += list(base.glob("rules/*.md"))assets["memory"] += list(base.glob("memory/**/*.md"))return assets
Step 2: Parse and clean. Parse the Markdown line by line, stripping the old tool’s private markers (special comment headers, proprietary metadata fields) while preserving pure semantic content.
Step 3: Convert to the target format. Reorganize content according to the new tool’s conventions — typically one topic per rule file, and memory items broken into individual entries with brief descriptions:
def convert_memory(entry: str) -> str:# Strip private markers and reorganize into a universal entry formatlines = [l for l in entry.splitlines()if not l.startswith("<!--")]return "\n".join(lines).strip() + "\n"
Step 4: Write and verify. After writing to the new tool’s directory, run a dry-run comparison: count entries, total bytes, and keyword coverage on key topics. Only clean up intermediate artifacts after confirming nothing is missing.
Beyond Migration: Treating Context Assets as Engineering Assets
The broader lesson here is a universal principle: anything that accumulates incrementally and is hard to rebuild — configurations and knowledge alike — deserves independent backups and a portable format. In practice, three recommendations:
- Manage the config directory with Git. Make the assistant’s config directory a symlink into a Git repository, so every change is automatically versioned — and instantly recoverable whenever account issues arise.
- Write rules and memory in open formats. Stick to standard Markdown and common structures; avoid tool-specific syntax to guarantee portability at the source.
- Practice migration drills. Periodically do a cold start on another machine or environment using your backup to verify its integrity — a backup only counts as a backup once it’s been tested.
Accounts and subscriptions can be reacquired, but months of accumulated development context, once lost, carries a rebuilding cost far beyond what most people imagine. Designing backup and migration mechanisms in advance is the real defense against any tool-level disruption.
