Docs menu

Docs

How lessons reach your agents

Lessons live as plain files in your repo, the place every coding agent already looks. No plugin, key or network access is needed, so they work in cloud sessions too.

The files Codela writes

FileWhat it is
.codela/lessons.mdA short index: one rule per lesson and the file with its details. This is the only part loaded into every session, so it stays small.
.codela/lessons/<name>.mdOne file per lesson: what went wrong, the production evidence, when the rule applies and doesn't, and ways to fix it. Agents open it when their change touches that code.
CLAUDE.mdOne line, @.codela/lessons.md, so Claude Code loads the index.
AGENTS.mdA small block between <!-- codela:lessons --> markers, read by Codex, Cursor and other agents.

Codela only ever writes these files. It never changes your code, and the rest of CLAUDE.md and AGENTS.md stays as you wrote it.

What the index looks like

An example (yours is built from your own deploys and history):

# Production lessons for this repo (from Codela)

1. [high] Batch price lookups per cart; one query per item
   made checkout p95 go from 180ms to 900ms.
   → .codela/lessons/per-item-price-lookups-in-checkout-3f9a21.md
2. [medium] Keep third-party calls out of request handlers; queue them instead.
   → .codela/lessons/third-party-call-inside-request-path-8c04de.md

## Production watch-outs (measured by Codela)

- Slowest requests in the last day: POST /checkout (1.3s). ...

Each rule carries a severity and points to its details. The “watch-outs” at the end are measured facts about production right now, not rules.

The lessons pull request

Lessons arrive through one pull request per repo, on the branch codela/lessons, kept up to date as lessons are added or removed. You choose how it's handled in Settings:

  • Automatic (default): merges by itself when Codela is confident the change caused the problem. Otherwise it asks for a review.
  • Review: always asks for a review, from the author of the change behind the lesson, then the workspace owner. One reminder after 3 days.
  • Off: nothing is written to the repo. Lessons stay on your dashboard.

Lessons that look unsafe go to review instead of merging by themselves. Lesson commits carry [skip ci], and a deploy that only changes lesson files is never checked.

Removing or keeping lessons

  • Delete a lesson on your dashboard and the next lessons pull request removes its file.
  • When every file a lesson is about has been deleted from your main branch, Codela marks it as possibly outdated. Renamed and moved files are followed, not flagged. Choose Remove or Keep it; Codela never deletes a lesson by itself.

Seeing that agents follow them

The index asks agents to name a lesson in the pull request description (Codela: <lesson file name>) when it changed their code. Codela counts those as “lessons followed” on your dashboard. When it warned on a pull request, it re-checks the merged change and counts whether the warning was fixed or ignored.

Optional: the Claude Code plugin

You don't need it: the repo files reach every agent, and Codela's agent tools come with your repo too. The plugin only adds extras for Claude Code on your computer: your most severe lessons in full at the start of each session, a lesson the moment it's written (before its pull request merges), and a /codela:lessons command to browse them:

/plugin marketplace add Subomi1234/codela-plugin
/plugin install codela@codela
/codela:setup