From 21da9c9cd4e335f5fa42f8bd4df26bbc5e4a0028 Mon Sep 17 00:00:00 2001 From: Luna AI Date: Tue, 10 Feb 2026 04:34:27 +0500 Subject: [PATCH] docs: clarify which workspace files are injected into context window (#12909) The system prompt docs listed bootstrap files but omitted MEMORY.md, which IS injected when present. This led users to assume memory files are on-demand only and not consuming context tokens. Changes: - Add MEMORY.md to the bootstrap file list - Note that all listed files consume tokens on every turn - Clarify that memory/*.md daily files are NOT injected (on-demand only) - Document sub-agent bootstrap filtering (AGENTS.md + TOOLS.md only) Closes #12909 --- docs/concepts/system-prompt.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/concepts/system-prompt.md b/docs/concepts/system-prompt.md index acb2bf8b5f..2a4adba532 100644 --- a/docs/concepts/system-prompt.md +++ b/docs/concepts/system-prompt.md @@ -59,11 +59,24 @@ Bootstrap files are trimmed and appended under **Project Context** so the model - `USER.md` - `HEARTBEAT.md` - `BOOTSTRAP.md` (only on brand-new workspaces) +- `MEMORY.md` (when present in the workspace) + +All of these files are **injected into the context window** on every turn, which +means they consume tokens. Keep them concise — especially `MEMORY.md`, which can +grow over time and lead to unexpectedly high context usage and more frequent +compaction. + +> **Note:** `memory/*.md` daily files are **not** injected automatically. They +> are accessed on demand via the `memory_search` and `memory_get` tools, so they +> do not count against the context window unless the model explicitly reads them. Large files are truncated with a marker. The max per-file size is controlled by `agents.defaults.bootstrapMaxChars` (default: 20000). Missing files inject a short missing-file marker. +Sub-agent sessions only inject `AGENTS.md` and `TOOLS.md` (other bootstrap files +are filtered out to keep the sub-agent context small). + Internal hooks can intercept this step via `agent:bootstrap` to mutate or replace the injected bootstrap files (for example swapping `SOUL.md` for an alternate persona).