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

Uploaded Python 3

File details

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

File metadata

  • Download URL: crowd_control-0.0.5.tar.gz
  • Upload date:
  • Size: 272.1 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.5.tar.gz
Algorithm Hash digest
SHA256 770a0c5ba1f247e9fabce5df47d7abb8fcee15bb355dfc5ba47dc00bebed73fb
MD5 6f64c82a0ed45cfe01aea498f194e808
BLAKE2b-256 1a22c7460dc5df8cb606abb1d4107ce5d4388448219b82922e918b9d6433ae33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: crowd_control-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 55.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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0e93ccef80839954b2649a702792b96095c6cf09983e80838c5ce0d8bf789126
MD5 00dbf53dbaabb9bfea283407cd17e964
BLAKE2b-256 21b4c57b3c37866bb51b2f075cb7b9d2102ca5bf01621c8dda6842aa23e7d165

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