Migrating AI Coding Assistant Rules and Memory Without Data Loss
A practical guide to inventorying global instructions, project rules, and long-term memory when switching AI coding tools, plus a reusable migration design: intermediate representations, configurable mappings, conflict reports, idempotency, and post-migration checks.
Migrating AI Coding Assistant Rules and Memory Without Data Loss
Background: A sudden trust problem
People who have used an AI coding assistant for a year or more often store a large amount of “hidden” workspace value on disk: global system instructions, dozens of project rules, and long-term memory files that span sessions. Those assets are easy to ignore until a platform tightens risk controls or an account is flagged by mistake. Then they become the hardest part to take with you.
In a recent wave of client-side enforcement, many developers reported similar outcomes: overseas networks, foreign-currency billing, accounts months old, even browser fingerprint isolation, followed overnight by an automated disable notice. Some accounts were banned repeatedly, with survival time shrinking from months to weeks. Users first blamed “dirty” network setups, then rotated nodes and bought new accounts, with little effect.
Community reverse engineering of the obfuscated client later pointed to subtle checks: the client reads system timezone and API endpoint, and does not log the verdict. Instead it leaks signals through Unicode differences on the date line in the system prompt, date-separator formats, and similar details. That kind of implicit enforcement pushed many users to plan a move across tools.
Accounts can be re-registered and balance recharged. What decides whether you migrate calmly or stay stuck is whether your accumulated context can leave with you intact.
Inventory: what you can actually migrate
Before you move, list the assets. A mature AI coding workspace usually has five kinds of content:
- Global instructions — preferences that apply to every project: style, language, reply format.
- Project rules — directory-scoped constraints: build commands, test conventions, folder responsibilities.
- Long-term memory — structured notes from many sessions: architecture decisions, pitfalls, common API signatures.
- Chat history — raw past conversations, usually the lowest value density.
- Skills / plugins — custom workflows and extensions.
Among the first four, the high-value, hard-to-move pieces are (2) and (3). They hold project knowledge; losing them means the assistant starts from zero. Native import in many tools covers chat logs and plugins and skips rules and memory—the usual place migrations fail.
The core difficulty: incompatible formats
Persistence differs across tools on three axes.
Location. One hidden directory, per-project files, or nested folders under the user home.
File format. Markdown, JSON, YAML, or custom formats with structured metadata. Rules may be free text or require trigger conditions, scope, and priority:
# Tool A rule format (illustrative)---name: python-stylescope: "**/*.py"priority: 10---- Use type annotations- Put tests under tests/# Tool B rule format (illustrative)# Plain text only; scope from filename convention
Semantic model. Some tools treat memory as retrievable knowledge-base entries with tags and timestamps; others append a running log. Copying files as-is does not align meaning.
A typical failed attempt: native import ignores rules and memory; pointing the new tool at the old memory path fails because formats differ; then manual copy-paste, which is slow and incomplete.
Design points for a general migration flow
From that experience, the process can be reduced to five decisions, each aimed at a common failure mode.
1. Parse for meaning, do not copy text
The migrator should parse sources into an intermediate representation: rules as “condition + body,” memory as a list of “time + topic + body.” That layer can emit any target format and avoids one-to-one hardcoded maps. It is also the basis for adding a third or fourth tool later.
2. Make mappings explicit and configurable
Which source field maps to which target field should live in a user-visible, editable config, not only in code. For example:
mappings:global_instructions -> AGENTS_GUIDELINE.mdproject_rules/*.md -> rules/ directory, convert item by itemmemory/entries.json -> memory/ directory, one file per topic
Reviewing the table before a run shows where information might be dropped.
3. Detect conflicts and leave the last call to humans
Same-name files in the destination, contradictory rules, scrambled memory timestamps—all are conflicts. Scan during conversion and emit a report tagged “auto-merge,” “skip,” or “needs confirmation.” Do not overwrite silently. Automation stops at the report.
4. Idempotent and retryable
A run can fail midway. The whole flow should be idempotent: repeats should not duplicate entries, and finished steps should have checkpoints. A simple approach is a content hash as a unique key and a duplicate check before write.
5. Close the loop with checks
After migration: (1) count reconciliation—parsed source items must match items written on the target; (2) sample review—spot-check several items for semantic completeness so format conversion did not truncate or mis-escape content.
A deeper takeaway
The larger lesson is not that “one tool is unreliable.” Parking all knowledge in a single vendor’s private local format is an architecture risk.
More durable habits:
- Prefer portable sources (Markdown plus a conventional directory layout) so rules and memory are already movable.
- Export on a schedule and back up the workspace like a code repo.
- Put architecture decision records (ADRs) in the repository, decoupled from the assistant—swap the tool, keep the knowledge.
Tools and platform policies change. Understanding of your own project should not be locked in. Migration is the after-the-fact fix; format-neutral files and regular backups are the insurance that lets you leave when you need to.
