CodeLantern Docs
Core Concepts

The Knowledge Base

How CodeLantern remembers your project: plain markdown in your repo, 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/knowledge-base/. 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 keeps shared project guidance in these files:

FileWhat it holds
project.mdWhat the project does and how it is structured.
conventions.mdCoding patterns, naming, and team rules.
components.mdReusable UI components and where to find them.
glossary.mdThe project's terms and their meanings.
learnings.mdLessons from completed work.
recipes.mdProcedures for recurring tasks.
adr/Architecture decision records explaining significant choices.

/cl-dev:cl-init creates the initial structure. /cl-dev:discover fills it from your codebase, and /cl-dev:extract adds what a teammate knows that the code doesn't show. See Prepare the knowledge base. Components and architecture decisions are added when relevant.

Plans, session logs, and work-item decisions live separately under .codelantern/work-items/. They record what happened during an individual task; consolidation turns useful lessons from that history into shared knowledge.

The learning loop

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 the work item’s pull request. The final pull request distinguishes knowledge captured in the change from suggestions that were surfaced but not captured.

Sync to CodeLantern

Your repository is the source of truth for the knowledge base. Knowledge base sync keeps a copy on CodeLantern from your default branch, which feeds the portal's Knowledge analytics. Skills read the files in your repository whether or not sync is set up.

Next

On this page