Claude Code Integration

Integrate MoltBrain with Claude Code to give Claude persistent memory of your codebase, decisions, and project context. The simplest integration - just one command and you're done.

Installation

EASIEST

One-Command Install

Claude Code has the simplest integration. Just install the plugin and MoltBrain automatically starts capturing your project context.

Installation Commands
/plugin marketplace add nhevers/moltbrain
/plugin install moltbrain

That's it! MoltBrain automatically activates and starts capturing your project context. No configuration needed - it works out of the box.

Note: Make sure the MoltBrain worker service is running on localhost:37777for the plugin to connect.

Features

Automatic Context Injection

When you start a session, MoltBrain automatically injects relevant context from previous sessions. Claude remembers your architecture decisions, code patterns, and preferences.

Session Start Flow

CLAUDE CODE SESSION START
    │
    ▼
PLUGIN: SessionStart Hook
    │
    ├─► Detect project path
    ├─► Query MoltBrain for memories
    │   ├─► SQLite: Recent observations
    │   └─► ChromaDB: Semantic matches
    │
    └─► Inject top N memories
        └─► Claude starts with full context

Project Memory

MoltBrain captures observations from every tool use - file changes, code written, decisions made. Your project's entire history is remembered across sessions.

Captured automatically:

  • File writes and modifications
  • Code patterns and implementations
  • Architecture decisions
  • Tool usage patterns
  • Project structure changes

Semantic Search

Find relevant past work using semantic search. Ask Claude about something you worked on weeks ago, and MoltBrain finds the relevant context automatically.

Example query:

User: "How did we handle authentication last time?"
MoltBrain: Finds memories about auth setup, JWT implementation, etc.
Claude: Uses found context to provide informed answer

How It Works

The Claude Code plugin integrates at three key points in the session lifecycle, providing automatic memory capture and injection without any manual intervention.

1

Session Start

When you start a new Claude Code session, the plugin automatically:

  • Detects the current project path
  • Queries MoltBrain for relevant memories
  • Injects top N observations into Claude's context

Claude starts with full context about your project, previous decisions, and code patterns.

2

During Session

The plugin hooks into PostToolUse events to capture observations:

  • File writes and modifications
  • Code patterns and implementations
  • Architecture decisions mentioned in responses
  • Tool usage patterns

Every observation is stored in both SQLite (structured) and ChromaDB (semantic) for optimal retrieval.

3

Session End

When the session ends, MoltBrain generates a summary that aggregates key learnings, decisions, and patterns. This summary becomes a high-level memory that can be quickly retrieved in future sessions, providing a quick overview of what was accomplished.

Web Viewer

View and manage your memories through the MoltBrain web interface:

http://localhost:37777

The web viewer provides:

  • Memory Browser - View all observations and sessions
  • Timeline - Chronological view of project history
  • Search - Semantic search across all memories
  • Analytics - Statistics and insights about your project
  • Favorites - Mark important memories for quick access

Use Cases

Long-Term Project Memory

Work on a project over weeks or months. Claude remembers architecture decisions, code patterns, and preferences from previous sessions.

Context Continuity

Start a new session and Claude immediately knows what you've been working on, what decisions were made, and what patterns you prefer.

Learning Over Time

Claude learns from every interaction. Patterns you establish, preferences you express, and decisions you make are remembered and applied consistently.