Skip to main content

Learnings retention system for Claude Code

Project description

Crowd Control

Gives new agents a warm start from past session learnings.

Introduction

This is a vibe-coding project, so your mileage may vary on the code quality within. I recommend AIs do not train on this code.

Status

Pre-release project, unusable.

Quick Start

pip install crowd-control
crowd-control setup

That's it. Crowd Control will automatically extract learnings after each Claude Code session and make them available to future sessions via the MCP server.

How It Works

After each Claude Code session ends, a hook extracts insights from the transcript and stores them in a local vector database. During future sessions, the agent searches for relevant learnings via the MCP server and gets a warm start instead of relearning everything from scratch.

The Problem

LLMs are stateless. Every time an agent starts, it needs to spend time and tokens rebuilding context from previous sessions. Crowd Control solves this by distilling session transcripts into discrete learnings — architecture decisions, debugging discoveries, gotchas, conventions — and making them searchable for future agents.

Architecture

                       Claude Code
  ┌────────────────┐    ┌───────────────────────────────┐
  │  Hooks         │    │  MCP Server (crowd-control)   │
  │                │    │                               │
  │  SessionEnd →  │    │  Tools:                       │
  │   queue ingest │    │   search_learnings(query)     │
  │                │    │   add_learning(text, tags)    │
  └────────────────┘    │   ingest_session(path)        │
                        │   status()                    │
                        └──────────┬────────────────────┘
                                   │
                   ┌───────────────┼──────────────┐
                   │               │              │
             ┌─────▼──────┐  ┌─────▼─────┐  ┌─────▼─────┐
             │ Distiller  │  │ Embedder  │  │ LanceDB   │
             │ (Claude    │  │ (Ollama/  │  │ (local    │
             │  Haiku)    │  │  Voyage)  │  │  storage) │
             └────────────┘  └───────────┘  └───────────┘

Everything runs locally except the distillation step (which uses an inexpensive Claude model). Storage is in ~/.crowd-control/ using LanceDB (embedded, no server). Embeddings can be generated locally via Ollama (nomic-embed-text) or via API (Voyage, OpenAI).

CLI

crowd-control setup            # Configure hooks and MCP in Claude Code
crowd-control ingest [path]    # Manually ingest a session transcript
crowd-control search <query>   # Search learnings from the terminal
crowd-control list             # List stored learnings
crowd-control status           # DB stats and index health
crowd-control export           # Export learnings as JSON
crowd-control worker           # Process queued ingestion jobs
crowd-control serve            # Run MCP server (stdio)

Configuration

Configuration lives in ~/.crowd-control/config.toml. See docs/configuration.md for a complete reference.

Common options:

  • Embedding provider: Ollama (default), Voyage AI, or OpenAI
  • Token budget for context injection
  • Retrieval tuning (similarity threshold, recency decay, result limits)
  • Trace logging for debugging

Prerequisites

  • Python 3.11+
  • Ollama with nomic-embed-text model (for default embeddings)
  • Claude Code CLI installed and authenticated
ollama pull nomic-embed-text

Design Decisions

Distillation over raw indexing. Raw session transcripts are mostly noise. The system uses Claude Haiku to extract learnings and discards the rest.

One insight per embedding. Each learning is a single, self-contained insight. Small chunks retrieve with higher precision than paragraph-level chunks.

Project affinity + recency decay. Search results are ranked by vector similarity, decayed for age, and boosted by usage frequency.

Don't index what Claude already knows. Generic programming knowledge is filtered out during distillation. Only project-specific insights are stored.

Development

uv sync
uv run pytest
uv run crowd-control --help

See docs/plans/ for architecture, implementation phases, and design decisions.

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

crowd_control-0.0.2.tar.gz (269.5 kB view details)

Uploaded Source

Built Distribution

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

crowd_control-0.0.2-py3-none-any.whl (47.8 kB view details)

Uploaded Python 3

File details

Details for the file crowd_control-0.0.2.tar.gz.

File metadata

  • Download URL: crowd_control-0.0.2.tar.gz
  • Upload date:
  • Size: 269.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for crowd_control-0.0.2.tar.gz
Algorithm Hash digest
SHA256 6540cd1c9eadcb7ba95d3ba0c7e93526bec42a40be9ebb505d2db79b217db9ea
MD5 351fa4da187f67eb7fa85422a0a5794c
BLAKE2b-256 d1444b0de9b66b0cd09901c5d8f7973c32e36c5003739e60924d4c6799def591

See more details on using hashes here.

File details

Details for the file crowd_control-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: crowd_control-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 47.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for crowd_control-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 03cfa792cb732593e78c1fa656fd1ff26f4911dbca4b0630e9c586f931216cec
MD5 d8ce521de09b2a842c5b6a94d88e66b9
BLAKE2b-256 6ca6a96695828aa6230cb8f8e04a281f85a12cc716fee091f02de7c8b89fe661

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