Zero-config persistent memory for Claude with automatic 84% cost savings through 6x context compression. Use for remembering project context, reducing API token costs, tracking learned patterns, managing memories across sessions, and curating/cleaning up memories.
MemoryLane provides persistent memory for Claude with proven 84.3% cost savings through intelligent context compression. It remembers information across sessions in 4 categories (patterns, insights, learnings, context), automatically compresses context 6.4x on average, tracks API cost savings in real-time, learns passively from git commits and file changes, and works out of the box with zero configuration required.
Use MemoryLane when the user:
When the user wants to know what's been remembered or see cost savings:
```bash
python3 src/cli.py status
```
This displays memory statistics, category breakdown (patterns/insights/learnings/context), and total cost savings.
When the user asks what you know about a specific topic:
```bash
python3 src/cli.py recall "<query>"
```
Example:
```bash
python3 src/cli.py recall "authentication"
```
When the user wants to see high-value patterns learned from the project:
```bash
python3 src/cli.py insights
```
When the user asks about API cost reduction or token savings:
```bash
python3 src/cli.py costs
```
This provides a detailed breakdown of token savings and cost reduction percentages.
When starting work on a new project or onboarding:
```bash
python3 src/learner.py initial
python3 src/cli.py insights
```
This analyzes the last 20 git commits and workspace structure to build initial context.
**IMPORTANT**: When you see MemoryLane context injected via `# Project Context (from MemoryLane)` in system messages, quickly scan for poor quality memories.
Signs of poor quality memories:
**If you detect 2+ poor quality memories**, proactively ask:
> "I notice some of the injected memories appear to be low quality (status summaries, debug notes). Would you like me to clean these up?"
If the user confirms or explicitly requests curation:
a) List all memories for review:
```bash
python3 src/cli.py curate --list
```
b) Evaluate each memory for usefulness, duplication, quality, and relevance.
c) Apply curation decisions:
```bash
python3 src/cli.py curate --apply '{"decisions": [{"id": "patt-001", "action": "KEEP"}, {"id": "lear-002", "action": "DELETE", "reason": "status summary"}, {"id": "insi-003", "action": "REWRITE", "new_content": "Improved content"}]}'
```
**DELETE these types:**
**KEEP these types:**
When you need to inspect, update, or delete a specific memory:
```bash
python3 src/cli.py memory get <id>
python3 src/cli.py memory delete <id>
python3 src/cli.py memory update <id> --content "New content"
```
**IMPORTANT**: Always use these commands instead of editing memories.json directly.
When the user wants to share or document project context:
```bash
python3 src/cli.py export-markdown --category patterns --output context.md
```
Before destructive operations or for safekeeping:
```bash
python3 src/cli.py backup --output backup.json
python3 src/cli.py restore backup.json
```
To adjust memory behavior:
```bash
python3 src/cli.py config get memory.max_context_tokens
python3 src/cli.py config set memory.max_context_tokens 3000
python3 src/cli.py config list
```
Key configuration options:
For low-latency memory operations, use the sidecar server:
```bash
python3 src/server.py start
python3 src/server.py status
python3 src/server.py stop
```
Note: CLI works standalone; server adds performance for frequent operations.
```bash
python3 src/server.py start
python3 src/cli.py status
python3 src/cli.py insights
python3 src/cli.py costs
```
```bash
python3 src/learner.py initial
python3 src/cli.py recall "primary language"
python3 src/cli.py insights
python3 src/cli.py export-markdown --output project-context.md
```
When the user says: "Remember that our API uses JWT tokens with 24-hour expiration"
You would typically use the Python API to add a memory. For CLI-based workflows:
```bash
python3 -c "
import sys; sys.path.insert(0, 'src')
from memory_store import MemoryStore
store = MemoryStore('.memorylane/memories.json')
store.add_memory('context', 'API uses JWT tokens with 24-hour expiration', 'manual', 0.9)
print('✓ Remembered')
"
```
Then respond: "✓ Remembered in context category with 0.9 relevance."
1. **Privacy**: All data stored locally in `.memorylane/` directory. No external services.
2. **No Dependencies**: Pure Python 3.8+ required. No external packages needed for production.
3. **Automatic Exclusions**: Respects `.env`, `secrets/`, and other sensitive patterns.
4. **Backup Before Reset**: Always creates backup before destructive operations.
5. **Performance Metrics**: 84.3% cost savings, 6.4x compression ratio, <100ms retrieval latency target.
6. **Never Edit memories.json Directly**: Always use CLI commands for memory management.
7. **Proactive Curation**: Scan injected MemoryLane context for poor quality memories and offer to clean them up.
To validate MemoryLane functionality:
```bash
pytest
pytest tests/test_cost_savings.py -v -s
pytest tests/test_memory_store.py -v
```
Requires dev dependencies: `pip install -r requirements-dev.txt`
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/memorylane-persistent-memory-with-cost-savings/raw