Skip to content
Mastering Claude

The course175 lessons

Home / The second brain

The second brain8 minApplication

What Claude promised must live outside the conversation

A promise made in a conversation vanishes with the context, after a compaction or a new session; a registry with one file per task, a state and closing rules makes it survive; the session transcripts, read without their content, say which sessions moved.

A promise made in conversation, "I'll take care of it", "I'll get back to you", exists only while that conversation stays in the context. After a compaction or a new session it is gone, and nothing warns the assistant that it was open. The remedy is the one from the first lesson of this module: write to a file what must survive.

One file per task, one state per file

The registry is a folder: one file per task, with a state line among open, in-progress, delivered, abandoned, withdrawn, written exactly so in the files. The last three close the task. The demonstration creates its own data in a throwaway folder:

mkdir -p registry && cd registry
printf 'state: open\ntitle: Proofread the supplier quote\n' > t001.md
printf 'state: delivered\nproof: quote-checked.md\ntitle: Send the summary\n' > t002.md
printf 'state: abandoned\nquote: "drop the comparison"\ntitle: Compare three offers\n' > t003.md
grep -L -E '^state: (delivered|abandoned|withdrawn)' t*.md
t001.md

The command lists the files that have no closing line: the tasks still open or in progress. A task announced as finished in conversation but never closed in the registry stays visible there: that is intended, because closing demands a piece of evidence.

Closing rules

  • A single tool writes to the registry, under a lock, so that two sessions do not overwrite each other, tool given below (a shared vault has no concurrent editing).
  • A task leaves only delivered, with a named proof, abandoned, with the quotation of the person who gave it up, or withdrawn, with the reason (duplicate, entered by mistake).
  • An abandoned task does not come back because a new title resembles the old one.
  • On resumption, a SessionStart hook displays the open tasks before the first request.

Here is that tool, in a few lines. mkdir fails if the folder already exists: only one process at a time passes the lock, the others wait. A lock left behind after a crash is removed by hand (rmdir .lock). Replayed under Git Bash on 2026-11-16, it prints the output below and the task stays listed by the previous command.

write_state() {   # write_state t001.md in-progress
  until mkdir .lock 2>/dev/null; do sleep 1; done
  sed -i "s/^state: .*/state: $2/" "$1"
  rmdir .lock
}
write_state t001.md in-progress && cat t001.md
state: in-progress
title: Proofread the supplier quote

Following activity from the transcripts

Conversations are recorded in plain text in projects/<project>/<session>.jsonl, inside the Claude Code configuration folder, and kept 30 days by default (official documentation, consulted on 2026-11-16). A read-only tool can say which sessions moved without showing their content:

mkdir -p projets/a
echo '{"type":"user"}' > projets/a/active.jsonl
echo '{"type":"user"}' > projets/a/ancienne.jsonl
touch -t 202601010000 projets/a/ancienne.jsonl
find projets -name '*.jsonl' -mmin -10
projets/a/active.jsonl

The internal format of these lines is not guaranteed from one version to the next. Limit the tool to what does not depend on it, the file name and its modification date.

Figure 1

The life of a task in the registry

01
Create
The promise becomes a file in the open state, with a title, as soon as it is made.
02
Advance
The single tool, under a lock, moves the task to in progress when the work starts.
03
Close
The task moves to delivered with a named proof, to abandoned with the person's quotation, or to withdrawn with the reason.
04
Resume
When a session starts, a hook displays the files without a closing line.
The figure follows a task from creation to closing, then to its reappearance on resumption: the three exits that close it each demand their piece of evidence.
Calibrate it yourself

A coordinator asks her assistant, on a Friday, to prepare the follow-up of three suppliers. On Monday, in a new session, the assistant has no memory of that request. She opens the registry folder, which holds three files, and runs the command that looks for files that have no closing line: it lists two names. She sends the assistant back to those two tasks.

Write in one sentence what this situation establishes, and in one sentence what it does not establish.

What to remember
  • A promise made in conversation vanishes with the context, after a compaction or a new session: what must survive is written to a file.
  • One file per task, with a state line, lets one search for the files without a closing line find the open tasks.
  • A task leaves the registry only delivered with a proof, abandoned with the person's quotation or withdrawn with a reason, and an abandoned task does not come back because a title resembles it.
  • Transcripts locate session activity, but their format is internal: read the name and the date, not the content.
Do this now

In a temporary folder, create three state files as above, run the grep -L command and check that it returns only the task that is not closed.

What still needs checking

These points depend on an interface or a rule that may have changed since this was written. Check them on your own screen before relying on them.

  • Reproduce the demonstration in a temporary folder: the command must return a single file, the one without a closing line. Change the state of another file to reopen it and run it again.
Check the source

Every datable claim in this lesson links here to the public text behind it. A source that does not open proves nothing.