docs menu · configuration

# configure

Configuration

This page shows the default extract.toml and every key that Monot reads, then explains extraction and picks.

Monot reads its settings from ~/.monot/extract.toml. The settings control extraction, the background worker that writes facts after a session ends, and picks, one extra memory that an LLM chooses for each prompt. The provider is the program that Monot sends its model calls through. The only provider is claude-code: your own claude program. When a session starts and ~/.monot/extract.toml does not exist, Monot writes the file with the three lines below. With this file, extraction and picks are both on. No line in it turns extraction on: extraction is on because the file has no extract = false line.

[ toml ]
provider = "claude-code"
pick = true
pick_cap = 10

Every key

Monot never replaces a file that exists, so you can edit it. The file below sets every key that Monot reads, each with an example value:

[ toml ]
# The provider is your own claude program. It is the only provider.
provider = "claude-code"
# A model ID that claude --model accepts. Without this line, Monot uses claude-sonnet-5-5.
model = "claude-opus-5-5"
# Extraction is on with or without this line. Change true to false to turn extraction off.
extract = true
# Turns picks on. The file that Monot writes has this line. In a file with no pick line, picks are off.
pick = true
# The most pick calls in one context window. Without this line, the limit is 10.
pick_cap = 10

A context window, which the pick_cap comment names, is all the text that Claude sees at one time. Put each comment on a line of its own, with # as the first character. Monot does not read a comment at the end of a line as a comment. For example, Monot reads pick = true # on as a value other than true, so picks stay off. It reads extract = false # off as a value other than false, so extraction stays on.

You can turn off each feature that calls a model, or Monot's hooks:

  • To turn extraction off for good, add the line extract = false to ~/.monot/extract.toml. Picks keep their own setting. Do not delete the file: Monot writes it again, with extraction on, when the next session starts, and it then skips the sessions that wait for extraction. While extraction is off, Monot still adds each session to the list of sessions that wait for extraction. To turn extraction on again, remove that line or change it to extract = true. The worker then also extracts the sessions that joined the list while extraction was off, if Claude Code still has their transcripts. Each of them costs the same claude -p calls as any other session.
  • To turn picks off, set pick = false in the same file. Extraction keeps its own setting.
  • To turn Monot's hooks off for one session, start Claude with MONOT=0 claude. Disable or remove Monot says what still works.

Extraction

Extraction writes the facts that a later session would still need. A background worker reads each finished session and sends it to Claude through your own claude program. So Anthropic sees your session text. Extraction needs no API key. It needs the claude program on your PATH, logged in. If your claude program is logged in with a Claude plan, the calls count against the usage limits of your plan and cost nothing extra. If it is logged in with an Anthropic Console account, the calls are billed as API usage. Claude's answer never waits for the worker.

Extraction is on by default and needs no setup. Monot writes extract.toml when it is missing, and extraction runs unless the file holds the line extract = false. To turn extraction off, add that line. To use another model, add a line such as model = "claude-opus-5-5", with a model ID that claude --model accepts. Without a model line, Monot uses claude-sonnet-5-5. The Picks section says how to turn picks off.

If your extract.toml has a base_url line and no provider line, it is a file from before version 0.16.0, when base_url named a model API. Monot keeps the file but ignores base_url: extraction and picks send your text through your claude program to Anthropic, not to that API. Monot also ignores the file's model line, because that model ID is the API's, and uses claude-sonnet-5-5. To choose a model there, add the line provider = "claude-code", or delete the base_url line.

When Monot writes extract.toml, it marks the sessions that already wait for extraction as read, so a session that ended before then is not sent. If such a session continues later, the worker sends its earlier turns as context and asks for facts only from the new turns. If Monot cannot mark every waiting session, it does not write the file, and the next session start tries again. The sessions that it already marked stay marked.

Monot marks sessions as read only when it writes a missing extract.toml. While your file holds extract = false, Monot still adds each session in a git repo to the list of sessions that wait for extraction, one file per session in ~/.monot/extract/. When you delete that line, the worker sends those sessions too.

How the calls run

Each time the worker reads a session, it makes up to two calls to the model. The first call writes the facts. The second call compares them with your stored memories, so that one fact is not stored twice. Monot skips the second call when there is nothing to compare: there is no new fact, or no stored memory to compare a fact with. When the reply to a call is not in the form that Monot asked for, Monot sends that call once more. So one read makes at most 4 calls in all. For each call:

  • Each call runs claude -p with no tools and no settings files, and Claude Code saves no transcript of the call.
  • Monot removes ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN and the cloud provider variables, such as CLAUDE_CODE_USE_BEDROCK, from each call. If one of them were set, it would win over the login of your claude program.
  • Monot stops a call that runs longer than 5 minutes. The session then gets a strike, a failed try that Monot counts, and the worker logs a line whose strike field is deadline. A later run of the worker tries the session again. A second reply in the wrong form also gives the session a strike. After 3 strikes in a row, Monot marks the session as failed and does not read it again.

A successful run that calls the model logs its tokens to ~/.monot/log/monot.jsonl. The cost field is 0 for every call, because Monot gets no price for these calls. It is 0 also when your login is an Anthropic Console account, which is billed. So the log does not show what your account is billed.

Check extraction

The worker reads a session only once the session ends, or once its transcript has had no new line for 30 minutes. These steps show one run:

  1. Start a new Claude Code session in a git repo.
  2. Send one prompt and wait for the answer.
  3. End the session.
  4. In ~/.monot/log/monot.jsonl, find the newest line whose event field is extract. It appears when the run ends, and it is about your session when no other session waits for extraction. A successful run has a to field on this line: how many bytes of the session's transcript the worker has read. A line with a strike or stop field says why a run failed, for example because claude is not logged in. A line with an off field says why extraction is off, and it names no session.

How the worker runs

The worker starts each time a session starts or ends, and after each turn. It takes each session that ended, or that is quiet. Quiet means that the last line of the session's transcript is 30 minutes old or older, by the line's timestamp. While a session has turns that the worker did not read, the worker checks again each minute. When no such turns are left, the worker stops. The worker reads only the turns that it did not read before. It sends the earlier turns too, but only as context. Only one worker runs at a time.

The worker sends a short form of the session. The short form holds your prompts, Claude's text, and one line per tool call. A tool line keeps the first 200 characters of the call. An MCP call with a text body, such as a comment, keeps the first 1,000 characters of the body. The short form also holds Claude's text and tool calls after a task notification. A task notification is the message that Claude Code sends to itself when background work finishes. The text and tool calls go under a line that holds none of the notification's own text. The short form holds no tool output, and it leaves out calls to Monot's own tools, recall, remember, forget and stats. Monot replaces each secret in it with [REDACTED:<rule-id>] first.

Dedupe

The second call to the model stops duplicate facts and fixes old ones. This step is dedupe. Dedupe compares each new fact with the 10 most similar memories. It also adds up to 10 more memories that name the same ticket ID, PR number or path as the fact. It also adds each memory that the session received, so a session can correct a memory that it used even when no fact looks like that memory. A state fact past its expiry date is never on the list. The model sees when the last new turn of the session ended, and when each memory last changed. A memory that changed later is newer than the fact, and the newer text wins. Then the model picks one of three actions for the fact:

  • new writes the fact as a new memory.
  • skip drops the fact as a repeat, and names the memory that already states it.
  • replace rewrites an old fact in its own file, with a merged text.

The model can also give a fourth action, reconcile, for each other memory that the fact makes out of date. For example, a memory says that a ticket is open, and the new fact says that it is closed. reconcile rewrites only the out-of-date part of that memory, and the memory keeps its type. A fact that you stored with remember reconciles other memories at the next run of the session.

Monot keeps the old text of each replace and reconcile in replaced/. To undo a wrong rewrite, copy that file back by hand. The dedupe line in the log names the file. Dedupe never changes a built-in memory or a global memory.

Standing rules

Sometimes the model finds a standing rule: a rule for every session in the repo, such as a coding standard. Extraction writes such rules to ~/.monot/repos/<host>/<owner>/<repo>/claude-md-suggestions.md. You copy the rules that you want into CLAUDE.md by hand. Monot never recalls that file.

Picks

A pick is the one memory, or none, that an LLM (a large language model, such as Claude) chooses for your prompt. The LLM also reads the session so far, so a pick can find a memory that the words of the prompt do not match. Picks send your session text, and the text of a document that your prompt names, through the same claude program as extraction. So Anthropic sees that text. The file that Monot writes contains pick = true, and picks are on only when that line is there. Each pick is one more claude -p call per prompt, on the same plan or account as extraction. It runs in the background, and it counts against the usage limits of your Claude plan, or is billed as API usage with an Anthropic Console login. A context window makes at most pick_cap pick calls.

What a pick sends

The prompt hook is the hook that Claude Code runs when you send a prompt. On each prompt that recall does not skip, and on a short prompt that recall skips, the prompt hook starts a background job. A short prompt such as yes or merge it gets a pick because the LLM reads the session. The job sends one request to the provider. The request holds four parts:

  • The memories that recall searches for this repo, one line each, with its name and its description. The list leaves out each memory that this context window already got. The context window is all the text that Claude sees at one time. When there are 50 memories or fewer, the request holds all of them. When there are more, it holds the 50 that best match the words of your prompt and of the newest turn.
  • The text of each document that your prompt names, when the prompt has 10 words or fewer besides the paths: a .md, .txt, .rst, .org or .adoc file of 256 KB or less. Monot replaces each secret in it with [REDACTED:<rule-id>] first. Then it cuts the texts to 8,000 characters in total.
  • The short form of the session, newest turn first: your prompts, Claude's text, and one line per tool call, with no tool output. It is the short form that extraction sends, without task notifications, and every tool line keeps only the first 200 characters. Monot replaces each secret in it with [REDACTED:<rule-id>] first.
  • Your prompt.

The request holds at most 32,000 characters. Monot cuts the oldest turns first. If the memory list and the prompt alone are too long, Monot sends nothing. The documents get only the room that the memory list and the prompt leave.

When Claude gets the pick

The prompt hook does not wait for the job. Claude starts its answer while the job runs. So the call to the provider never delays the start of Claude's answer.

The plugin also has a tool hook. Claude Code runs it after each tool call that Claude makes. A pick reaches Claude during the answer to your prompt, with the result of the first tool call that finds the pick ready. Monot drops the pick when the answer makes no tool call after the pick is ready, or when the answer ends before the pick is ready. Monot never gives a pick to a subagent, which is a helper agent that Claude starts for one part of the work.

A picked memory skips the gate. Monot still drops a pick in each case where it does not inject a memory, as listed in Recalled memories. It also drops a pick that is an echo of the prompt.

Limits

Each pick makes at most one call to the model. A context window makes at most 10 calls. A compaction starts a new count. In a compaction, Claude Code replaces the earlier part of the conversation with a summary. To change the limit, add a line such as pick_cap = 20 to ~/.monot/extract.toml.

Turn picks on or off

Picks need Claude Code 2.1.196 or later. On an older version, the prompt hook starts no job, so nothing is sent and nothing is spent.

Picks use the provider and the model of extraction. To turn picks on when your ~/.monot/extract.toml has no pick = true line, add that line, as in this file:

[ toml ]
provider = "claude-code"
pick = true

To turn picks off, remove the line or change it to pick = false. To turn Monot's hooks off for one session, start Claude with MONOT=0 claude.

Logs

Monot logs each pick to ~/.monot/log/monot.jsonl:

  • A pick line holds the tokens of the call, the picked memory, and a cost field that is always 0, so it does not show what your account is billed. It also holds two counts: memories is the number of memories that recall searches for this repo, and listed is the number that went into the request. named_docs, named_chars and named_sent show how many documents the job read, and their characters before and after the cut. If Monot made no call or dropped the pick, the line also gives the reason.
  • A deliver line shows that a pick reached Claude.
  • A pick_drop line shows that a pick did not reach Claude. Its reason field holds one of three values:
    • no_tool_call: the pick was ready, but the answer ended with no tool call after that.
    • late: the answer ended while the background job was still at work.
    • ledger: this context window already got the memory.