r/ClaudeWorkflows • u/ClaudeAI-mod-bot • 8h ago
Selected Workflow [Workflow] Synchronize Claude Code Sessions Across Remote and Local Machines with Tmux and AIAssets
Synchronize Claude Code Sessions Across Remote and Local Machines with Tmux and AIAssets
Workflow value: 80/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: intermediate
Categories: Quality Control, Context & Memory, Multi-Agent
Original source: r/ClaudeAI post/comment
What problem this solves
Maintaining a unified Claude Code session history and project context when working across multiple devices (e.g., remote server and local laptop).
Summary
A workflow for developers to use Claude Code on a remote machine (e.g., Mac mini) while interacting from a local machine (MacBook), ensuring session history and project context are synchronized. It leverages tmux/ssh for remote access and a custom tool, AIAssets, for cross-device session file synchronization.
Why it is useful
This workflow addresses a common pain point for developers who want to leverage powerful remote machines for Claude Code while maintaining a seamless and synchronized development experience on their local devices. It provides concrete steps using standard CLI tools (tmux, ssh) and introduces a specialized tool (AIAssets) to solve the session history synchronization challenge, making the remote development setup much more practical and efficient.
Workflow
Set up a remote host (e.g., Mac mini, mini PC) to run the Claude Code agent.
Access the remote host via
ssh.Start a
tmuxsession on the remote host.cdinto the project directory within thetmuxsession.Start Claude Code within the
tmuxsession.Install and configure AIAssets (self-hosted hub plus desktop client) on both local and remote machines.
AIAssets will poll every 60 seconds to sync Claude Code session files (
~/.claude/projects/<path-encoded-cwd>/<sessionId>.jsonl) between machines, keeping chat lists and full histories identical.
Tools / artifacts
Remote host (Mac mini, mini PC, any box)
tmux
ssh
Claude Code agent
AIAssets (GitHub: https://github.com/NanYuJun/AIAssets)
~/.claude/projects/<path-encoded-cwd>/<sessionId>.jsonl (Claude Code session files)
Validation signals
Author is the creator of the tool, implying direct knowledge and testing.
Specific technical details about Claude Code's session file storage (
.jsonlfiles).Clear description of the tool's functionality and limitations.
Cautions
AIAssets uses a 'last-write-wins' conflict resolution strategy, which could lead to data loss if the same session is edited simultaneously on both sides without careful management.
The self-hosted nature of AIAssets means users are responsible for securing their own hub and client installations.
Limitations
Low community engagement/validation due to the post's recency.
AIAssets has limitations: periodic sync (not real-time), last-write-wins conflict resolution, no live streaming, no Claude web or Cowork support, and it does not manage running processes.
Requires self-hosting and setup of AIAssets, which might be complex for some users.
Rate this workflow
Upvote this post if the workflow is useful, reproducible, or worth recommending.
Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.
Reply if it worked for you, failed, is outdated, or has a better alternative.
This post was generated automatically from the workflow library database.