A portable configuration system for Claude Code. Sync your slash commands, behavioral rules, and global instructions across machines via Git.
├── install.sh # One-line installer
├── sync.sh # Push/pull sync engine
├── CLAUDE.md # Global instructions (loaded in every project)
├── commands/ # Slash commands (invoked with /<name>)
│ ├── push.md # /push — commit and push with foundation file checks
│ ├── make-pr.md # /make-pr — create a PR from the current branch
│ ├── doc-sync.md # /doc-sync — sync Google-style docstrings for staged files
│ ├── fix-loop.md # /fix-loop — iterative measure→diagnose→fix→verify cycle
│ ├── hypothesis-lab.md # /hypothesis-lab — parallel experiments in isolated worktrees
│ ├── perf-optimize.md # /perf-optimize — profile and optimize bottlenecks
│ ├── update-harness.md # /update-harness — analyze session logs, propose rule improvements
│ ├── add-command.md # /add-command — guide for creating new slash commands
│ ├── system-prompt-editor.md # /system-prompt-editor — edit global CLAUDE.md
│ ├── plan-create.md # /plan-create — produce a structured execution plan doc
│ ├── plan-execute.md # /plan-execute — orchestrate subagents to run a plan doc
│ ├── codex-adversarial-review.md # /codex-adversarial-review — Codex plan review wrapper (used by /plan-create Phase 4.5)
│ ├── codex-review.md # /codex-review — Codex implementation review wrapper (used by /plan-execute Phase 6)
│ ├── codex-plan-execute.md # /codex-plan-execute — execute a plan via Codex CLI sessions (Claude reviews)
│ └── codex-loop.md # /codex-loop — iteratively delegate fix-loop cycles to Codex until a termination gate is met
├── hooks/ # Per-project hooks (manually copied into <project>/.claude/hooks/)
│ └── plan_gate.py # PreToolUse hook that blocks edits while /plan-create is mid-planning
├── rules/ # Behavioral rules (always loaded, no invocation needed)
│ ├── documentation-standard.md # Google-style docstrings, JSDoc, test requirements
│ ├── tdd-workflow.md # Red-green-refactor cycle enforcement
│ ├── read-before-guessing.md # Read class/API definitions before accessing attributes
│ └── subagent.md # Worktree isolation safety, background task constraints
└── scripts/
└── parse_sessions.py # Extract failure signals from session logs (used by /update-harness)
GitHub forks of public repos are always public. To keep your config private, create a new repo from this one:
# 1. Create a new private repo on GitHub (do NOT use Fork)
gh repo create my-claude-memory --private
# 2. Clone this repo, swap the remote to yours, and push
git clone https://github.com/Serin511/Claude-Memory-Public.git ~/.claude-sync
cd ~/.claude-sync
git remote set-url origin https://github.com/<you>/my-claude-memory.git
git push -u origin mainOr via the GitHub UI: click Use this template → Create a new repository → set visibility to Private (if the template button is available), then clone normally.
# If you already cloned in Step 1, just run the installer
~/.claude-sync/install.sh
source ~/.zshrc # or ~/.bashrcOr as a one-liner (replace with your private repo URL):
curl -fsSL https://raw.githubusercontent.com/<you>/my-claude-memory/main/install.sh | bash -s -- https://github.com/<you>/my-claude-memory.git
source ~/.zshrc # or ~/.bashrcThis will:
- Clone your repo to
~/.claude-sync/ - Symlink configurations into
~/.claude/(commands, rules, CLAUDE.md) - Add auto-sync hooks to your shell RC file
Add this repo as a remote to pull future updates:
cd ~/.claude-sync
git remote add upstream https://github.com/Serin511/Claude-Memory-Public.git
# Pull upstream changes when needed
git fetch upstream
git merge upstream/mainYour local customizations stay intact — only new or updated files from upstream are merged.
The installer creates symlinks from ~/.claude/ (where Claude Code reads config) to ~/.claude-sync/ (the Git repo):
~/.claude/commands/ → ~/.claude-sync/commands/
~/.claude/rules/ → ~/.claude-sync/rules/
~/.claude/CLAUDE.md → ~/.claude-sync/CLAUDE.md
This means Claude Code reads directly from the Git-managed directory. Any changes you make are tracked by Git.
The installer adds shell hooks to your .zshrc / .bashrc:
ssh: Automatically pushes local config before SSH-ing to a remote machine- Login shell: Automatically pulls latest config when you log in (with 5-minute cooldown)
claude-sync push: Manually push local changesclaude-sync pull: Manually pull remote changes
Claude Code occasionally replaces symlinks with regular files. The sync engine detects this, copies the content back to the repo, and re-creates the symlink — no manual intervention needed.
Stages changes, updates foundation files (README, CLAUDE.md, .gitignore, dependency files), writes a conventional commit message, and pushes.
Creates a GitHub PR from the current branch using gh. Analyzes commits, writes title/body, and handles remote branch setup.
Scans staged and modified .py / .ts / .tsx files, updates missing or outdated docstrings to Google style (Python) or JSDoc (TypeScript), and re-stages.
Generic measure → classify → fix → verify → repeat framework. Define your baseline measurement, verification commands, and termination condition in your project's CLAUDE.md, then run /fix-loop to iterate until the target is met.
Tests multiple solution strategies simultaneously using isolated git worktrees. Each approach runs in its own worktree subagent, verified independently, then merged sequentially through a regression-gated queue.
Profiles application performance, identifies bottlenecks, and optimizes using the /fix-loop cycle. Supports Python (cProfile) and Node.js profiling, with parallel strategy testing via /hypothesis-lab.
Parses Claude Code session logs to find failure patterns (tool errors, retry loops, user corrections), cross-references with existing rules, and proposes improvements to CLAUDE.md and rules files.
Reference guide for creating new slash commands — covers frontmatter options, security restrictions, and common patterns.
Opens ~/.claude/CLAUDE.md for direct editing with backup support.
Breaks down a multi-phase goal into a structured plan document with major tasks, sub-tasks, dependency ordering, verification gates, and carry-forward rules. The plan document is a durable Markdown artifact that survives session boundaries and is executable by /plan-execute.
Reads a plan document produced by /plan-create and executes it — one major task at a time. Each task is delegated to a dedicated subagent with full context, verification commands, and progress tracking. Handles crash recovery, dependency resolution, and discovered work routing.
Project-local wrapper that calls codex exec via Bash to adversarially review a plan document. Used by /plan-create Phase 4.5 to bypass the upstream /codex:adversarial-review plugin's disable-model-invocation restriction so the agent can auto-invoke it. Requires the codex CLI on PATH (npm i -g @openai/codex).
Project-local wrapper that calls codex exec via Bash to review the diff between a base SHA and HEAD. Used by /plan-execute Phase 6 to review code/document deliverables. Same agent-invocation rationale as /codex-adversarial-review.
Inverse of /plan-execute: dispatches each major task to a codex exec --full-auto session (instead of a Claude subagent) and uses a Claude subagent for the Phase 6 deliverable review. Useful when you want a different model's implementation perspective, or when Codex's coding strengths fit the task. The Codex prompt must be fully self-contained — pull project invariants from CLAUDE.md / .claude/rules/ into the prompt explicitly.
Iteratively delegates one fix-loop cycle to Codex, with the Claude orchestrator checking the termination gate between cycles. Each cycle is a clean codex exec --full-auto run with a prior-cycle summary embedded in the prompt; loop runs until the user-specified verification command (--until <cmd>) is satisfied, stalls, or is aborted. Surfaces stalls and regressions to the user instead of auto-aborting.
hooks/plan_gate.py is a PreToolUse hook that gates Edit/Write/MultiEdit/NotebookEdit while /plan-create is mid-planning, so Claude cannot start coding before the plan is reviewed. It is per-project, not global — copy it into your project rather than relying on the symlink installer.
# From your project root:
mkdir -p .claude/hooks .claude/data
cp ~/.claude-sync/hooks/plan_gate.py .claude/hooks/plan_gate.py
echo ".claude/data/plan-gate.json" >> .gitignoreThen register the hook in your project's .claude/settings.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|Write|MultiEdit|NotebookEdit",
"hooks": [
{
"type": "command",
"command": "python3 \"$CLAUDE_PROJECT_DIR/.claude/hooks/plan_gate.py\""
}
]
}
]
}
}The hook reads .claude/data/plan-gate.json (written by /plan-create and /plan-execute) and blocks implementation tools while stage == "plan-creating". Writes under plans/ and to the gate state file itself stay allowed so the planning commands can produce their own artefacts. Manual override: rm .claude/data/plan-gate.json.
/plan-create and /plan-execute work even without this hook installed — the gate file then acts as a soft contract between the two commands rather than a hard enforcement.
Rules are always loaded into Claude Code's context. Unlike commands, they don't need to be invoked.
| Rule | Purpose |
|---|---|
documentation-standard.md |
Enforce Google-style docstrings (Python) and JSDoc (TypeScript) |
tdd-workflow.md |
Red → Green → Refactor cycle; tests before implementation |
read-before-guessing.md |
Read class/API definitions before accessing attributes; inspect JSON before parsing |
subagent.md |
Worktree isolation safety, background task constraints, zombie agent prevention |
Create a markdown file in ~/.claude-sync/commands/:
---
allowed-tools: Read, Edit, Bash(git:*)
description: What this command does
---
# My Command
Instructions for Claude here.Then run claude-sync push to sync across machines.
Create a markdown file in ~/.claude-sync/rules/:
## My Rule
Always do X when Y happens because Z.Rules are loaded automatically — no frontmatter needed.
By default, per-project memory (~/.claude/projects/*/memory/) is not synced. To enable it, export CLAUDE_SYNC_PROJECTS=1 in your shell RC file before the claude-sync block:
export CLAUDE_SYNC_PROJECTS=1When enabled, claude-sync push collects project memory into the repo and claude-sync pull symlinks it back. This is useful for syncing memory across machines, but the memory may contain project-specific context you don't want in version control.
Edit ~/.claude-sync/CLAUDE.md or use /system-prompt-editor within Claude Code.
claude-sync push # commit and push local changes
claude-sync pull # pull remote changes and repair symlinks- Remove the sync block from your shell RC file (between
# >>> claude-sync >>>and# <<< claude-sync <<<) - Remove symlinks:
rm ~/.claude/commands ~/.claude/rules ~/.claude/CLAUDE.md - Remove the repo:
rm -rf ~/.claude-sync
- macOS or Linux
- Git
- Claude Code CLI
ghCLI (only for/make-pr)
MIT