From lens
The memory loop. Use when closing significant work or weekly — processes queued lens sessions, mines them for patterns, proposes new lenses / lens updates / CLAUDE.md diffs, and writes approved observations to the foundry ledger. Also accepts an explicit transcript path or session_id as argument.
How this skill is triggered — by the user, by Claude, or both
Slash command
/lens:retroThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Requires a lens config with `foundry` set (a Claude Code feature — the loop is not
Requires a lens config with foundry set (a Claude Code feature — the loop is not
supported on Cowork; see /lens:setup). Discover the config first-readable-wins:
$LENS_CONFIG → ~/.claude/lens.json → ~/lens/lens.json. If none is found: explain
in one line, point to /lens:setup, stop. Never error.
<foundry>/pending-retros.jsonl and <foundry>/processed-retros.jsonl.session_id is NOT in the processed file. (Both files are
append-only. NEVER rewrite or truncate them — a SessionEnd hook may append
concurrently.)"type":"gap") are pending until a processed marker with their
date+lens+note hash appears; treat each as a one-line observation candidate.For session entries, read the transcript (it is JSONL; grep/skim for the lens questions, user answers, friction moments — do not load the whole file blindly if it is huge). Ask of each:
After individual passes, look across entries for repetition. A pattern seen ≥2 times is a proposal candidate:
.lens/, or — for
maintainers — the bundled set).<foundry>/lenses/ or a project
.lens/): concrete diff, apply on approval. For a bundled lens: if the session is
inside the lens plugin repo (maintainer context), apply the diff there; otherwise
emit it as a local file and suggest a PR to the public plugin repo.EVERY proposal — observation, lens, update, CLAUDE.md diff — is shown to the user and
applied only on explicit approval. Nothing auto-applies. Rejected proposals are
recorded as processed (so they don't reappear) with "rejected":true.
<foundry>/observations.md (date + one paragraph
each; link the sessions they came from).{"session_id":"<id>","processed_date":"<YYYY-MM-DD>"} per handled entry to
<foundry>/processed-retros.jsonl.Provides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.
npx claudepluginhub tiltely/lens --plugin lens