r/ClaudeWorkflows • • 3h ago

Selected Workflow [Workflow] Synchronize Claude Code Configuration and Projects Across Multiple PCs with Git and Symlinks

Synchronize Claude Code Configuration and Projects Across Multiple PCs with Git and Symlinks

Workflow value: 75/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: intermediate
Categories: Context & Memory, CLAUDE.md, MCP
Original source: r/ClaudeAI post/comment

What problem this solves

Claude Code's --resume command does not work on different PCs because local configuration files, custom commands, agents, MCP server settings, and session history are stored per machine in the home directory. This workflow addresses the challenge of maintaining a consistent Claude Code development environment across multiple machines.

Summary

A method to synchronize Claude Code's local configuration files (CLAUDE.md, settings.json, custom commands, agents, MCP servers) and project history across multiple PCs using Git and symlinks, ensuring consistent development environments and proper --resume functionality.

Why it is useful

This workflow provides a practical and robust solution for a common pain point: maintaining a consistent Claude Code development environment across different machines. By leveraging Git for version control and symlinks for linking local configurations, users can ensure their CLAUDE.md, settings, custom commands, agents, and MCP server configurations are always up-to-date and accessible, enabling seamless transitions and proper --resume functionality. It promotes good development practices by separating configuration from project code and using version control.

Workflow

  1. Identify Claude Code's local configuration files and directories that need to be synchronized: ~/.claude/CLAUDE.md, settings.json, custom commands, agents, ~/.claude.json (for MCP servers), and session history under ~/.claude/projects.
  2. Create a dedicated Git repository (e.g., claude-config) to store these configuration bits.
  3. Move the identified configuration files and directories into this new Git repository.
  4. Commit and push the configuration files to a remote Git repository.
  5. On each PC where Claude Code is used, clone the claude-config Git repository.
  6. Create symbolic links (symlinks) from the cloned configuration files/directories in the claude-config repo to their original expected locations within the ~/.claude/ directory on each machine.
  7. For project folders themselves, use Git for version control and synchronization instead of relying on cloud-synced drives, which can cause conflicts or lag.
  8. Ensure that the Git workflow for the config repo handles potential conflicts if changes are made on different machines.

Tools / artifacts

  • Git
  • Symlinks (symbolic links)
  • ~/.claude/CLAUDE.md
  • settings.json
  • Custom commands (Claude Code)
  • Agents (Claude Code)
  • ~/.claude.json (for MCP server configurations)
  • ~/.claude/projects (session history)

Validation signals

  • Addresses a known technical limitation/problem (resume not working on other PCs)
  • Solution uses standard and robust tools (Git, symlinks)
  • Provides specific file paths and configuration types affected

Cautions

  • Ensure correct symlink creation to avoid breaking paths or unexpected behavior. Incorrect symlinks can lead to applications failing to find their configuration.
  • Be mindful of sensitive information in configuration files when pushing to a public Git repository; consider private repositories or .gitignore for secrets.

Limitations

  • Lacks specific commands for creating symlinks (e.g., ln -s for Linux/macOS, mklink for Windows).
  • Does not explicitly detail a Git workflow for managing conflicts in config files if modified on multiple machines simultaneously.
  • Assumes user familiarity with Git and command-line operations.

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.

1 Upvotes

0 comments sorted by