Skip to main content

Perfect memory for Claude - Never solve the same coding problem twice

Project description

Claude Cache ๐Ÿง 

PyPI version Python Support License: MIT

Your AI coding assistant now has perfect memory

Claude Cache is an intelligent memory system that ensures you never solve the same problem twice. It learns from every successful solution, understands context through semantic search, and provides instant access to your accumulated knowledge directly within Claude Code.

โœจ Why Claude Cache?

Every developer loses hours re-solving problems they've already fixed. Claude Cache acts as your AI's perfect memory:

  • Remember Everything: Automatically captures successful solutions and patterns
  • Find Instantly: Semantic search understands what you need, not just keywords
  • Learn Continuously: Every coding session makes future development faster
  • Zero Context Switching: Access everything directly in Claude Code via MCP tools

๐Ÿš€ Quick Start

Installation

Choose your experience level:

# Basic - CLI tools with keyword search
pip install claude-cache

# Enhanced - Semantic search with AI understanding
pip install "claude-cache[enhanced]"

# Complete - Full MCP integration for Claude Code (Recommended)
pip install "claude-cache[mcp]"

Setup for Claude Code

  1. Add to .claude.json in your project root:
{
  "mcpServers": {
    "cache": {
      "type": "stdio",
      "command": "cache-mcp"
    }
  }
}
  1. Restart Claude Code

  2. Type / to see your new tools!

๐ŸŽฏ Native Claude Code Tools

/mcp__cache__query

Search your entire knowledge base instantly

Example: /mcp__cache__query "authentication JWT"
Returns: Your previous JWT implementations with context

/mcp__cache__learn

Save successful solutions for future use

Example: /mcp__cache__learn
  solution: "Fixed CORS with proxy middleware"
  tags: "cors,api,middleware"

/mcp__cache__suggest

Get proactive recommendations based on current context

Example: /mcp__cache__suggest "working on API endpoints"
Returns: Relevant patterns from your knowledge base

/mcp__cache__stats

Monitor your growing knowledge base

Shows: Total patterns, projects, search capabilities

/mcp__cache__browse

Index documentation for instant access

Example: /mcp__cache__browse "https://docs.example.com"
Result: Documentation indexed and searchable

๐Ÿง  How It Works

Claude Cache creates an intelligent layer between you and your AI assistant:

  1. Automatic Learning: Detects successful patterns through:

    • Natural language understanding ("that worked!", "perfect!")
    • Execution monitoring (passing tests, successful builds)
    • Error resolution tracking
  2. Smart Retrieval: Three-tier search system:

    • Semantic Search: Understands meaning and context (with sentence-transformers)
    • TF-IDF Fallback: Always works even without ML libraries
    • Pattern Matching: Finds similar code structures
  3. Context Awareness: Maintains separate knowledge bases per project while sharing common patterns across projects

๐Ÿ’ก Real-World Examples

Example 1: Authentication Debugging

# Monday: Spend 2 hours debugging JWT refresh tokens
# Save the solution automatically when it works

# Friday: Hit the same issue
/mcp__cache__query "JWT refresh failing"
# โ†’ Instantly get your exact solution with context

Example 2: API Pattern Reuse

# Project A: Build a perfect rate limiter
# Claude Cache automatically captures the pattern

# Project B: Need rate limiting
/mcp__cache__suggest "API middleware"
# โ†’ Get your rate limiter pattern with implementation details

Example 3: Team Knowledge Sharing

# Senior dev solves complex database optimization
/mcp__cache__learn "Optimized query with indexes"

# Junior dev hits performance issue
/mcp__cache__query "slow database query"
# โ†’ Finds senior dev's solution with explanation

๐Ÿ“Š Performance & Privacy

  • Speed: <100ms query response for 10K+ patterns
  • Accuracy: 60-90% relevance in semantic matching
  • Storage: Efficient SQLite with optional vector embeddings
  • Privacy: All data stored locally in ~/.claude/knowledge/
  • No External Calls: Works completely offline

๐Ÿ”ง CLI Usage

For terminal power users:

# Start monitoring (runs in background)
cache start

# Manual pattern save
cache learn "Solution description" --tags "tag1,tag2"

# Search patterns
cache query "search term"

# Index documentation
cache browse https://docs.example.com

# View statistics
cache stats

๐Ÿ“ฆ Architecture

Claude Cache/
โ”œโ”€โ”€ Knowledge Base (SQLite)
โ”‚   โ”œโ”€โ”€ Success Patterns
โ”‚   โ”œโ”€โ”€ Error Resolutions
โ”‚   โ”œโ”€โ”€ Documentation
โ”‚   โ””โ”€โ”€ Cross-Project Index
โ”œโ”€โ”€ Vector Search Engine
โ”‚   โ”œโ”€โ”€ Semantic Embeddings (optional)
โ”‚   โ””โ”€โ”€ TF-IDF Fallback
โ”œโ”€โ”€ MCP Server
โ”‚   โ””โ”€โ”€ Native Claude Code Tools
โ””โ”€โ”€ Auto-Learning System
    โ”œโ”€โ”€ Intent Detection
    โ”œโ”€โ”€ Execution Monitor
    โ””โ”€โ”€ Pattern Extractor

๐Ÿค Contributing

We welcome contributions! Areas of interest:

  • Additional MCP tools
  • Better pattern extraction algorithms
  • Support for more development environments
  • Team collaboration features

See CONTRIBUTING.md for guidelines.

๐Ÿ“„ License

MIT License - see LICENSE for details.

๐Ÿ™ Acknowledgments

Built with love for the developer community. Special thanks to all early adopters and contributors who helped shape Claude Cache into what it is today.


Note: Claude Cache is an independent tool for enhancing Claude Code, not an official Anthropic product.

Ready to give your AI perfect memory? Install now and never solve the same problem twice!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_cache-0.6.4.tar.gz (120.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_cache-0.6.4-py3-none-any.whl (98.9 kB view details)

Uploaded Python 3

File details

Details for the file claude_cache-0.6.4.tar.gz.

File metadata

  • Download URL: claude_cache-0.6.4.tar.gz
  • Upload date:
  • Size: 120.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for claude_cache-0.6.4.tar.gz
Algorithm Hash digest
SHA256 0fe8641c00a21b6ec843204d2359698016b483d2b6b48f73fa8bb023f3f6bff8
MD5 7fe9005eec148da855edf94b6137c036
BLAKE2b-256 ae022d9daef7cac926be6b92deaa8b09da779cc017a19abfb22598b9edb9506c

See more details on using hashes here.

File details

Details for the file claude_cache-0.6.4-py3-none-any.whl.

File metadata

  • Download URL: claude_cache-0.6.4-py3-none-any.whl
  • Upload date:
  • Size: 98.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for claude_cache-0.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c7345d1813e5318bb1c4b6f87e2c85adb1293b2117f8a5d45ab206059f67b067
MD5 59278a171a8783d2b894e72a010d7aa0
BLAKE2b-256 57b2d5fb1e663e2a23a8d169dec6d812d2f8d99b3afc9e1c871e95827310d243

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page