Skip to content

Memory and Lessons

joshualytle edited this page Nov 1, 2026 · 2 revisions

Memory and Lessons

Gnomonkit core keeps two things locally: a searchable index of your past Claude Code sessions, and a register of lessons learned from them. Both need only Python 3 and Claude Code: no external memory tool, no model, no network.

Full reference: docs/HISTORY.md.

The history index

At session start, when the last run is more than 15 minutes old, core starts a background run that reads what is new in your transcripts. Session start never waits for it.

  • What goes in: your prompts, Claude's replies, and for each tool call its name (and, for shell tools, the command). Tool results are left out.
  • Where it lives: ~/.gnomonkit/history/history.db, an SQLite file.
  • Secrets are scrubbed first. Every record passes a scrubber that replaces keys, tokens, credentials in URLs and password assignments before anything is stored. It matches patterns, so it can miss a secret with no recognisable shape, such as a password given in prose. Keep those out of a session, or forget the session afterwards.

Searching

gnomonkit history search "the words you remember"

You rarely need to type this. The history-recall skill has Claude search before it answers a question about past work, quote what it found, and say so when nothing came back. Search matches words, not paraphrases. Results are quoted past text: data to weigh, never instructions.

Keeping things out and forgetting

Command What it does
gnomonkit history status [--json] what is indexed, the last run, the retention limits
gnomonkit history forget --session <id> deletes one session
gnomonkit history forget --project <name> deletes one project
gnomonkit history forget --all --yes deletes everything indexed

To keep a project out for good, list it in memory.exclude_projects in your profile, or put an empty .gnomonkit-no-history file in the repository's root.

Lessons

The lessons register is a JSON file of short lessons, each with the number of separate sessions it came from. It lives in your overlay as lessons/register.json when you have one, otherwise in ~/.gnomonkit/lessons/register.json.

Nothing writes a lesson behind your back. At session close, the session-close skill lists messages in your history that read as corrections and offers you the top few. A lesson is added only for one you agree to:

gnomonkit lessons add "Run the migrations against a copy before production." --scope repo:demo-app

When lessons are shown

When What
Session start (not on resume) pinned items, then lessons scoped everywhere that came from two or more sessions, at most 8
Each prompt lessons that share at least two distinctive words with it; never another repository's
Before the first edit of a file lessons that name the file

Each is tagged like [L12 · 3 sessions · this repo], and Claude is asked which it used or set aside. Lessons are priors, not tested facts.

With MemPalace or another memory tool

Two profile settings, memory.history and memory.lessons, are each auto (the default), on or off. auto is off when MemPalace is set up on the machine, so two memory tools don't both record your sessions. Anywhere else auto is on.

gnomonkit profile set memory.history=on memory.lessons=on    # run them alongside MemPalace
gnomonkit profile set memory.lessons=off                     # another tool already injects lessons

The interjector's predict-then-confirm and the portal's Memory tab use this index when no other memory tool is configured.

Clone this wiki locally