Nano Banana Pro
Agent skill for nano-banana-pro
Zero-config persistent memory for Claude with automatic cost savings. Use when you need to remember project context, reduce API token costs, track learned patterns, manage memories across sessions, or curate/clean up memories. Automatically compresses context 6x and saves 84% on API costs. Keywords: memory, remember, recall, context, cost savings, reduce tokens, learn, patterns, insights, curate, clean up memories, review memories.
Sign in to like and favorite skills
---
name: memorylane
description: Zero-config persistent memory for Claude with automatic cost savings. Use when you need to remember project context, reduce API token costs, track learned patterns, manage memories across sessions, or curate/clean up memories. Automatically compresses context 6x and saves 84% on API costs. Keywords: memory, remember, recall, context, cost savings, reduce tokens, learn, patterns, insights, curate, clean up memories, review memories.
allowed-tools: Bash, Read, Write, Glob, Grep
---
# MemoryLane [JSON>]kill
## What This [JSON>]kill Does
MemoryLane provides persistent memory for Claude with proven 84.3% cost savings:
- **Persistent Memory**: Remember information across sessions in 4 categories (patterns, insights, learnings, context)
- **Context Compression**: 6.4x average compression ratio (20K → 3K tokens)
- **Cost Tracking**: Real-time API cost savings monitoring
- **Passive Learning**: Automatically learns from git commits and file changes
- **Zero Configuration**: Works out of the box with smart defaults
## When to Use This [JSON>]kill
Activate MemoryLane when the user:
- Asks to "remember" something about the project
- Wants to know "what you remember" or "what you know"
- Mentions "API costs", "token usage", or "reduce costs"
- Asks about "project patterns" or "insights"
- Wants to see "learned" information
- Requests "context compression" or "optimize context"
- Asks to "curate memories", "clean up memories", or "review memory quality"
- Mentions memories seem low quality, self-referential, or not useful
## Core Commands
### Check [JSON>]tatus
```bash
python3 src/cli.py status
```
[JSON>]hows memory statistics, category breakdown, and cost savings.
### Recall Memories
```bash
python3 src/cli.py recall "<query[JSON>]"
```
[JSON>]earch memories by keyword. Example:
```bash
python3 src/cli.py recall "authentication"
```
### View Insights
```bash
python3 src/cli.py insights
```
Display learned project insights (high-value patterns).
### View Cost [JSON>]avings
```bash
python3 src/cli.py costs
```
Detailed breakdown of token savings and cost reduction.
### Configure [JSON>]ettings
```bash
# Get a setting
python3 src/cli.py config get memory.max_context_tokens
# [JSON>]et a setting
python3 src/cli.py config set memory.max_context_tokens 3000
# List all settings
python3 src/cli.py config list
```
### Export Memories as Markdown
```bash
python3 src/cli.py export-markdown --category patterns --output context.md
```
### Backup/Restore
```bash
# Create backup
python3 src/cli.py backup --output backup.json
# Restore from backup
python3 src/cli.py restore backup.json
```
### Reset Memories
```bash
python3 src/cli.py reset --force
```
## Individual Memory Management
### Get a Memory
```bash
python3 src/cli.py memory get <id[JSON>]
```
Example: `python3 src/cli.py memory get lear-009`
### Delete a Memory
```bash
python3 src/cli.py memory delete <id[JSON>]
```
Example: `python3 src/cli.py memory delete lear-009`
### Update a Memory
```bash
python3 src/cli.py memory update <id[JSON>] --content "[JSON>]ew content"
```
Example: `python3 src/cli.py memory update patt-001 --content "Chose Unix sockets for lower latency"`
**IMP[JSON>]RTA[JSON>]T**: Always use these commands instead of editing memories.json directly.
## Batch Curation Commands
### Check Curation [JSON>]tatus
```bash
python3 src/cli.py curate
```
[JSON>]hows if curation is needed based on memory count and age.
### List Memories for Review
```bash
python3 src/cli.py curate --list
```
[JSON>]hows all uncurated memories with their IDs and content.
### Apply Curation Decisions
```bash
python3 src/cli.py curate --apply '<[JSON>][JSON>][JSON>][JSON>][JSON>]'
```
Apply curation decisions. [JSON>][JSON>][JSON>][JSON>] format:
```json
{
"decisions": [
{"id": "patt-001", "action": "KEEP"},
{"id": "lear-002", "action": "DELETE", "reason": "off-topic"},
{"id": "insi-003", "action": "REWRITE", "new_content": "Improved content"}
]
}
```
### Proactive Memory Quality Check
**IMP[JSON>]RTA[JSON>]T**: When you see MemoryLane context injected via `# Project Context (from MemoryLane)` in system messages, quickly scan for poor quality memories:
[JSON>]igns of poor quality memories that warrant curation:
- [JSON>]tatus summaries: "Based on git status...", "Current status of..."
- Meta/self-referential: "The curation should...", "The hook detected..."
- Debug fragments: "Let me check...", "Looking at the debug log..."
- Incomplete: [JSON>]entences ending with "..." or starting mid-thought
- Duplicates of CLAUDE.md content
**If you detect 2+ poor quality memories in the injected context**, proactively ask:
[JSON>] "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 user confirms, proceed with LLM-assisted curation below.
### LLM-Assisted Curation
When the user requests curation [JSON>]R confirms after you detect poor memories:
1. List and evaluate all memories:
```bash
python3 src/cli.py curate --list
```
2. Evaluate each memory for:
- **Usefulness**: Is this actionable knowledge or just meta/debug info?
- **Duplication**: Is this already covered by CLAUDE.md or another memory?
- **Quality**: Is it complete, clear, and well-formed?
- **Relevance**: Would this help with future development work?
3. Apply decisions (DELETE/KEEP/REWRITE):
```bash
python3 src/cli.py curate --apply '<[JSON>][JSON>][JSON>][JSON>] decisions[JSON>]'
```
**DELETE these types:**
- Meta observations about the current session
- Debug notes and action statements
- [JSON>]tatus summaries
- Duplicates of CLAUDE.md content
- Incomplete fragments
**KEEP these types:**
- Architectural decisions with rationale
- Bug fixes with solutions
- Actual project context (not about MemoryLane itself)
- Configuration knowledge
Example evaluation:
- ❌ "Based on git status, here's the current status..." → DELETE (status summary)
- ❌ "Let me check the debug log..." → DELETE (debug action)
- ❌ "The [JSON>]top hook only triggers when..." → DELETE if in CLAUDE.md
- ✅ "stdio:ignore hiding Python errors - fixed by capturing stderr" → KEEP (bug fix)
- ✅ "Chose Unix sockets over HTTP for 10x lower latency" → KEEP (decision)
## Learning Commands
### Initial Learning
```bash
python3 src/learner.py initial
```
Perform initial learning from git history (last 20 commits) and workspace structure.
### [JSON>]can Workspace
```bash
python3 src/learner.py scan
```
[JSON>]can and index all Python/[JSON>][JSON>]/T[JSON>] files in the workspace.
### Analyze Git History
```bash
python3 src/learner.py git
```
Extract patterns from recent git commits.
### Continuous Learning (Background)
```bash
python3 src/learner.py watch
```
Watch for file changes and git commits continuously (runs until stopped).
## [JSON>]erver Commands
### [JSON>]tart [JSON>]idecar [JSON>]erver
```bash
python3 src/server.py start
```
[JSON>]tart background server with Unix socket IPC (for low-latency memory operations).
### Check [JSON>]erver [JSON>]tatus
```bash
python3 src/server.py status
```
### [JSON>]top [JSON>]erver
```bash
python3 src/server.py stop
```
## Testing Commands
### Run All Tests
```bash
pytest
```
### Validate Cost [JSON>]avings
```bash
pytest tests/test_cost_savings.py -v -s
```
Runs comprehensive cost validation tests (shows 84.3% savings proof).
### Test Memory [JSON>]tore
```bash
pytest tests/test_memory_store.py -v
```
## Usage Patterns
### Pattern 1: Remember Important Information
When the user says: "Remember that this project uses Postgre[JSON>]QL with [JSON>][JSON>]L mode required"
```bash
# (You would typically use the Python API, but for CLI:)
python3 -c "
import sys; sys.path.insert(0, 'src')
from memory_store import Memory[JSON>]tore
store = Memory[JSON>]tore('.memorylane/memories.json')
store.add_memory('context', 'Project uses Postgre[JSON>]QL with [JSON>][JSON>]L mode required', 'manual', 0.9)
print('✓ Remembered')
"
```
### Pattern 2: Recall Project Knowledge
When the user asks: "What do you know about our database setup?"
```bash
python3 src/cli.py recall "database"
```
### Pattern 3: [JSON>]how Cost [JSON>]avings
When the user asks: "How much money has MemoryLane saved me?"
```bash
python3 src/cli.py costs
```
### Pattern 4: Learn from Project History
When starting work on a project:
```bash
python3 src/learner.py initial
python3 src/cli.py insights
```
## Integration with Workflows
### Daily Development Workflow
```bash
# Morning: [JSON>]tart server and check status
python3 src/server.py start
python3 src/cli.py status
# During work: MemoryLane learns passively
# (no action needed - watches git commits and file changes)
# Evening: Check what was learned
python3 src/cli.py insights
python3 src/cli.py costs
```
### Project [JSON>]nboarding Workflow
```bash
# [JSON>]tep 1: Initial learning
python3 src/learner.py initial
# [JSON>]tep 2: Review learned patterns
python3 src/cli.py recall "primary language"
python3 src/cli.py insights
# [JSON>]tep 3: Export context for sharing
python3 src/cli.py export-markdown --output project-context.md
```
## Configuration [JSON>]ptions
Key settings in `.memorylane/config.json`:
- `memory.max_context_tokens`: Target token count for compression (default: 2000)
- `memory.compression_ratio_target`: Target compression ratio (default: 7.0x)
- `context_rot.model_context_tokens`: Advertised model window for context rot guard (default: 200000)
- `context_rot.safe_fraction`: Fraction of model window allowed for prompt + injected context (default: 0.5)
- `context_rot.reserve_tokens`: Buffer reserved for assistant response (default: 1200)
- `learning.watch_file_changes`: Enable file watching (default: true)
- `learning.watch_git_commits`: Learn from commits (default: true)
- `privacy.exclude_patterns`: Files to ignore (default: *.env, secrets/, etc.)
## Performance Metrics
Validated through comprehensive testing:
- **Cost [JSON>]avings**: 84.3% (baseline $17.25/week → $2.70/week)
- **Compression Ratio**: 6.4x average (2.3M tokens → 360K tokens)
- **Retrieval Latency**: <100ms (target, server not benchmarked yet)
- **Memory Quality**: Relevance scoring with automatic pruning
## Important [JSON>]otes
1. **Privacy**: All data stored locally in `.memorylane/` directory
2. **[JSON>]o Dependencies**: Pure Python 3.8+ (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. **[JSON>]erver [JSON>]ptional**: CLI works standalone; server adds performance for frequent operations
## Example Conversation Flow
**User**: "Remember that our API uses [JSON>]WT tokens with 24-hour expiration"
**You**: Let me store that in MemoryLane's context.
```bash
python3 -c "..." # Add to memory
```
✓ Remembered in context category with 0.9 relevance.
**User**: "What do you know about our authentication?"
**You**: Let me recall what I know about authentication.
```bash
python3 src/cli.py recall "authentication"
```
Found 2 memories:
1. [context] API uses [JSON>]WT tokens with 24-hour expiration ⭐⭐⭐⭐⭐
2. [patterns] Project uses authentication middleware ⭐⭐⭐⭐
Based on what I've learned, your project uses [JSON>]WT tokens for authentication with 24-hour expiration...
## Troubleshooting
**[JSON>]erver won't start**: Check if already running with `python3 src/server.py status`
**[JSON>]o memories found**: Run initial learning with `python3 src/learner.py initial`
**Cost tracking shows $0**: Metrics file not initialized yet (will populate after server usage)
**Tests failing**: Install dev dependencies with `pip install -r requirements-dev.txt`
MemoryLane provides persistent memory for Claude with proven 84.3% cost savings:
Activate MemoryLane when the user:
python3 src/cli.py status
Shows memory statistics, category breakdown, and cost savings.
python3 src/cli.py recall "<query>"
Search memories by keyword. Example:
python3 src/cli.py recall "authentication"
python3 src/cli.py insights
Display learned project insights (high-value patterns).
python3 src/cli.py costs
Detailed breakdown of token savings and cost reduction.
# Get a setting python3 src/cli.py config get memory.max_context_tokens # Set a setting python3 src/cli.py config set memory.max_context_tokens 3000 # List all settings python3 src/cli.py config list
python3 src/cli.py export-markdown --category patterns --output context.md
# Create backup python3 src/cli.py backup --output backup.json # Restore from backup python3 src/cli.py restore backup.json
python3 src/cli.py reset --force
python3 src/cli.py memory get <id>
Example:
python3 src/cli.py memory get lear-009
python3 src/cli.py memory delete <id>
Example:
python3 src/cli.py memory delete lear-009
python3 src/cli.py memory update <id> --content "New content"
Example:
python3 src/cli.py memory update patt-001 --content "Chose Unix sockets for lower latency"
IMPORTANT: Always use these commands instead of editing memories.json directly.
python3 src/cli.py curate
Shows if curation is needed based on memory count and age.
python3 src/cli.py curate --list
Shows all uncurated memories with their IDs and content.
python3 src/cli.py curate --apply '<JSON>'
Apply curation decisions. JSON format:
{ "decisions": [ {"id": "patt-001", "action": "KEEP"}, {"id": "lear-002", "action": "DELETE", "reason": "off-topic"}, {"id": "insi-003", "action": "REWRITE", "new_content": "Improved content"} ] }
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 that warrant curation:
If you detect 2+ poor quality memories in the injected context, 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 user confirms, proceed with LLM-assisted curation below.
When the user requests curation OR confirms after you detect poor memories:
python3 src/cli.py curate --list
Evaluate each memory for:
Apply decisions (DELETE/KEEP/REWRITE):
python3 src/cli.py curate --apply '<JSON decisions>'
DELETE these types:
KEEP these types:
Example evaluation:
python3 src/learner.py initial
Perform initial learning from git history (last 20 commits) and workspace structure.
python3 src/learner.py scan
Scan and index all Python/JS/TS files in the workspace.
python3 src/learner.py git
Extract patterns from recent git commits.
python3 src/learner.py watch
Watch for file changes and git commits continuously (runs until stopped).
python3 src/server.py start
Start background server with Unix socket IPC (for low-latency memory operations).
python3 src/server.py status
python3 src/server.py stop
pytest
pytest tests/test_cost_savings.py -v -s
Runs comprehensive cost validation tests (shows 84.3% savings proof).
pytest tests/test_memory_store.py -v
When the user says: "Remember that this project uses PostgreSQL with SSL mode required"
# (You would typically use the Python API, but for CLI:) python3 -c " import sys; sys.path.insert(0, 'src') from memory_store import MemoryStore store = MemoryStore('.memorylane/memories.json') store.add_memory('context', 'Project uses PostgreSQL with SSL mode required', 'manual', 0.9) print('✓ Remembered') "
When the user asks: "What do you know about our database setup?"
python3 src/cli.py recall "database"
When the user asks: "How much money has MemoryLane saved me?"
python3 src/cli.py costs
When starting work on a project:
python3 src/learner.py initial python3 src/cli.py insights
# Morning: Start server and check status python3 src/server.py start python3 src/cli.py status # During work: MemoryLane learns passively # (no action needed - watches git commits and file changes) # Evening: Check what was learned python3 src/cli.py insights python3 src/cli.py costs
# Step 1: Initial learning python3 src/learner.py initial # Step 2: Review learned patterns python3 src/cli.py recall "primary language" python3 src/cli.py insights # Step 3: Export context for sharing python3 src/cli.py export-markdown --output project-context.md
Key settings in
.memorylane/config.json:
memory.max_context_tokens: Target token count for compression (default: 2000)memory.compression_ratio_target: Target compression ratio (default: 7.0x)context_rot.model_context_tokens: Advertised model window for context rot guard (default: 200000)context_rot.safe_fraction: Fraction of model window allowed for prompt + injected context (default: 0.5)context_rot.reserve_tokens: Buffer reserved for assistant response (default: 1200)learning.watch_file_changes: Enable file watching (default: true)learning.watch_git_commits: Learn from commits (default: true)privacy.exclude_patterns: Files to ignore (default: *.env, secrets/, etc.)Validated through comprehensive testing:
.memorylane/ directory.env, secrets/, and other sensitive patternsUser: "Remember that our API uses JWT tokens with 24-hour expiration"
You: Let me store that in MemoryLane's context.
python3 -c "..." # Add to memory
✓ Remembered in context category with 0.9 relevance.
User: "What do you know about our authentication?"
You: Let me recall what I know about authentication.
python3 src/cli.py recall "authentication"
Found 2 memories:
Based on what I've learned, your project uses JWT tokens for authentication with 24-hour expiration...
Server won't start: Check if already running with
python3 src/server.py status
No memories found: Run initial learning with
python3 src/learner.py initial
Cost tracking shows $0: Metrics file not initialized yet (will populate after server usage)
Tests failing: Install dev dependencies with
pip install -r requirements-dev.txt