Claude Code Memory Bank
July 19, 2025 ยท View on GitHub
A structured memory management system for Claude Code, adapted from Cline Memory Bank
Overview
Claude Code Memory Bank is an experimental adaptation of the Cline Memory Bank methodology, specifically optimized for Claude Code. It provides a systematic approach to maintaining project context across Claude Code sessions, enabling consistent and effective AI-assisted development.
Why Claude Code Memory Bank?
When working with Claude Code, each new session starts with a fresh context. This system solves that limitation by:
- ๐ Persistent Context: Maintain project knowledge across sessions
- ๐ Consistent Development: Experience predictable interactions with Claude
- ๐ Self-Documenting: Create valuable project documentation as a natural byproduct
- ๐ฏ Structured Workflow: Follow a proven methodology for AI-assisted development
Features
- Hierarchical Documentation Structure: Organized memory files that build upon each other
- Adaptive Initialization: Smart
/init-memory-bankcommand that detects existing project state - Custom Slash Commands: Workflow commands tailored for Claude Code (
/workflow:understand,/workflow:plan, etc.) - Claude Code Native: Leverages
CLAUDE.mdand@importfeatures - Project Intelligence: Auto-detects technologies, preserves existing documentation, and respects your work
- Project Agnostic: Works with any technology stack or project type
- Version Control Friendly: All memory files are plain markdown
Table of Contents
- Getting Started
- Installation
- Usage
- Project Structure
- How It Works
- Custom Slash Commands
- Contributing
- License
- Credits
- Related Links
Getting Started
Prerequisites
- Claude Code (latest version recommended)
- A project where you want to implement memory management
Installation
Required Files
The Memory Bank system consists of the following essential files:
Core System (Required)
.claude/claude-memory-bank.md- The main Memory Bank system documentation
Custom Commands (Choose based on your needs)
.claude/commands/init-memory-bank.md- Initialize Memory Bank structure (can be deleted after initialization).claude/commands/workflow/understand.md- Analyze project context.claude/commands/workflow/plan.md- Create implementation strategies.claude/commands/workflow/execute.md- Execute tasks systematically.claude/commands/workflow/update-memory.md- Update Memory Bank files
Installation Steps
-
Clone this repository or download the files you need:
git clone https://github.com/hudrazine/claude-code-memory-bank.git -
Copy the core files to your project:
# Copy the Memory Bank system documentation cp -r claude-code-memory-bank/.claude /path/to/your/project/ -
Update your CLAUDE.md to import the Memory Bank system:
# Your existing CLAUDE.md content... ## Additional Instructions - @.claude/claude-memory-bank.md -
Initialize your Memory Bank using the custom command:
> /init-memory-bank
Usage
Basic Workflow
-
Start a new Claude Code session in your project directory
-
Use workflow commands to maintain context:
> /workflow:understand > /workflow:plan > /workflow:execute > /workflow:update-memory -
Memory Bank files will be created in
memory-bank/directory:projectbrief.md- Core project overviewproductContext.md- Product requirements and goalsactiveContext.md- Current work focussystemPatterns.md- Architecture and patternstechContext.md- Technology stack detailsprogress.md- Development progress tracking
Example Session
# First session - Initialize the project
> /init-memory-bank
# Claude analyzes your project and creates appropriate memory bank structure
# For a new project:
# - Creates all 6 core Memory Bank files
# - Asks for project details
# - Sets up initial structure
# For an existing project:
# - Auto-detects technologies from package.json, README, etc.
# - Preserves any existing Memory Bank files
# - Creates only missing files
# If you already have projectbrief.md:
# - Reads existing project brief
# - Uses it to populate other files automatically
# - Maintains consistency across all documentation
# Later session - Continue development
> /workflow:understand
# Claude reads memory bank and understands current state
> /workflow:plan Add user authentication
# Claude creates a plan based on existing context
> /workflow:execute
# Claude implements the feature
> /workflow:update-memory
# Claude updates the memory bank with new progress
Project Structure
claude-code-memory-bank/
โโโ README.md # This file
โโโ LICENSE # Unlicense (public domain)
โโโ CLAUDE.md # Project instructions for Claude Code
โโโ references/ # Reference documentation
โ โโโ claude-code-manage-memory.md
โ โโโ claude-code-slash-commands.md
โ โโโ cline-memory-bank.md
โโโ .claude/ # Claude Code Memory Bank implementation
โโโ claude-memory-bank.md # Core system documentation
โโโ commands/ # Custom slash commands
โโโ init-memory-bank.md # Quick Memory Bank initialization
โโโ workflow/ # Memory Bank workflows
โโโ understand.md # Context analysis
โโโ plan.md # Task planning
โโโ execute.md # Task execution
โโโ update-memory.md # Memory updates
Key Files Explained
Core System File
.claude/claude-memory-bank.md
- The central documentation defining the Memory Bank system's architecture and principles
- Specifies how the system operates, workflow phases, and documentation update triggers
- Explains the hierarchical relationship between Memory Bank files (projectbrief.md, productContext.md, etc.)
- Serves as the blueprint for implementing Memory Bank in other projects
Initialization Command
.claude/commands/init-memory-bank.md
- Custom command to initialize Memory Bank structure in new projects
- Analyzes the project and adaptively creates Memory Bank files based on detected technologies
- Can be deleted after initialization (as noted in Installation section)
Workflow Commands
.claude/commands/workflow/ directory contains four phase commands implementing the Memory Bank workflow:
understand.md: Loads Memory Bank context and performs initial task analysisplan.md: Decomposes tasks and creates detailed implementation strategiesexecute.md: Executes tasks based on plans with systematic quality checksupdate-memory.md: Updates Memory Bank documentation after task completion
How It Works
Memory Hierarchy
The Memory Bank uses a hierarchical structure where files build upon each other:
flowchart TD
PB[projectbrief.md] --> PC[productContext.md]
PB --> SP[systemPatterns.md]
PB --> TC[techContext.md]
PC --> AC[activeContext.md]
SP --> AC
TC --> AC
AC --> P[progress.md]
Integration with Claude Code
- CLAUDE.md Import: The system is loaded via
@importin your CLAUDE.md - Custom Commands: Slash commands provide structured workflows
- Persistent Files: Memory Bank files persist in your repository
- Version Control: All changes are trackable through git
Custom Slash Commands
Workflow Commands
/workflow:understand- Analyzes project context and current state/workflow:plan- Creates detailed implementation strategies/workflow:execute- Implements tasks with systematic approach/workflow:update-memory- Updates Memory Bank documentation
Additional Commands
/init-memory-bank- Initialize Memory Bank structure for new projects
Commands can be customized by editing the files in .claude/commands/.
Contributing
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Contribution Ideas
- Improve documentation
- Add new workflow commands
- Create examples for different project types
- Translate documentation
- Share your Memory Bank workflows
License
This project is released into the public domain under the Unlicense. You are free to use, modify, and distribute this software for any purpose.
Credits
This project is an adaptation of the Cline Memory Bank methodology, originally developed for the Cline AI assistant. Special thanks to:
- The Cline team for creating the original Memory Bank concept
- The Cline Discord Community, particularly:
- nickbaumann98
- Krylo
- snipermunyshotz
Related Links
- Claude Code Documentation
- Claude Code Memory Management
- Claude Code Slash Commands
- Original Cline Memory Bank
- Cline Documentation
The Memory Bank methodology is an open approach to AI context management and can be adapted to different tools and workflows.