Back to Resources
3-Way Merge Protocols, Precedence Rules, and Conflict Resolution Across Coding AgentsLast Updated: Published November 25, 2026

Multi-Laptop Prompt Drift: How to Resolve Divergent AI Instructions After Machine Switches

To resolve prompt drift across multiple laptops, replace timestamp-based file copies with a 3-way merge against your last shared base revision, reconcile YAML frontmatter triggers separately from Markdown bodies, and validate runtime size limits. Centralizing your skills in a versioned library stops silent overwrites across Cursor, OpenAI Codex CLI, Google Antigravity, and Claude Code.

3-Way Merge
Multi-Laptop Sync
Cross-Agent Parity

Edited the same AI rules offline on two laptops? Resolve prompt drift across Cursor, Codex, Antigravity, and Claude Code without silent overwrites.

To resolve prompt drift across multiple laptops, replace timestamp-based file copies with a 3-way merge against your last shared base revision, reconcile YAML frontmatter triggers separately from Markdown bodies, and validate runtime size limits. Centralizing your skills in a versioned library stops silent overwrites across Cursor, OpenAI Codex CLI, Google Antigravity, and Claude Code.

The Sprawl Moment: When Two Laptops Rewrite the Same Migration Rule Offline

You refine a PostgreSQL schema-migration rule on your work MacBook inside Cursor's .cursor/rules/migrations.mdc on Thursday afternoon—adding a strict ban on non-concurrent index locks after a staging incident. On Friday evening, working offline on a flight with your personal laptop, you open the older copy of that same workflow in OpenAI Codex CLI's ~/.codex/skills/migrations/SKILL.md and add three rollback verification steps for multi-tenant tables. When you return to your desk on Monday and sync folders with a timestamp copy script or cloud drive, the Friday edit silently overwrites Thursday's index-lock safeguard—or worse, drops a SKILL (conflicted copy).md sibling file that causes your coding agents to execute contradictory instructions.

Prompttly is a skill manager for AI agents — one library for your skills and prompts that syncs into Claude Code, Codex, ChatGPT, and Claude and is one hotkey away on your Mac, so your setup follows you across every machine, repo, and tool.

Instead of rebuilding lost constraints from memory or arbitrating conflicted Markdown copies across four agent directories, Prompttly stores every revision in one cloud-backed library with built-in version history and sub-200ms Mac hotkey retrieval.

Why Does Multi-Laptop Prompt Drift Happen Across Cursor, Codex, and Antigravity?

Multi-laptop prompt drift occurs because Cursor IDE, OpenAI Codex CLI, Google Antigravity, and Anthropic Claude Code read local filesystem paths independently without a shared distributed lock or merge protocol. When an engineer switches between two laptops or a remote Linux workstation, uncommitted edits, cloud-drive conflicts, and format differences cause instructions to diverge silently.

Four mechanical gaps drive divergence whenever you edit prompts across multiple machines:

  • Asymmetric global and workspace paths: OpenAI Codex CLI reads global instructions from ~/.codex/AGENTS.md and skills from ~/.codex/skills/, Google Antigravity loads global rules from ~/.gemini/AGENTS.md and ~/.gemini/config/rules/*.md, Claude Code reads ~/.claude/skills/, and Cursor scopes project rules inside .cursor/rules/*.mdc. Updating one runtime on Laptop A leaves the other three runtimes stale on Laptop B.
  • Cloud-drive conflicted copy duplication: Syncing agent directories over iCloud Drive or Dropbox creates duplicate files whenever two machines modify the same path while disconnected. Because Google Antigravity Rules documentation confirms that “Rules are cumulative rather than replacement-based: Antigravity combines all the rules it finds into the prompt,” a conflicted copy file does not sit idle—it injects competing constraints into every turn.
  • Timestamp clock skew and mtime blindness: Running rsync -u or manual drag-and-drop copies between machines trusts file modification timestamps (mtime) rather than content diffs. Any non-overlapping fix written earlier on Laptop A gets erased the moment Laptop B saves a newer line in the same file.
  • Tight runtime truncation caps: Divergent merges often push instruction files past strict per-runtime ceilings. OpenAI Codex CLI defaults project_doc_max_bytes to 32 KiB (32,768 bytes) per OpenAI Codex AGENTS.md documentation, while Google Antigravity truncates any single rule file over 24 KB (24,000 bytes) and enforces a 20,000-token aggregate budget across global and always_on rules.

For foundational sync setup before divergence occurs, see our guide on syncing and backing up Claude skills and prompts across computers.

How Does 3-Way Merge Resolve Divergent AI Instructions Without Losing Edits?

A 3-way merge resolves divergent AI instructions by comparing Laptop A's edited file and Laptop B's edited file against their common ancestor snapshot rather than against each other alone. Non-overlapping edits on both machines combine automatically, while true same-line collisions emit explicit conflict markers so neither laptop's rule change disappears silently.

As specified in the official Git git-merge-file documentation:

“Given three files <current>, <base> and <other>, git merge-file incorporates all changes that lead from <base> to <other> into <current>.”

Using git merge-file --zdiff3 adds the shared ancestor block between ||||||| and ======= markers whenever both laptops edited the exact same rule line, and returns exit status 0 for a clean merge or a positive integer (capped at 127) indicating exact conflict count. Run this POSIX script to reconcile a drifted skill file across two laptops safely before syncing back to Codex, Antigravity, Cursor, and Claude Code:

#!/usr/bin/env bash
set -euo pipefail

# Usage: ./merge-prompt-drift.sh <laptop_a_file> <base_ancestor_file> <laptop_b_file> <output_file>
CURRENT="$1"
BASE="$2"
OTHER="$3"
OUT="$4"

cp "$CURRENT" "$OUT"

set +e
git merge-file --zdiff3 -L "laptop-a" -L "shared-base" -L "laptop-b" "$OUT" "$BASE" "$OTHER"
CONFLICTS=$?
set -e

if [ "$CONFLICTS" -lt 0 ]; then
  echo "ERROR: git merge-file failed with negative exit code ($CONFLICTS)" >&2
  exit 1
elif [ "$CONFLICTS" -eq 0 ]; then
  echo "CLEAN MERGE: Combined both laptops into $OUT with 0 conflicts."
else
  echo "CONFLICTS ($CONFLICTS): Review <<<<<<< / ||||||| / >>>>>>> markers in $OUT."
fi

# Verify combined byte size against Antigravity (24,000 B) and Codex (32,768 B) limits
BYTES=$(wc -c < "$OUT" | tr -d ' ')
LINES=$(wc -l < "$OUT" | tr -d ' ')
echo "POST-MERGE METRICS: ${BYTES} bytes, ${LINES} lines"

if [ "$BYTES" -gt 24000 ]; then
  echo "WARNING: $OUT exceeds Google Antigravity 24,000-byte per-file rule cap." >&2
fi
if [ "$LINES" -gt 500 ]; then
  echo "WARNING: $OUT exceeds the Agent Skills 500-line SKILL.md recommendation." >&2
fi

If your Cursor rules live in Git repositories across multiple laptops, pair this workflow with our guide on syncing Cursor rules across machines without Git conflicts.

Conflict Resolution Matrix: Last-Write-Wins vs. Git 3-Way Merge vs. Prompttly

Choosing a multi-laptop conflict strategy depends on whether your team relies on raw filesystem copies, Git commit discipline, or a centralized skill manager with revision history. The matrix below compares five common reconciliation architectures across conflict behavior, ancestor tracking, YAML frontmatter safety, and retrieval latency.

Sync / Merge StrategyConflict BehaviorAncestor TrackingFrontmatter SafetySwitch Latency
Manual Copy & PasteSilent last-write-wins overwriteNoneBreaks YAML schemas on partial edits15–45 seconds per file across folders
iCloud Drive / DropboxSpawns duplicate "(conflicted copy)" filesNone (file-level mtime)High risk of duplicate skill triggersUnpredictable background daemon lag
rsync --updateOverwrites older mtime even if edits differNone (clock-skew vulnerable)Drops edits made earlier on offline laptopManual terminal trigger per switch
Git 3-Way Merge (git merge-file)Diffs both laptops against common base commitFull commit-SHA base snapshotFlags <<<<<<< markers for YAML review45–60 seconds manual commit/pull cycle
Prompttly Skill ManagerCloud-versioned sync + revision historyServer-side revision history per skillValidates SKILL.md structure across targetsAutomatic two-way sync + <200ms Mac hotkey

Which Precedence Rules Should Govern YAML Frontmatter and Instruction Bodies During a Merge?

During a multi-laptop merge, govern YAML frontmatter with strict single-value schema precedence while combining Markdown instruction bullets cumulatively by risk level. Merging frontmatter keys like trigger or description blindly produces invalid YAML that causes Cursor, Antigravity, and Claude Code to silently discard the entire skill.

Follow these four field-level reconciliation rules across coding runtimes:

  • SKILL.md metadata (Codex, Claude Code, Antigravity): Per the Agent Skills Specification, the name field must remain 1–64 lowercase alphanumeric/hyphen characters and the description field must not exceed 1,024 characters. Keep the canonical name unchanged across laptops and union trigger keywords inside description while staying under 1,024 characters.
  • .cursor/rules/*.mdc triggers (Cursor IDE): As documented in the official Cursor Rules documentation: “Project rules live in .cursor/rules as .mdc files and are version-controlled. They are scoped using path patterns, invoked manually, or included based on relevance.” When Laptop A narrows globs and Laptop B toggles alwaysApply: true, prefer the narrower globs scope to prevent unnecessary startup context bloat.
  • .agents/rules/*.md triggers (Google Antigravity): Antigravity silently drops rules whose frontmatter omits a valid trigger (model_decision, always_on, glob, or manual). Never leave Git conflict markers (<<<<<<<) inside YAML frontmatter; resolve the single winning trigger first.
  • Markdown body lines & length ceiling: Merge distinct numbered safeguards from both laptops, remove duplicate constraints, and enforce the Claude Code Skills documentation rule: “Keep SKILL.md under 500 lines. Move detailed reference material to separate files.” Remember that Claude Code scales its skill-listing character budget at 1% of the model's context window, so concise descriptions protect skill discovery.

Here is a concrete before-and-after reconciliation of a conflicted SKILL.md edited offline on two laptops:

# BEFORE: Raw zdiff3 conflict after offline edits on Work MacBook & Travel Laptop
---
name: pg-zero-downtime
<<<<<<< laptop-a
description: Run safe PostgreSQL schema migrations and lock-free index builds.
=======
description: Run safe PostgreSQL migrations, lock checks, and multi-tenant rollbacks.
>>>>>>> laptop-b
---
1. Always run CREATE INDEX CONCURRENTLY.
<<<<<<< laptop-a
2. Set lock_timeout = '2s' before ALTER TABLE.
||||||| shared-base
2. Run migration inside staging first.
=======
2. Capture pre-migration pg_dump schema snapshot.
>>>>>>> laptop-b

# AFTER: Reconciled portable SKILL.md (valid YAML, 0 conflicts, <=1,024-char description)
---
name: pg-zero-downtime
description: Run safe PostgreSQL schema migrations, lock-free index builds, lock_timeout checks, and multi-tenant rollbacks.
---
1. Always run CREATE INDEX CONCURRENTLY.
2. Capture a pre-migration pg_dump schema snapshot in staging first.
3. Set lock_timeout = '2s' before any ALTER TABLE statement.

To validate frontmatter limits cleanly whenever you author or refactor a skill, run your draft through the free Claude Skill Creator.

When Should You Keep Machine-Specific Overrides Separate From Your Global Library?

Keep machine-specific binary paths, OS-dependent shell wrappers, and hardware profile switches out of your synced global skill library by isolating them into local override files. Separating portable engineering workflows from host-specific environment variables prevents every laptop switch from creating false-positive drift.

Apply these boundary rules across macOS, Linux, and Windows workstations:

  1. Use Codex AGENTS.override.md or CODEX_HOME for host quirks: OpenAI Codex CLI natively supports ~/.codex/AGENTS.override.md for temporary machine overrides without mutating your shared AGENTS.md. Keep personal work-profile endpoints in an un-synced override file.
  2. Strip hard-coded /Users/name paths from shared skills: Use $HOME or ~/ relative references so a rule authored on macOS executes identically on a Linux devbox without causing merge churn on every machine switch. For OS-level line-ending and symlink fixes, see moving AI coding agent rules and skills across macOS, Linux, and Windows.
  3. Anchor project-only facts in repo AGENTS.md: Keep repository test commands and CI targets inside the Git repository while extracting personal review checklists and debugging skills into Prompttly. Review how AGENTS.md works across Codex, Cursor, and Antigravity for multi-repo scoping rules.
  4. Run a 30-second post-merge smoke check: Confirm zero <<<<<<< markers remain across ~/.codex/skills, ~/.claude/skills, ~/.gemini/config/rules, and .cursor/rules, confirm zero *(conflicted copy)* files exist, and verify file byte size stays under 24,000 bytes for Antigravity and 32,768 bytes for Codex.
  5. Use Prompttly's Mac hotkey palette for cross-app consistency: When jumping between terminal agents, Cursor, and browser chats on two Macs, invoke Prompttly's sub-200ms hotkey palette rather than maintaining parallel copies in Apple Notes or clipboard history.

Frequently Asked Questions: Resolving Multi-Laptop Prompt Drift

How do you resolve prompt drift across multiple laptops without losing offline edits?

To resolve prompt drift across multiple laptops without losing offline edits, run a 3-way merge against the last shared ancestor revision using git merge-file --zdiff3 rather than overwriting by timestamp. After reconciling the YAML frontmatter and Markdown body, sync the single merged file back to ~/.codex/skills, ~/.claude/skills, ~/.gemini/config/rules, and .cursor/rules.

Why does last-write-wins timestamp sync fail for AI agent skills?

Last-write-wins sync fails because modifying two different sections of a SKILL.md or AGENTS.md file on two offline laptops causes the newer file modification timestamp to erase the older laptop edits completely. Clock skew across macOS, Linux, and virtualized devboxes also breaks mtime comparisons.

What happens when iCloud Drive or Dropbox creates conflicted copies of SKILL.md or Cursor rules?

When iCloud Drive or Dropbox creates a conflicted copy such as rule (conflicted copy).mdc or duplicate skill folders, Cursor, Claude Code, and Google Antigravity load both files into context simultaneously. Duplicate rules waste token budgets and trigger contradictory agent instructions.

How does Prompttly prevent divergent AI instructions between a work MacBook and a personal laptop?

Prompttly keeps one cloud-versioned skill library with full revision history and projects native skill folders into Claude Code and Codex via two-way Mac sync. You also get <200ms global hotkey access to the exact same verified prompts inside Cursor, Antigravity, ChatGPT, and Claude.

Next Steps: Standardize One Portable Library Across Every Machine

Eliminating multi-laptop prompt drift across OpenAI Codex CLI, Cursor IDE, Google Antigravity, and Claude Code requires replacing ad-hoc file copies with one versioned skill library. Explore all cross-agent guides on the Prompttly resources hub, or dive into managing prompt sprawl across 3+ AI coding assistants, syncing and backing up Claude skills across computers, and syncing Cursor rules across machines without Git conflicts. Ready to stop resolving manual file conflicts? Try the free Claude Skill Creator or download Prompttly for Mac.

Eliminate multi-laptop prompt drift with one versioned skill library

Prompttly keeps your skills and prompts versioned in the cloud, syncs native skill folders into Claude Code and Codex via two-way Mac sync, and gives you <200ms hotkey insertion inside Cursor, Antigravity, ChatGPT, and Claude.