CCM Plugin: Claude Code Memory Management
Source: Dev.to
The Evolution
A few weeks ago, I wrote about solving Claude Code’s memory problem with a skill/hook/script combination that provided long‑term and short‑term memory management:
AI Memory Problem: Long‑term and Short‑term Memory with Hooks and Skills
That solution worked perfectly—automatic session summaries, context loading on startup, searchable history. But it had one significant limitation: it was per‑project.
Every project needed its own copy of the scripts, hooks, and skills in its .claude directory. Updating a feature meant copying it to 10+ projects. Fixing a bug required manual updates everywhere. Starting a new project meant copying the whole setup again.
That’s when I realized: this should be a plugin, not a collection of per‑project scripts.
From Per‑Project to Universal Plugin
The transformation was about making the same solution work generically across all projects.
Before (per‑project approach):
- Copy scripts/hooks/skills to each project’s
.claudedirectory - Maintain multiple copies of the same code
- Manual updates across all projects
After (CCM plugin):
- Single plugin installation in
~/.claude/plugins/ccm/ - Works automatically in all projects
- Update once, benefits everywhere
The plugin maintains the same context‑aware storage philosophy—sessions are saved to project‑specific directories (.claude/sessions/) when you’re in a project, or to global storage (~/.claude/sessions/) otherwise. It now detects the context automatically.
Core Features
Session persistence
- Automatically saves full conversation transcripts on exit
- Generates AI‑powered summaries (supports Anthropic API and AWS Bedrock)
- Loads previous session context on startup
- Maintains searchable session history
Storage management
- Context‑aware: project‑specific or global storage
- Configurable limits with automatic cleanup
- Smart retention: keeps recent summaries, removes old sessions
User commands
/ccm-save– manual save with custom notes/ccm-history– browse and search past sessions
For detailed setup and configuration, see the GitHub repo README.md and QA.md.
What Could Be Better: Two Things
1. Auto‑Display on Session Start
The original design showed the previous session summary automatically when a new Claude Code session started.
Current state: The summary loads into Claude’s context, but Claude doesn’t always display it automatically. It worked perfectly with per‑project scripts, but became inconsistent after moving to the plugin architecture.
According to official docs, SessionStart hooks don’t support direct user output. It worked before the migration, suggesting the hooks API is still evolving. My current workaround uses instructions to tell Claude to display the summary, but it isn’t 100 % reliable.
2. Vector Database Storage
Current implementation: Sessions are JSONL files, summaries are Markdown, and search uses grep.
Potential improvement:
- Replace file storage with a vector database (e.g., ChromaDB, Qdrant)
- Enable semantic search instead of keyword matching
- Reduce token usage for context loading
- Better relationship mapping between sessions
Why it hasn’t been done yet: The file‑based solution is simple, debuggable, and version‑controllable. Token usage hasn’t been a bottleneck, so I’m following the YAGNI principle for now.
The Bottom Line
If you’re using Claude Code across multiple projects and want session continuity without manually copying scripts, CCM might solve your problem.
GitHub repo:
The repo includes detailed installation instructions, configuration options, troubleshooting guides, and technical implementation details in README.md and QA.md. It’s open source. The core functionality—session persistence, AI summaries, automatic context detection—works as designed. The auto‑display on session start is the one rough edge, but the plugin delivers universal session memory without per‑project maintenance.
If you figure out how to make SessionStart hooks reliably display output to users in plugin mode, please open an issue. I’d love to close that gap.
Do you use Claude Code for multiple projects? How do you handle context continuity across sessions?
Tags: ClaudeCode, AI, DevTools, Productivity, OpenSource, ClaudeAI, DeveloperExperience, SessionManagement