crewlore

Official registry Developer tools

Team knowledge compiled from your coding agents' sessions and pull requests, every entry cited.

Install

Add this to your client's MCP configuration (Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json; VS Code and others use the same "mcpServers" shape).

PYPI package crewlore
Claude Code
claude mcp add crewlore -- uvx crewlore==0.5.3 serve --repo
JSON configuration (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "crewlore": {
            "command": "uvx",
            "args": [
                "crewlore==0.5.3",
                "serve",
                "--repo"
            ]
        }
    }
}

Documentation

From the project's README on GitHub, refreshed weekly. Links open on GitHub.

Contents
  1. Quickstart
  2. Let your assistant use it
  3. What you get
  4. A real example
  5. How it works
  6. How it differs
  7. Why this exists
  8. Your data stays yours
  9. CLI
  10. Configuration
  11. The study behind the adoption field
  12. Status, limits and roadmap
  13. Contributing
  14. License

Your coding agents keep relearning what your team already figured out. crewlore reads the sessions your agents already produce, and your repo's pull requests, pulls out the decisions, procedures and gotchas, and writes them into a plain-text knowledge book inside your repo. Every entry quotes the exact line it came from, and records whether the team adopted it or tried it and declined. Runs on your machine with your own model key.

Sixty seconds on what it does and how it is used:

https://github.com/user-attachments/assets/b16cb272-da48-4756-89ba-1cc626629e0c

The same thing in a terminal. The recording below is the bundled demo, uv run python scripts/demo.py --step, which needs no API key: a handful of synthetic sessions compiled into a book, including one claim the team tried and declined.

pipx install crewlore

You need: Python 3.10 or newer; a model key (ANTHROPIC_API_KEY or OPENAI_API_KEY) or a local OpenAI-compatible model; the GitHub CLI (gh auth login) if you want to compile pull requests; uv only for the no-key demo below.

Quickstart

Two ways in, depending on where your team's knowledge currently lives.

You already use Claude Code. Point lore at the transcripts it writes to disk. By default it reads only this repo's own transcripts, never the other projects on your machine.

cd my-repo
export ANTHROPIC_API_KEY=...     # or OPENAI_API_KEY, or a local model in .lore/config.yaml
lore init                        # create .lore/ in your repo
lore watch                       # read this repo's transcripts, scrub secrets, compile, prune — on an interval
lore query "billing webhook"     # ask the knowledge layer anything, anytime

You have a repo but no sessions yet. Compile its pull-request threads instead. Coding agents write much of their reasoning in PR descriptions and reviews — what they tried, why it failed, which constraint they hit — so a repo nobody has run an agent in locally already has a knowledge layer waiting:

cd my-repo
export ANTHROPIC_API_KEY=...
lore init
lore import-prs owner/repo       # closed PRs by default, agent-authored only; uses your gh login, stores no token
lore query "billing webhook"

Either way, commit .lore/ and your teammates inherit the book on their next git pull. Its own .gitignore keeps raw transcripts, raw PR exports, the extraction cache and usage counters out of git.

Trouble installing?

If pipx fails with Broken Python installation, platform.mac_ver() returned an empty value, your default Python is a broken install (sometimes seen with very recent Homebrew Python builds). This is about the interpreter pipx uses, not the package — pin a known-working one:

pipx install --python python3.13 crewlore

To make pipx default to Python 3.13 going forward: export PIPX_DEFAULT_PYTHON=$(which python3.13).

Try it without an API key
git clone https://github.com/srijansk/crewlore.git
cd crewlore && uv run python scripts/demo.py

The demo runs the whole loop on bundled synthetic sessions and prints the compiled book, a query against it, and three checks. It is a demonstration of the mechanism on toy data, not a benchmark.

Let your assistant use it

lore install                      # the /lore skill, for the assistants found on this machine
lore install --project --always-on   # into this repo, plus a short block in CLAUDE.md / AGENTS.md
lore install --project --hooks       # plus Claude Code hooks: a file's claims as it is read and edited
  • The skill tells the assistant to run lore query before changing code in a repository that has .lore/, to treat not adopted claims as declined work, to weigh a claim like a teammate's comment rather than an instruction, and to report back with lore feedback. Claude Code, Cursor and Gemini CLI each get a skill directory; Codex reads the cross-framework Agent Skills directory (~/.agents/skills/, or .agents/skills/ in the repository with --project).
  • --always-on adds a short marked block to the assistant's instruction file (CLAUDE.md, AGENTS.md, GEMINI.md), or an always-apply rule in .cursor/rules/ for Cursor.
  • --hooks gives Claude Code two hooks. When the assistant reads or edits a file, the claims whose scope covers that file join its context, once per scope per conversation, declined work first and never lost to the size cap, so they are in view before the edit. Each prompt brings up the claims relevant to it, as lore query would. A claim a reader has corrected arrives marked corrected, with its note. The hooks stay silent when there is nothing to add and exit 0 whatever happens, so a teammate without crewlore is never blocked; after a compaction the shown scopes come up again.
  • Nothing of yours is overwritten. Every file written carries a crewlore marker: install refuses to replace a skill it did not write (--force overrides), and lore uninstall removes only marked files, the marked block and crewlore's own hook entries.
  • Assistants that cannot run commands, such as Claude Desktop, use the MCP server instead: lore serve, see docs/mcp.md.

Or install it as a Claude Code plugin. In a Claude Code session:

/plugin marketplace add srijansk/crewlore
/plugin install crewlore@crewlore

The plugin is the same /lore skill (invoked as /crewlore:lore) and the same three hooks, generated from the installer's own text, so the plugin and lore install --hooks are two ways to the same files: pick one, since with both Claude Code runs each hook twice. The plugin bundles no Python; the skill and the hooks call the lore command, so pipx install crewlore is still needed on the machine. Each crewlore release bumps the plugin's version; /plugin update crewlore@crewlore fetches it; restart Claude Code or run /reload-plugins to load it.

What you get

Raw, messy sessions go in. Out comes a claim: one reusable thing the team learned, with four parts.

  • Kind — a decision, procedure, gotcha, or style rule.
  • Action — what a future session should do about it.
  • Anchor — a verbatim quote from the source, plus where it sits (<session>#event-<n> for a transcript, path:line when a PR review comment supplies one). The compiler checks every quote against the source and drops any claim whose quote does not match, so the book never contains a citation that cannot be found.
  • Adoption — current, or not_adopted when the team tried the thing and declined it.

[gotcha] · services/billing

Billing webhook handler lacks an idempotency check, causing duplicate charges when Stripe retries webhooks.

Do — dedupe on the Stripe idempotency key before processing.

anchor ses_1#event-3 — "the handler has no idempotency check, so when Stripe retries a webhook the charge is processed again."

Declined work is recorded as declined. When a session or pull request shows an approach was tried and not adopted, the claim says so, and its action says what to do instead:

[decision · not adopted] · services/billing

Storing the Stripe idempotency key in Redis was proposed and rejected in review because the check has to run inside the database transaction.

Instead — keep the key in the same transaction as the charge.

anchor services/billing/webhook.py:88 — "Don't put the key in Redis. Must be inside the transaction."

Why this matters: a memory schema that can only say "X" turns "we tried X and declined it" into a confident assertion of X — fluent, correctly quoted, and wrong about the world. The measurement behind this design is in the study below.

Claims roll up into a knowledge book at .lore/knowledge/README.md, grouped by area and committed to your repo alongside your code:

# Team knowledge (compiled by crewlore)

## services/billing

- **[gotcha]** Billing webhook handler lacks an idempotency check; dedupe on the Stripe key.
  - *Do:* Dedupe on the Stripe idempotency key before processing.
  - _anchor_ `ses_1#event-3`: "the handler has no idempotency check, so when Stripe retries a webhook the charge is processed again."
- **[decision · not adopted]** Storing the idempotency key in Redis was proposed and rejected in review.
  - *Instead:* Keep the key in the same transaction as the charge.
  - _anchor_ `services/billing/webhook.py:88`: "Don't put the key in Redis. Must be inside the transaction."

## deployment

- **[procedure]** Run migrations before deploy to prevent missing columns.
  - *Do:* Run `make migrate` before every deploy.

A real example

docs/examples/pydantic-ai-prs/ is lore import-prs pydantic/pydantic-ai --limit 100, run on 2026-10-09 against the public pydantic/pydantic-ai repo (20k+ ⭐) with the default model, on a machine that had never run an agent in it. Of the last 100 closed pull requests, 24 were written by a coding agent: 18 merged, 6 closed without merging. They compiled into 130 claims, 15 of them marked not adopted, carrying 173 anchors. The fidelity gate dropped none of the model's proposals, and an independent re-check of every anchor against the committed threads found none that fail to resolve. The scrubbed source threads are in the example, so every anchor can be followed to the event it quotes.

One claim from a merged pull request, where an alternative was tried and turned down inside the review:

[decision · not adopted] · pydantic_ai_slim/pydantic_ai/models

Unified prompt caching (ModelSettings.cache / Caching) stays opt-in. A default-on variant (cache defaulting to True on models with supports_cache) was tried and not adopted, because the maintainer deferred default-on caching to v3.

Instead — do not default cache to True; leave caching off unless the user sets cache, uses Caching(), or sets a provider-specific cache setting. Revisit default-on only for v3.

anchor pr_pydantic__pydantic-ai__7560#event-65 — "Per maintainer decision, caching stays off unless cache (or the Caching capability) or a provider-specific cache setting asks for it; turning it on by default waits for v3."

The example records no conflicts. The detector flags a disagreement only with evidence of one: a claim marked not adopted beside a current one, or one claim forbidding what another prescribes. Three claims that all forbid touching the repository's .github/ directory agree, so they are not reported as one. The blind spot that leaves is listed under limits below.

The older snapshot, docs/examples/pydantic-ai/, is three Claude Code sessions compiled with crewlore 0.1.0 in May 2026. Its README explains what it can and cannot show.

How it works

flowchart LR
    S["coding-agent<br/>sessions"] --> I["ingest + scrub<br/>(one session format,<br/>secrets redacted)"]
    P["agent-authored<br/>pull requests"] --> I
    I --> C["compile<br/>(claims with verbatim<br/>anchors + adoption)"]
    C --> R["<b>.lore/</b> in your repo<br/>(knowledge book + claims,<br/>plaintext, git-versioned)"]
    R --> SV["serve<br/>(files + MCP query)"]
    SV --> N["next agent session<br/>inherits the knowledge"]

    SV -. "usage + feedback" .-> AL["lifecycle<br/>(decay · reinforce · retire)"]
    AL -. "lifecycle update" .-> R

    classDef engine fill:#4a5d9e,stroke:#1a2c4d,color:#fff,stroke-width:2px
    classDef artifact fill:#2d6a4f,stroke:#1b4332,color:#fff,stroke-width:2px
    class C engine
    class R artifact
  • Ingest + scrub. Two sources feed one session format. Transcripts: the Claude Code session files for this repo. Pull requests: fetched through the gh CLI, one PR thread per session, carrying the description, commits and their messages, review comments with their file and line, approve or request-changes verdicts, CI results, and whether the PR merged or was closed. Both are scrubbed of a curated set of secret patterns (API keys, cloud and GitHub tokens, Slack and Hugging Face tokens, JWTs, connection-string passwords, private-key blocks, password=… shapes) before anything is stored or sent to a model. The pattern set and its limits are in docs/scrub.md.
  • Compile. A model extracts candidate claims from each session. Deterministic stages then do the rest: verify every anchor quote against the source and drop what does not match, derive each anchor's position from where the quote was found, deduplicate by content, record disagreements between sessions instead of overwriting, and score authority by how many independent sessions support a claim. lore compile prints how many proposed anchors and claims the gate dropped each pass; that number, not the store's after-the-fact "fidelity", is what tells you how the model behaved.
  • Serve. A Markdown book in .lore/knowledge/, a lore query command, a /lore skill that lore install puts into your coding assistant, and an optional MCP server so any agent can pull the relevant slice at the start of a session.
  • Lifecycle. Every retrieval is recorded. People and agents can mark claims influential or overridden (lore feedback, or the lore_feedback MCP tool). Claims nobody has read in 30 days (configurable) are archived, claims that are repeatedly overridden are retired, and influential ones are reinforced, so the book stays small instead of growing into a pile nobody reads. Usage is tracked per machine; the usage file is local so the committed book stays byte-stable. A claim that is wrong or outdated can be corrected (lore feedback <id> --corrected "what is true now"): the note goes to a tracked file beside the claims (commit it with the book), is shown wherever the claim is served, and the claim stays in the book marked corrected, after uncorrected claims in retrieval, the way declined work stays visible rather than deleted.

The intelligence is in compile; ingest and serve are deliberately thin, so supporting another coding agent or another source is a small adapter, not a rewrite. "Compile" here means the repeatable session-to-claims transform: one model call per session, wrapped in deterministic verification, dedup, conflict recording and scoring.

How it differs

  • vs. memory services with their own store — their knowledge lives in a database you reach through an API. crewlore's lives in your repo as plaintext: reviewed in pull requests, searched with grep, audited with git log.
  • vs. per-editor memory — tied to one person and one tool. crewlore's book is a team artifact that a new teammate gets on git pull.
  • vs. a hand-written CLAUDE.md or rules file — written after the fact and stale within weeks. crewlore extracts from what actually happened, keeps the quote as proof, and retires what stops being read.
  • vs. retrieval over document chunks — returns passages. crewlore returns claims with an action and a verdict, so a reader can tell a decision from a rejected alternative. (Retrieval today is deterministic word overlap, not embeddings — simpler and dependency-free; semantic ranking is on the roadmap.)

Why this exists

Knowledge discovered inside an agent session is private by default and lost by default. It lives in one developer's transcript, so the next engineer — and every future agent run — re-reads the same files, re-learns the same gotcha, and re-makes a decision the team already made. There's no shared layer that both humans and agents read from, so decisions drift and bugs resurface.

crewlore makes that knowledge a first-class, versioned artifact in the place your team already trusts: your git repo.

What it is: a compiler that turns sessions and pull requests into deduplicated, conflict-aware, provenance-carrying team knowledge, served back to any agent.

What it isn't: a hosted service, a vector database, or a personal-memory layer for a single IDE. There's no account, no cloud, and no proprietary store — the compiled knowledge is plaintext you own.

Your data stays yours

  • Local-first. Capture, compile, and serve all run on infrastructure you control. Point the compiler at your own model provider or a local OpenAI-compatible model (Ollama, LM Studio, vLLM) via provider: local — nothing routes through any crewlore-operated service, because there is none.
  • Scoped by default. lore compile and lore watch read only this repo's own Claude Code transcripts. Reading any other directory is an explicit choice (--transcripts DIR or capture.transcripts in the config).
  • Plaintext, in your repo. The knowledge layer is human-readable Markdown and JSONL under .lore/, versioned by git. git log .lore/ is your audit trail.
  • Secrets are scrubbed before storage. Scrubbing of message content and tool-call arguments happens at ingest, before the session is written and before any model call. It is a high-precision pattern set, a floor rather than a DLP guarantee (see docs/scrub.md). Review the .lore/ diff in a pull request like any other change.
  • Raw captures never reach git. .lore/sessions/, .lore/sources/ (raw PR exports), the extraction cache and the usage file are gitignored, and the ignore file is written on every store write, not only by lore init.
  • No tokens to store. Pull-request import goes through the gh CLI you already authenticated; crewlore never sees or stores a GitHub token.
  • Other people's text is treated as untrusted. Transcripts and pull-request threads go to the model inside a delimiter their content cannot forge, with a rule that instruction-like text is content, not a command. That lowers the odds of a planted claim without ruling one out, so anchors compiled from now on name who wrote the quoted text (for pull requests, the login and the author's repository role; a local transcript knows human or agent only) and every new claim shows in the .lore/ diff. Claims are served to agents as evidence, not instructions, as single lines with terminal escapes and invisible characters stripped. The threat model is in SECURITY.md.

CLI

CommandWhat it does
lore initCreate the .lore/ layout in your repo.
lore watchAutomatically ingest → compile → prune on an interval (--once for cron/CI).
lore compileRun one ingest-and-compile pass (--rebuild re-extracts everything; --settle 0 captures a session you have just finished instead of waiting for it to settle).
lore renderRebuild the book and the conflict list from the committed claims, with no model call: for a fresh clone, or after a merge or pull.
lore hook install / uninstall / statusGit hooks that keep the layer current without a daemon: lore compile in the background after each commit, lore render after each merge. See Git hooks.
lore import-prs OWNER/REPOCompile a GitHub repository's pull-request threads. Scans closed PRs by default (--state open or all), agent-authored only (--all-authors for every PR), most recently updated first (--limit N). Needs the gh CLI.
lore query "<task>"Retrieve the claims most relevant to a task, with their ids (records usage). --json for scripts; --exit-code to exit 4 when nothing matched.
lore explain <scope>Everything known about one scope: current practice first, then declined work, each with its anchors and authors, plus live conflicts and the scopes nested under it. --json; --exit-code for 3 on an ambiguous name and 4 on no match.
lore review [PR]Check the files a change touches (the current branch, or a pull request through gh) against the claims that cover them; declined work first, and a flag when the change reads like an approach the team declined. --comment posts the report on the PR; --json; --exit-code for 5 when flagged. See docs/review.md.
lore feedback <id>… --influential / --overridden / --corrected NOTETell the layer what became of served claims. Influential and overridden feed the lifecycle; a correction is written to a tracked file beside the claims (commit it with the book) and shown wherever the claim is served.
lore statusShow claim/conflict counts and how much of the layer is actually being read.
lore install / lore uninstallPut the /lore skill into your coding assistant (--project for this repo, --always-on to add a block to its instruction file, --hooks for Claude Code hooks, --force to replace a skill file crewlore did not write), or remove exactly what was written.
lore serveStart an MCP server exposing lore_query, lore_explain and lore_feedback to any MCP-speaking agent (Claude Desktop, Cursor, …). Requires the serve extra. The package also installs crewlore as an alias of lore, which is the command the MCP Registry entry runs. See docs/mcp.md.
Git hooks

lore hook install adds a marked, removable block to the repository's post-commit, post-merge and post-rewrite hooks; lore hook uninstall removes exactly what it added, and lore hook status says whether each hook would run and why not. The short version:

  • A commit returns at once. The compile runs in the background and logs to .lore/cache/hook.log; lore hook status shows its last line, so a failed run is visible.
  • The key comes from the git client's environment. A GUI client started from the dock may not have your shell's exports; it logs a credentials error and the commit is unaffected. A committed .lore/config.yaml steers these automatic compiles, so review changes to it like code.
  • One compile at a time. A rebase compiles once when it has finished; a compile whose commit was replaced meanwhile stops with "HEAD moved" and the layer catches up on the next commit.
  • The post-merge render can dirty the tree. Review and commit the rendered book like any other change. To remove a claim for good, set its status to archived on its line rather than deleting the line, or the next compile replays it from the cache.
  • Existing hooks are edited carefully. The block goes where the shell will reach it, hooks it cannot parse or run are refused untouched, and LORE_SKIP_HOOK set to any value skips a run.

The details (locks and rebases, what the install does to an existing hook, what status --probe checks) are in docs/git-hooks.md.

Configuration

.lore/config.yaml:

model:
  provider: anthropic          # anthropic | openai | local
  name: claude-sonnet-5-5      # any current Claude model works; nothing but the prompt is sent
  # temperature: 0             # only sent if set; current Claude models reject sampling parameters
  # base_url: http://localhost:11434/v1   # for provider: local — Ollama, LM Studio, vLLM
capture:
  transcripts: auto            # this repo's own Claude Code transcripts, or a directory path
  settle_minutes: 10           # a transcript modified more recently is still being written; wait for it (`--settle` overrides per run)
compile:
  watch_interval_seconds: 300
  max_unused_days: 30          # claims nobody reads for this long are archived

Bring your own key (ANTHROPIC_API_KEY / OPENAI_API_KEY); crewlore never ships keys anywhere. The default Anthropic provider works out of the box. For OpenAI or a local OpenAI-compatible model, add the SDK: pipx inject crewlore openai (or pip install 'crewlore[openai]'). With provider: local nothing leaves your machine at all. A rejected key, an unknown model name, or a parameter the model refuses stops the run with a clear error instead of reporting a successful compile of nothing.

The study behind the adoption field

Before the adoption field existed, I measured what the compiler stores when it reads work a team declined, using agent-authored pull requests from the public AIDev corpus: 60 PRs closed without merging and 60 merged PRs from the same repositories, each claim judged by a separate model against the PR's actual outcome.

Share of a declined PR's claims that state the rejected approach as current practice, averaged over PRsDeclined PRs with at least one such claim
crewlore's extractor, no change44.7%47 of 60
A schema-free summarizer on the same threads47.6%45 of 60
Merged controls0%0 of 60
Tell the model the PR was closed30.1%, −14.6 points35 of 60
Add the adoption field plus an instruction to use it17.5%, a further −12.7 points25 of 60

A later check (studies/palm/LABEL_RECHECK.md) found that 35 of the 60 declined pull requests had their change land in their repository anyway, 28 in full and 7 in part, 20 of them by the time the agent's pull request was closed or within two days, 12 of those through a maintainer's own pull request. The table's counts over all 60 include them. Among the 25 whose change did not land within about six months, 19 still put at least one such claim into the store, 43.0% of their claims on average; counting the claims the check judged true of the code as safe, the first row becomes 33 of 60 and 26.6%. Each difference in the table keeps its direction and significance under each accounting, and the summarizer still matches the extractor.

The part that changed the schema: across every version without the field, 0 of the 658 statements extracted from declined PRs mentioned the rejection in their own text (0 of 1,060 counting the merged controls). With the field, 77 of the 196 claims from declined PRs say so in words, and 77 of the 91 the model marked not_adopted do. Telling the model the outcome was not enough; it began writing the rejection down only when asked to record the verdict, with a field to hold it.

The code, pinned data revision and reproduction recipe are in studies/palm/. The study ran crewlore's extractor and fidelity gate with Gemini models through the OpenAI-compatible provider, with a second judge for agreement (κ = 0.92). This repository is the primary record of the study; a short write-up is being posted as a preprint and will be linked here. If crewlore is useful in your research, CITATION.cff has the citation.

Status, limits and roadmap

[!NOTE] Alpha. The on-disk format may change before 1.0; format changes are listed in the CHANGELOG. Tested on Python 3.10–3.14, with no network calls in the test suite.

  • Works today: capture from Claude Code transcripts and GitHub pull-request threads, secret scrubbing, the compile pipeline (verbatim-anchor gate, derived anchor positions, adoption field, conflict recording, authority scoring), the book, lore query and lore explain, lore review, the /lore skill and Claude Code hooks (lore install), git hooks that compile after each commit (lore hook install), the MCP server, feedback and corrections, and unused-claim decay.
  • Limits worth knowing: retrieval is word overlap, not embeddings; the only transcript source is Claude Code (Cursor, Codex and Copilot sessions come in through the PR path); commits outside a pull request are not read; there is no approve-before-serve gate, so review the .lore/ diff in a PR; the conflict detector flags a disagreement only when one claim is marked not adopted or forbids what another prescribes, so two sessions that merely pick different answers go unflagged; usage and decay are per machine, not shared across the team.
  • Planned: a human approve-before-serve gate, transcript adapters for other coding agents, embedding-based retrieval, capture at session end without waiting for a commit, and a shared usage signal across teammates.

Contributing

Issues, discussions, and PRs welcome. New here? Start a discussion — adding a capture adapter for another coding agent is the most valuable first contribution and is intentionally small (the Claude Code and GitHub PR adapters are the two worked examples). See CONTRIBUTING.md for local setup and the dev loop.

License

MIT — see LICENSE.

crewlore is written and maintained by Srijan Saket. The official source is github.com/srijansk/crewlore: every PyPI release since 0.2.0 is published from this repository's release workflow and carries a provenance attestation naming this repository.

Frequently asked questions

What is crewlore?

Team knowledge compiled from your coding agents' sessions and pull requests, every entry cited.

How do I install crewlore?

It runs on your machine. In Claude Code: claude mcp add crewlore -- uvx crewlore==0.5.3 serve --repo. For other clients, paste the JSON configuration from this page into their MCP settings.

Does crewlore need an API key?

Its registry entry lists no required key or secret. Some features may still need an account with the service it connects to.

Is crewlore open source?

Yes. Its code is on GitHub under the MIT license.

Who maintains crewlore?

It is published by srijansk. AI.tn lists it but does not maintain or endorse it.

From the official MCP Registry. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.