Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By Davidcreadorv3.1.0MIT
Keeps a separate CLAUDE.md memory for each git branch and swaps it in when you check out or switch branches. Hooks inject the active branch memory at session start and on every prompt and tool call, so it updates mid-session.
Trending plugins
7-day copy clicks
Claude Code doesn't load everything this plugin declares
dist/cli.js, which isn't in the repository. Claude Code installs the plugin without an error, but the hooks exit with an error each time they run. Claude Code installs a copy of the repository and runs no build step.Checked against Claude Code 2.1.332.
Claude loads one when your task matches it, or you run it by name.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Automatic branch-specific CLAUDE.md memory management for Claude Code. When you switch git branches, your Claude Code context switches with you.
When working across multiple git branches, your CLAUDE.md file contains context specific to one branch. Switching branches means Claude Code loses that context, or worse, has the wrong context for your current work.
Branch Memory Manager saves and loads branch-specific CLAUDE.md files automatically. Each branch gets its own memory, stored in .claude/memories/.
As a Claude Code plugin — memories switch automatically when you run git checkout or git switch inside Claude Code. No manual intervention needed.
As a CLI — manually save, load, and manage branch memories from your terminal.
Install from the plugin marketplace inside Claude Code:
/plugin marketplace add Davidcreador/claude-code-branch-memory-manager
/plugin install branch-memory@davidcreador
Or install the npm package and load it with --plugin-dir:
# Install the npm package in your project
npm install --save-dev claude-code-branch-memory-manager
# Or install globally
npm install -g claude-code-branch-memory-manager
Then load as a plugin:
claude --plugin-dir ./node_modules/claude-code-branch-memory-manager
Once installed, branch memory switching happens automatically:
git checkout feature/auth inside Claude CodeCLAUDE.md to .claude/memories/main.md.claude/memories/feature_auth.md into CLAUDE.mdfeature/auth work# Initialize in your repo
branch-memory init
# Save current context
branch-memory save "Implemented user auth"
# Switch branches (saves + loads automatically)
branch-memory switch feature/api
# List all saved memories
branch-memory list
# Check status
branch-memory status
| Command | Description |
|---|---|
branch-memory save [description] | Save current CLAUDE.md to branch memory |
branch-memory load <branch> | Load memory from a specific branch |
branch-memory list | List all stored branch memories |
branch-memory status | Show current branch and memory status |
branch-memory switch <branch> | Git switch + memory swap in one command |
branch-memory copy <src> <dst> | Copy memory between branches |
branch-memory clean | Remove memories for deleted branches |
branch-memory restore [branch] | Restore from backup |
branch-memory init | Set up branch memory in current repo |
branch-memory version | Show version |
Branch memories are stored in .claude/memories/ within your repository:
your-repo/
├── CLAUDE.md # Active memory (read by Claude Code)
├── .claude/
│ └── memories/
│ ├── main.md # Memory for main branch
│ ├── feature_auth.md # Memory for feature/auth
│ ├── feature_api.md # Memory for feature/api
│ └── .backups/ # Automatic backups
│ └── main.2025-03-18T...md
When installed as a Claude Code plugin, four hooks handle automatic switching. Each one injects the active branch memory into the live session via Claude Code's additionalContext mechanism (writing the file on disk alone does not update an already-loaded context):
SessionStart — Loads the correct branch memory when Claude Code startsPostToolUse (Bash) — Detects git checkout / git switch commands and swaps memoriesUserPromptSubmit — Detects branch switches made outside Claude Code (e.g. another terminal) and swaps memories. Cheap no-op when the branch hasn't changed, so it does not bloat every promptSessionEnd — Saves the active CLAUDE.md back to the current branch when the session endsWhen switching to a branch with no saved memory, the tool looks for a fallback in this order: main → master → develop. This is configurable.
Create a .branch-memory.json in your repo root:
{
"memoryDir": ".claude/memories",
"memoryFileName": "CLAUDE.md",
"autoSaveOnSwitch": true,
"autoSaveOnSessionEnd": true,
"watchExternalSwitch": true,
"fallbackToDefault": true,
"fallbackBranches": ["main", "master", "develop"]
}
7-day copy clicks
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Generated from the plugin's indexed repository (davidcreador/claude-code-branch-memory-manager) — no native marketplace selected
npx claudepluginhub p/davidcreador-branch-memoryPlugins from other owners that cover similar ground