File of the day

A Claude Code command that sifts your notes into a knowledge base every night

Slava Sazhin 27 September 2026 3 min read 1 view

A Claude Code command reads the notes of the last day at night and adds to your knowledge base what will still matter in three months. It deletes nothing.

Today's file is a Claude Code command for what you learn while working: where a service lives, the command that really builds the report, the trap you fell into on Tuesday. It goes into a note, newer notes bury it, and three months later a new session falls into the same trap. Prosev runs at night, reads the notes changed in the last day and moves what will still matter into a knowledge base.

How it works

The filter is one question: will this entry save a new session, three months from now, doing a different task in the same place, at least one step. The progress of a task, one-off measurements and dates, what one query to the code would show, secrets and anything personal stay out. Of a password it keeps only the name of the environment variable that holds it.

Before writing, it searches $HOME/knowledge by the distinctive words of each entry (a path, a command, a service name) and reads the whole section it finds. Already there: skipped. Written differently: fixed in place, with the date it was seen. Missing: added to the file that fits the topic, and a new file only when none does. Then it reads back every place it changed and puts the file back if something does not match.

It deletes and shortens nothing, neither notes nor entries. The reply is one line, "All good, all done.", also on a night with nothing to add. Errors, if there are any, come instead, one per line.

What to change

The folders are $HOME/notes and $HOME/knowledge. If your notes live elsewhere, change the paths in the file and in the run command. The run uses --permission-mode acceptEdits: edits inside the folder it starts in and the two --add-dir folders go through without asking, so deleting nothing is a rule in its prompt, not a lock. Start it from $HOME/knowledge rather than your home folder, where cron starts it, and keep that folder in git.

Install

One file goes into ~/.claude/commands/. The note below then asks Claude for three things: the two folders, a short note at the end of every work task, and a daily run at 3:00 with claude -p '/prosev'. The computer stays on and awake at night. The check puts one line into a note, runs /prosev and expects that line in the knowledge base once, still once after a second run.

The files

prosev.md 3 KB Download
---
description: At night sifts fresh work notes with the filter "will this matter in three months" and moves what passes into the knowledge base. Deletes nothing.
---

# Prosev - nightly sifting of notes into the knowledge base

GOAL: what was learned at work and will outlive this week - how a place is set up, a working command, a trap found, an owner preference - must not get lost in old notes. Once a day the skill takes the notes changed in the last day, picks out what was learned, checks it against what the knowledge base already has, and adds what is missing.

MAIN: the skill deletes and shortens nothing - neither notes nor knowledge base entries. It only adds and fixes in place what is outdated in the knowledge base. An empty catch is a normal outcome: then nothing is written to the knowledge base.

## Step 1. Reading and selection

Read in full every note in the `$HOME/notes` folder changed in the last day. From each, write out candidates: one line per candidate - the essence and the source (note name).

There is one measure: picture a new conversation from a clean slate three months from now, doing a different task in the same place - will this entry save it even one step.

Not taken:
- the course and status of a task, what is done and what is left;
- one-off measurements and dates;
- what can be read from the code with one query;
- secrets in any form: password, token, key. Only a reference to an environment variable is allowed;
- anything personal, even if it turned up in a work note.

## Step 2. Checking the knowledge base BEFORE writing

For each candidate - a search in `$HOME/knowledge/*.md` by its distinctive words (path, command, service name, file name) and reading the found section in full, not one line. Three outcomes:
- already written - skip;
- written differently (outdated, differs from the note) - fix in place, with the observation date in the text of the fix;
- missing - add it to the section of a file that fits the topic.

A new file in the knowledge base is created only when none of the existing ones fits the topic.

## Step 3. Checking the write

After writing, check each change by reading that place: the text landed where named, the neighbouring text is intact. Does not match - put the file back as it was.

## Reply format

No errors - one line: "All good, all done." The same for an empty catch. There are errors - only them, one line each.

## Rules
- ⛔ Neither a bare secret nor anything personal is written to the knowledge base. Doubt is resolved as "do not write".
- The wording of an entry follows the neighbouring entries of the same file: the same language, the same order.
how-to-install.md 1 KB Download
# How to install the nightly sifting of notes

1. Put `prosev.md` into the `~/.claude/commands/` folder.
2. Ask Claude: "Create the folders $HOME/notes and $HOME/knowledge".
3. Ask Claude: "At the end of each work task, briefly write what was learned into a note in the $HOME/notes folder".
4. Ask Claude: "Set up a daily run at 3:00 with the command claude -p '/prosev' --permission-mode acceptEdits --add-dir $HOME/notes --add-dir $HOME/knowledge".
5. At night leave the computer on and do not put it to sleep.

Check:

1. Put a file with one line into the `$HOME/notes` folder: "The accounting report is built with the command report --month".
2. Run `/prosev` in Claude Code.
3. Claude replies "All good, all done.", and this line appears in the `$HOME/knowledge` folder.
4. Run `/prosev` again: the line is not added a second time.

Was this article worth your time?

Give Claude a computer of its own

Your own Linux machine with Claude Code on it, working around the clock while your laptop is shut. From €2.99 a month.

Contact the Combobulating team