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

Alpha: use at your own risk.

Problem

LLMs are stateless. Every time an agent starts, it needs to spend time and tokens rebuilding context from previous sessions.

Solution

Crowd Control helps by distilling session transcripts into discrete learnings and making them searchable for future agents.

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.

Session End -> Use Claude Code CLI to extract learnings -> Embed learnings -> Store learnings in LanceDB

New Session -> Agent searches for relevant information -> Embed searches -> Find existing learnings

"Quick" Start

Requires:

1. Install Ollama and pull the embedding model:

# macOS
brew install ollama

# Or download from https://ollama.ai

# Pull the default embedding model
ollama pull nomic-embed-text

2. Start Ollama (if not already running):

ollama serve

If you installed Ollama via the desktop app, it runs automatically — skip this step.

3. Install Crowd Control and run setup:

pip install crowd-control[ollama]
crowd-control setup

4. (Optional) Nudge Claude to use the tool:

It is recommended to nudge Claude to use the tool. Hopefully this will not be necessary in the future.

CLAUDE.md:

# Bootstrapping

1. Use the `search_learnings` tool from crowd-control to gather relevant information for the task at hand.

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.

See the User Guide for more information.

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) │
             │            │  │  OpenAI)  │  │           │
             └────────────┘  └───────────┘  └───────────┘

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

Cost

Crowd Control calls the Claude Code CLI to extract learnings from session data. It uses the Haiku model by default, so the impact on your token budget should be minimal. It also performs embeddings. It is recommended to use a free local embedding model so there is no additional cost, but if you choose to use an API, there will be some cost from those API calls as well.

Contributing

Pull requests are welcome. Being a vibe-coding project, I won't be so picky about the code. If claude likes your code, I will probably like it too.

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.7.tar.gz (281.0 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.7-py3-none-any.whl (59.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: crowd_control-0.0.7.tar.gz
  • Upload date:
  • Size: 281.0 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.7.tar.gz
Algorithm Hash digest
SHA256 64242c320f9ece5743821697782e0d2107f3dcf8e3ec5a36f8577d0b1e87623e
MD5 258ce23871e65a4fdfbc388fb3cb5011
BLAKE2b-256 3548836ec03e4e23b6fd711ccbb228d8dc6e755e907807cd39c59553d1baa95b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: crowd_control-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 59.2 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5b110c0bd8aa23eed623253e38100d835f46f829b8f8d0e9443e855c72702a79
MD5 8017b178876f90c69cd88ffb316e7afb
BLAKE2b-256 a25f2812b9ed17d22d825337c571a689bb1d25dc1052b29cfc203f350b817ac7

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