Skip to main content

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.

Metadata

Release files for crowd-control 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crowd-control 0.0.9
File Size Uploaded Provenance Actions
crowd_control-0.0.9.tar.gz 293.1 kB Without provenance Details for crowd_control-0.0.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crowd-control 0.0.9
File Interpreter ABI Platform Actions
crowd_control-0.0.9-py3-none-any.whl Python 3 none any Details for crowd_control-0.0.9-py3-none-any.whl

Total release size: 359.6 kB

Release files / crowd_control-0.0.9.tar.gz

Download URL crowd_control-0.0.9.tar.gz
Size 293.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2c04de02e17be3cef2ece35f663174f123edaa6f67bb79e7a9c3652eed0f0c0f
BLAKE2b-256 checksum
How to use checksums
0a4686c34f1911806304a60abb0a707e8a67c85592125ce6db7a877837ed7b1d
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / crowd_control-0.0.9-py3-none-any.whl

Download URL crowd_control-0.0.9-py3-none-any.whl
Size 66.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
14eb2546a2ac4d204a14d793df37a44826dbb04dd23fd8554df3137d60d584a3
BLAKE2b-256 checksum
How to use checksums
728c762d53c8613e3c45ee5ff3df88459af6988f3992c1e812aa1ef7a205f322
Upload date
Uploaded using Trusted Publishing?
What is 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}

Security for crowd-control 0.0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page