Claude OS Sync Agent: Hardware-Aware Environment Synchronization with AI
A bash wrapper over Claude CLI that intelligently syncs packages, configurations, and dotfiles between a desktop workstation and laptop, with hardware-aware decision making.
The Project
https://github.com/danielrosehill/Claude-OS-Sync-Agent
danielrosehill/Claude-OS-Sync-Agent View on GitHubI run two Linux machines: a beefy desktop workstation and a more modest laptop for travel. Over time, they inevitably drift apart. New CLI tools get installed on the desktop, dotfile tweaks accumulate, Python packages proliferate. When I grab the laptop for a trip, I spend the first hour installing things I assumed were already there. This project tackles that problem by using Claude CLI as an intelligent synchronization agent that understands hardware constraints.
The key insight is that simple mirroring does not work. My desktop has significantly more RAM and a powerful GPU, so blindly copying everything (especially large Ollama models or GPU-intensive packages) would be counterproductive on the laptop. The sync agent makes hardware-aware decisions about what should and should not be copied.

How the Sync Works
The tool is a bash script (sync-agent.sh) that wraps Claude CLI. It operates in two phases:
First, profile gathering. The script SSHes into both machines and collects comprehensive environment snapshots: installed packages from apt, snap, and flatpak; Python packages from pip and conda; Ollama models; hardware specs (CPU, RAM); and key dotfiles like .bashrc, .gitconfig, and .tmux.conf. These profiles are stored locally in a system-profiles/ directory.
Second, AI analysis. The script feeds both profiles plus a detailed system prompt to Claude CLI. The system prompt instructs Claude to compare the environments, consider hardware capabilities, and produce categorized recommendations: packages to install, packages to remove, dotfiles to sync, and items to skip with reasoning.
Intelligent Decision Making
The system prompt encodes several important operating principles that make this more than a dumb diff tool:
Hardware capability awareness -- If the desktop has a large Ollama model that would choke the laptop's limited RAM, the agent skips it and explains why.
Incremental sync philosophy -- The goal is not a perfect clone. It is a practical, periodic update so the laptop stays useful for travel without becoming a carbon copy.
Reverse cleanup -- If the laptop has packages that the desktop no longer has, the agent infers those tools are no longer valued and suggests removing them.

Running It
The CLI is straightforward. A full sync gathers profiles and runs the analysis. You can also gather profiles independently or analyze existing snapshots without re-collecting data. The tool checks laptop connectivity over SSH before attempting remote operations and degrades gracefully if the laptop is not on the network.
There is also a privacy model built in: the repository ships with a .gitignore that excludes actual system profiles from version control. You can keep a personal sync script (like sync-daniel.sh) with custom profile directories, separate from the public template. The whole thing can also be automated via cron or systemd timer for hands-off daily syncing.
This is one of those projects where the real value is in the system prompt engineering -- teaching Claude to think like a sysadmin who understands that a laptop is not a desktop and that incremental progress beats perfect replication.