The Knowledge Base
How CodeLantern remembers your project: plain markdown in your repo, organized by memory layer, that grows as you work.
CodeLantern keeps what it knows about your project in a knowledge base: plain
markdown files that live in your repository under .codelantern/. Every skill reads
from it, and the workflow writes back to it, so each session
starts from what the last one learned instead of from scratch. Because these are files
in your repo, you own it, review it in pull requests, and can edit it by hand any time.
What each file remembers
The knowledge base is organized by memory layer, the same way you'd expect a teammate to remember different kinds of things.
| File | Memory layer | What it holds |
|---|---|---|
project.md | Long-term semantic | The project's shape: what it is, how it's structured, the facts that stay true across sessions. |
conventions.md | Long-term semantic | How your team writes code: patterns, naming, and house rules the agent should follow. |
components.md | Long-term semantic | The reusable building blocks and where they live, so work builds on what already exists. |
learnings.md | Long-term semantic | Hard-won lessons: the gotchas and fixes that would otherwise be re-discovered. |
recipes.md | Long-term procedural | Step-by-step procedures for recurring tasks: how to do the things you do often. |
work-items/<id>/session.md | Long-term episodic | What happened during a work item: the running log of the session, kept for signal. |
work-items/<id>/decisions.md | Reasoning | Why choices were made in this item: deviations, trade-offs, and what surprised the agent. |
adr/ | Reasoning | Architecture decision records: decisions that are hard to reverse or need context to understand. |
| (none) | Short-term | The agent's context window, the scratchpad. We deliberately don't persist it. |
/cl-dev:init scaffolds these files, /cl-dev:discover populates them from your
codebase, and you can grow them yourself. components.md appears once discover
detects a UI.
The learning loop
The knowledge base is what makes CodeLantern get better at your project over time. Every session ends by writing back what it learned, so the next one starts a step ahead.
At the end of a work item, /cl-dev:consolidate distills
what the work taught (new conventions, recipes, and learnings) and commits it back to
the knowledge base in a pull request you review. The next session reads it and starts
from a higher floor.
KB Intelligence
When a pull request is merged, the changes to your knowledge base sync to CodeLantern, where the entries become semantically searchable for future sessions. From the portal, you can watch your knowledge compound: every entry captured across your repositories, broken down by type.