# How the notebook works — codebase memory that checks itself | coldstart

Source: https://coldstartmcp.dev/how-it-works/notebook/

The notebook · how it works

# One agent works it out. The next one _doesn't have to._

That only holds if the note is still true. So here is the whole loop — how a note gets written, what ties it to the code it came from, and **exactly what happens to it when that code changes underneath.**

[← how it works](https://coldstartmcp.dev/how-it-works/)

Coldstart Notebookcoldstart

**80** notes **7** links 50% fresh

Search title, path, symbol…

raw-log.ts

repair.ts

search.ts

tools.ts

cli.ts

index-manager.ts

FILE · SINGLE

### src/server/tools.ts

fresh 1 anchor · 2 edits

anchors — verified code addresses

`src/server/**tools.ts**` fresh

handleGetStructurefindFileByPath

note

handleGetStructure builds the gs symbol page for one file. Uses findFileByPath to look up the file: returns \[fileId, IndexedFile\] if found, null if not indexed — distinguishing "not in index" from "indexed but zero symbols."

coldstart's own notebook — one note, opened with `kb view`.

## Four things happen, in a circle.

None of them is a chore you have to remember. An agent writes what it learned, the note is pinned to the evidence, the evidence is re-checked on every read, and the note comes back when it's relevant.

01

### An agent finishes a real task, and writes down what it cost to understand.

Not what the code _is_ — you can read that. The part worth keeping is what wasn't written anywhere: that this function is the only safe write path, that these two files always change together, that the helper you'd expect to exist doesn't.

02

### The note is pinned to the exact code it came from.

It names the files and symbols it's about, and records **a fingerprint of each one as it looked at that moment.** A note is never a floating opinion — it's a claim with an address and a snapshot of what it was true about.

03

### Every read re-takes the fingerprint.

Nothing is trusted from memory. Before a note is shown to anyone, the files it points at are read **as they are right now** and compared against the snapshot. That one comparison is the entire freshness system — there is nothing else to configure, and no expiry date to guess at.

04

### The note comes back on its own, before anyone starts searching.

When a later prompt is about that code, the note is handed to the agent up front — carrying the result of the check with it, so the agent knows how far to trust it before it acts on it.

And the agent that just used a note is the one best placed to fix it — it has the files open. A note that turns out to be wrong gets corrected in that same session, which is step one again. **There's no maintenance step, because the maintenance is the loop.**

## A note about code is a note about a moving target.

So: what happens when the file changes, gets renamed, or disappears entirely? The fingerprint from step two is what makes that answer mechanical instead of hopeful. Four outcomes, re-decided from scratch every time the note is read.

The file is untouched

\[fresh\]

### Nothing to re-check

Byte-for-byte what it was when the note was written. An agent can act on it without opening the file at all — which is the whole point.

The file changed

\[evidence changed\]

### Demoted to a hypothesis

The note still appears — it's probably still mostly right — but labelled, with an instruction to re-verify it against the file first. It never quietly keeps its authority after the ground moved.

The file was renamed or moved

\[moved → src/new/path.py\]

### The note follows the file

A rename isn't a deletion. If the content at the new path still matches the fingerprint, the note travels with it — a refactor that shuffles your tree doesn't cost you the notebook.

The file is gone

\[anchor missing\]

### The note goes quiet

Deleted — or simply not on this branch. A note whose files have all vanished stops presenting itself as a description of live code, and returns by itself when the files do. Switching branches rewrites nothing.

→ Notice what's _not_ in that list: a judgement call. **Every one of these is a comparison, not an opinion** — which is why it can run on every read, in any language, without a model call and without slowing anything down. A note never silently rots here. It loses confidence out loud.

### One repo, one corpus

The notebook is plain files in your repository. Commit it and the whole team's agents read and write the same body of knowledge — two people writing about the same file on different branches both keep their notes, and the merge combines them instead of picking a winner. Private by default; sharing is opt-in.

[Read the docs](https://coldstartmcp.dev/docs/) [How the navigation layer works →](https://coldstartmcp.dev/how-it-works/navigation/)
