CodeLantern Docs
Core Concepts

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.

The .codelantern/ file tree alongside the memory layers each file maps to: semantic, procedural, episodic, reasoning, and the short-term scratchpad

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.

FileMemory layerWhat it holds
project.md Long-term semanticThe project's shape: what it is, how it's structured, the facts that stay true across sessions.
conventions.md Long-term semanticHow your team writes code: patterns, naming, and house rules the agent should follow.
components.md Long-term semanticThe reusable building blocks and where they live, so work builds on what already exists.
learnings.md Long-term semanticHard-won lessons: the gotchas and fixes that would otherwise be re-discovered.
recipes.md Long-term proceduralStep-by-step procedures for recurring tasks: how to do the things you do often.
work-items/<id>/session.md Long-term episodicWhat happened during a work item: the running log of the session, kept for signal.
work-items/<id>/decisions.md ReasoningWhy choices were made in this item: deviations, trade-offs, and what surprised the agent.
adr/ ReasoningArchitecture decision records: decisions that are hard to reverse or need context to understand.
(none) Short-termThe 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.

The learning loop: a session runs the workflow, /cl-dev:consolidate captures what it learned and commits it back to the knowledge base in your repo, KB Intelligence ranks the entries, and the next session starts with the relevant subset already in place.

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.

The CodeLantern portal's Knowledge analytics: total entries captured, repositories with a knowledge base, entries this month, and a type breakdown of ADRs, components, conventions, glossary, learnings, project facts, and recipes.

Next

On this page