You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f9ef9c8
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/automation/hooks.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -243,7 +243,7 @@ Extracts the last 15 user/assistant messages and saves to `<workspace>/memory/YY
243
243
}
244
244
```
245
245
246
-
Paths resolve relative to workspace. Only recognized bootstrap basenames are loaded (`AGENTS.md`, `SOUL.md`, `TOOLS.md`, `IDENTITY.md`, `USER.md`, `HEARTBEAT.md`, `BOOTSTRAP.md`, `MEMORY.md`).
246
+
Paths resolve relative to workspace. Only recognized bootstrap basenames are loaded (`AGENTS.md`, `SOUL.md`, `TOOLS.md`, `IDENTITY.md`, `USER.md`, `HEARTBEAT.md`, `BOOTSTRAP.md`, `MEMORY.md`). Session bootstrap policy still applies after hooks run, so shared group/channel sessions do not receive hook-added `MEMORY.md` by default.
Copy file name to clipboardExpand all lines: docs/automation/standing-orders.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ Each program specifies:
41
41
The agent loads these instructions every session via the workspace bootstrap files (see [Agent Workspace](/concepts/agent-workspace) for the full list of auto-injected files) and executes against them, combined with [cron jobs](/automation/cron-jobs) for time-based enforcement.
42
42
43
43
<Tip>
44
-
Put standing orders in `AGENTS.md` to guarantee they're loaded every session. The workspace bootstrap automatically injects `AGENTS.md`, `SOUL.md`, `TOOLS.md`, `IDENTITY.md`, `USER.md`, `HEARTBEAT.md`, `BOOTSTRAP.md`, and `MEMORY.md` - but not arbitrary files in subdirectories.
44
+
Put standing orders in `AGENTS.md` to guarantee they're loaded every session. `MEMORY.md` is private/direct long-term memory, so shared group/channel sessions do not receive it by default. Put stable shared instructions in `AGENTS.md` or `USER.md`; use memory tools on demand for long-term notes.
Copy file name to clipboardExpand all lines: docs/channels/discord.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -287,7 +287,7 @@ Once DMs are working, you can set up your Discord server as a full workspace whe
287
287
</Step>
288
288
289
289
<Steptitle="Plan for memory in guild channels">
290
-
By default, long-term memory (MEMORY.md) only loads in DM sessions. Guild channels do not auto-load MEMORY.md.
290
+
By default, long-term memory (MEMORY.md) only loads in private/direct sessions. Guild channels do not auto-load MEMORY.md; they follow the same shared-session memory boundary as other group/channel surfaces.
Copy file name to clipboardExpand all lines: docs/concepts/system-prompt.md
+18-11Lines changed: 18 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,7 +176,7 @@ prompt surface that matches their lifetime:
176
176
-`USER.md`
177
177
-`HEARTBEAT.md`
178
178
-`BOOTSTRAP.md` (only on brand-new workspaces)
179
-
-`MEMORY.md` when present
179
+
-`MEMORY.md` when the session is eligible for long-term memory by default
180
180
181
181
On the native Codex harness, OpenClaw avoids repeating stable workspace files
182
182
in every user turn. Codex loads `AGENTS.md` through its own project-doc
@@ -193,15 +193,21 @@ search is unavailable, or the active workspace differs from the agent memory
193
193
workspace, `MEMORY.md` falls back to the normal bounded turn-context path. Active
194
194
`BOOTSTRAP.md` content keeps the normal turn-context role for now.
195
195
196
+
Long-term memory eligibility is session-aware. Private/direct sessions and main
197
+
local sessions keep the documented default behavior. Shared group and channel
198
+
sessions do not receive raw `MEMORY.md` by default; memory tools remain available
199
+
for explicit/on-demand reads. Sub-agent and cron sessions keep their existing
200
+
minimal bootstrap policies.
201
+
196
202
On non-Codex harnesses, bootstrap files continue to be composed into the
197
203
OpenClaw prompt according to their existing gates. `HEARTBEAT.md` is omitted on
198
204
normal runs when heartbeats are disabled for the default agent or
199
205
`agents.defaults.heartbeat.includeSystemPromptSection` is false. Keep injected
200
-
files concise, especially non-Codex `MEMORY.md`. `MEMORY.md` is intended to stay
201
-
a curated long-term summary; detailed daily notes belong in `memory/*.md` where
202
-
`memory_search` and `memory_get` can retrieve them on demand. Oversized
203
-
non-Codex `MEMORY.md` files increase prompt usage and can be partially injected
204
-
because of the bootstrap file limits below.
206
+
files concise, especially non-Codex `MEMORY.md` in private/direct sessions.
207
+
`MEMORY.md` is intended to stay a curated long-term summary; detailed daily
208
+
notes belong in `memory/*.md` where `memory_search` and `memory_get` can
209
+
retrieve them on demand. Oversized non-Codex `MEMORY.md` files increase prompt
210
+
usage and can be partially injected because of the bootstrap file limits below.
205
211
206
212
<Note>
207
213
`memory/*.md` daily files are **not** part of the normal bootstrap Project Context. On ordinary turns 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. Bare `/new` and `/reset` turns are the exception: the runtime can prepend recent daily memory as a one-shot startup-context block for that first turn.
@@ -218,11 +224,12 @@ default: `always`). Detailed raw/injected counts stay in diagnostics such as
218
224
219
225
For memory files, truncation is not data loss: the file remains intact on disk.
220
226
On native Codex, `MEMORY.md` is read on demand through memory tools when
221
-
available, with bounded prompt fallback when tools cannot run. On other
222
-
harnesses, the model only sees the shortened injected copy until it reads or
223
-
searches memory directly. If `MEMORY.md` is repeatedly truncated there, distill
224
-
it into a shorter durable summary and move detailed history into `memory/*.md`,
225
-
or intentionally raise the bootstrap limits.
227
+
available, with bounded prompt fallback only for sessions that are eligible for
228
+
long-term memory by default. On other harnesses, eligible private/direct sessions
229
+
only see the shortened injected copy until they read or search memory directly.
230
+
If `MEMORY.md` is repeatedly truncated there, distill it into a shorter durable
231
+
summary and move detailed history into `memory/*.md`, or intentionally raise the
232
+
bootstrap limits.
226
233
227
234
Sub-agent sessions only inject `AGENTS.md` and `TOOLS.md` (other bootstrap files
228
235
are filtered out to keep the sub-agent context small).
Copy file name to clipboardExpand all lines: docs/reference/token-use.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ OpenClaw assembles its own system prompt on every run. It includes:
20
20
prompt surface. It is bounded by `skills.limits.maxSkillsPromptChars`, with
21
21
optional per-agent override at `agents.list[].skillsLimits.maxSkillsPromptChars`.
22
22
- Self-update instructions
23
-
- Workspace + bootstrap files (`AGENTS.md`, `SOUL.md`, `TOOLS.md`, `IDENTITY.md`, `USER.md`, `HEARTBEAT.md`, `BOOTSTRAP.md` when new, plus `MEMORY.md` when present). Native Codex turns do not paste raw `MEMORY.md` from the configured agent workspace when memory tools are available for that workspace; they include a small memory pointer in turn-scoped collaboration developer instructions and use memory tools on demand. If tools are disabled, memory search is unavailable, or the active workspace differs from the agent memory workspace, `MEMORY.md` uses the normal bounded turn-context path. Lowercase root `memory.md` is not injected; it is legacy repair input for `openclaw doctor --fix` when paired with `MEMORY.md`. Large injected files are truncated by `agents.defaults.bootstrapMaxChars` (default: 20000), and total bootstrap injection is capped by `agents.defaults.bootstrapTotalMaxChars` (default: 60000). `memory/*.md` daily files are not part of the normal bootstrap prompt; they remain on-demand via memory tools on ordinary turns, but reset/startup model runs can prepend a one-shot startup-context block with recent daily memory for that first turn. Bare chat `/new` and `/reset` commands are acknowledged without invoking the model. The startup prelude is controlled by `agents.defaults.startupContext`. Post-compaction AGENTS.md excerpts are separate and require explicit `agents.defaults.compaction.postCompactionSections` opt-in.
23
+
- Workspace + bootstrap files (`AGENTS.md`, `SOUL.md`, `TOOLS.md`, `IDENTITY.md`, `USER.md`, `HEARTBEAT.md`, `BOOTSTRAP.md` when new, plus `MEMORY.md` only for sessions that receive long-term memory by default). Private/direct sessions keep the documented `MEMORY.md` behavior; shared group and channel sessions do not receive raw `MEMORY.md` by default and use memory tools only when explicitly requested. Native Codex turns do not paste raw `MEMORY.md` from the configured agent workspace when memory tools are available for that workspace; they include a small memory pointer in turn-scoped collaboration developer instructions and use memory tools on demand. If tools are disabled, memory search is unavailable, or the active workspace differs from the agent memory workspace, `MEMORY.md` uses the normal bounded turn-context path only for eligible sessions. Lowercase root `memory.md` is not injected; it is legacy repair input for `openclaw doctor --fix` when paired with `MEMORY.md`. Large injected files are truncated by `agents.defaults.bootstrapMaxChars` (default: 20000), and total bootstrap injection is capped by `agents.defaults.bootstrapTotalMaxChars` (default: 60000). `memory/*.md` daily files are not part of the normal bootstrap prompt; they remain on-demand via memory tools on ordinary turns, but reset/startup model runs can prepend a one-shot startup-context block with recent daily memory for that first turn. Bare chat `/new` and `/reset` commands are acknowledged without invoking the model. The startup prelude is controlled by `agents.defaults.startupContext`. Post-compaction AGENTS.md excerpts are separate and require explicit `agents.defaults.compaction.postCompactionSections` opt-in.
0 commit comments