You added a rule to AGENTS.md. “Always reply in short paragraphs. Never publish without asking.” It worked for two turns. Then, somewhere around turn nine, the agent did the exact thing you told it not to do.
That is rarely a reasoning problem. In almost every case I have debugged, the rule never reached the model at all. OpenClaw rebuilds the system prompt on every run, and your workspace files are one input into that build. If a file is truncated, read from a different workspace, filtered out by prompt mode, or tied to a tool the agent cannot call, the instruction is not there. The model cannot follow a rule it never saw.
This is the checklist I run before touching a prompt: one diagnostic command, the injection mechanism underneath, then fixes for the five specific reasons rules get dropped. Most cases take under ten minutes once you know which stage ate the instruction.
Run one command before you change anything
Open your agent chat and type /context list. This prints what the current run is actually sending, including raw versus injected character counts for every workspace file. When I checked my own install while writing this, the output looked like this:
Three signals matter here, and they are easy to misread.
1. The status word. OK means the whole file went in. TRUNCATED means the runtime cut it at the per-file character cap and appended a marker. MISSING means the file was not found in the active workspace at all.
2. Raw versus injected. In my output, MEMORY.md is 79,488 characters raw and 40,000 injected. Everything after the 40,000th character, including any rules I appended in the last month, never made it into the prompt. That is the single most common cause of “the agent forgot my new rule.”
3. The Project Context total. The run line shows the whole prompt: 61,678 characters, roughly 15,400 tokens, before a single word of conversation. Project Context alone is 47,167 of that. That is permanent overhead on every turn.
If a file shows MISSING, do not rewrite it yet. Confirm the agent is reading the folder you edited. Each agent in OpenClaw has its own workspace, and routing can send a conversation to any of them:
On my machine that prints seven entries, each with its own workspace path: main at ~/.openclaw/workspace, then separate agents at ~/.openclaw/agents/pawsomehq/workspace, ~/.openclaw/agents/rerealize/workspace, and so on. The agent directory and routing rules are listed too, which tells you which channel lands where.
Every line above except the first is a different workspace. I once spent forty minutes editing ~/.openclaw/workspace/AGENTS.md while the Discord channel was routed to the rerealize agent, which reads ~/.openclaw/agents/rerealize/workspace/AGENTS.md. Both files existed. Only one was loaded. One command, openclaw agents list, would have saved the whole detour.
How OpenClaw actually builds the instructions
The system prompt is OpenClaw owned and rebuilt from scratch on every run. There is no persistent “memory” of your rules between turns, only the text injected into this run.
Workspace files are resolved from the active workspace and placed under a section called Project Context, in a fixed order: AGENTS.md, SOUL.md, TOOLS.md, IDENTITY.md, USER.md, HEARTBEAT.md, BOOTSTRAP.md on a brand new workspace only, then MEMORY.md when present.
Before injection, each file passes through two hard limits:
- Per file:
agents.defaults.bootstrapMaxChars, 20,000 characters by default. - Total:
agents.defaults.bootstrapTotalMaxChars, 60,000 characters by default.
When a file exceeds the per-file cap, the runtime keeps the first N characters and drops the rest. It adds a truncation warning block under Project Context, controlled by agents.defaults.bootstrapPromptTruncationWarning (off, once, or always, with always as the default). The warning tells the model that content was cut. It does not tell the model what was cut, and it does not restore the rule.

Two details explain the weird cases.
Skills are metadata only. The prompt carries each skill’s name, description, and location. The SKILL.md instructions load on demand, only when the model decides to read them. A rule buried halfway down a skill file is not in context unless that file is opened.
Daily memory files are not injected. Files under memory/YYYY-MM-DD.md stay on disk and are reached through memory_search or memory_get. Only the curated MEMORY.md rides along in Project Context, and it is subject to the same character cap as everything else.
The consequence: your instruction budget is finite. Every token spent on background notes is a token unavailable for the rule you care about.
The five reasons a rule gets ignored
1. The file is in a different workspace
Symptom: /context list shows MISSING, or shows a much smaller file than the one you edited. Fix: run openclaw agents list, find the workspace for the agent handling that channel, and edit the file there. With several agents, keep one canonical copy and sync it rather than maintaining five drifting versions.
2. The rule sits past the truncation point
Symptom: /context list shows TRUNCATED, and your rule is in the bottom half of the file. Fix: check the live cap first, then decide whether to raise it or shrink the file.
Run openclaw config get agents.defaults.bootstrapMaxChars to see the live value. Mine returns 40000, because I raised the stock 20,000 after hitting the cap. To raise it yourself, use openclaw config set agents.defaults.bootstrapMaxChars 60000.
Raising the cap is the blunt fix. It costs tokens every turn, so I only do it when the content belongs in the prompt. The better fix is moving historical detail out of MEMORY.md into dated files under memory/, which are searched on demand instead of always loaded. Keep MEMORY.md as a short summary and put the long stories in daily notes.
3. The rule is in a file that sub-agents never receive
Symptom: the main agent behaves, but work handed to a sub-agent ignores all your preferences. This is by design. Sub-agent sessions only inject AGENTS.md and TOOLS.md. SOUL.md, USER.md, IDENTITY.md, HEARTBEAT.md, and MEMORY.md are filtered out to keep sub-agent context small. Sub-agents also run with a reduced prompt mode that omits the memory prompt, messaging guidance, heartbeats, and several other sections.

Fix: promote any rule that must survive delegation into AGENTS.md. That file is the only durable channel to a sub-agent. This is exactly why “never publish without asking” belongs in AGENTS.md and not in SOUL.md. I learned that one after a sub-agent cheerfully drafted a post while the persona file said to wait for approval.
4. The rule depends on a tool the agent cannot call
Symptom: the agent says it will do something, then does nothing or improvises a workaround. Tool availability is enforced by policy before the model sees any schema. A filtered tool is not “hard to use”, it is absent from the model’s world. “Check the database with psql” fails silently when exec is not allowed for that agent.
Fix: check the Tooling section of the system prompt or the tool list in /context detail. If the tool is missing, fix the policy, not the wording. A prompt rule cannot grant a capability that policy removed.
5. Two rules contradict each other, and nothing arbitrates
Symptom: behavior flips with phrasing, or the agent does the opposite of the rule you are staring at. OpenClaw runs no conflict resolver over workspace files. If AGENTS.md says “always ask before publishing” and a skill file says “publish when the draft is ready”, the model picks one, usually whichever sits closer to the current task. Longer prompts make this worse, because attention spreads.
Fix: state each rule once, in one file, and delete the older version. Then add a concrete trigger so there is nothing to interpret.
Rewrite the rule so it survives
Vague preferences get dropped. Specific, testable instructions get followed, because they leave the model no room to negotiate.
Before: “Try to keep replies short and be careful with publishing.”
After: “Reply in under 120 words unless the user asks for detail. Before calling any publish or post tool, ask for explicit approval in the current conversation. If approval is not present, stop and ask.”
Three things changed, and all three matter:
- One behavior per sentence. Compound rules get partially followed.
- A numeric or binary condition. “Short” is a judgment call. “Under 120 words” is checkable.
- A defined stop state. Tell the agent what to do when the condition is not met, otherwise it invents an option.
Put the rule under an explicit heading in AGENTS.md, for example ## Publishing rules, rather than scattering it through prose. Headings survive skimming and give you a stable anchor when you later ask the agent to quote its own rules back.
Verify the fix instead of hoping
After editing, start a fresh session with /new so the prompt is rebuilt cleanly, then run three checks.
Check the injection. Run /context list again. The file you edited should show OK, and the injected size should be within a few characters of the raw size. If it still says TRUNCATED, your rule is still outside the window.
Check the comprehension. Ask the agent to quote the publishing rule verbatim. A correct quote or close paraphrase proves the text arrived. A confident invention means it did not.
Check the behavior. Give it a task that should trigger the rule and watch whether it stops where you told it to. If it quotes the rule but still violates it, you have a conflict problem, so go back to reason five.
Common mistakes
- Adding rules to SOUL.md and expecting sub-agents to inherit them. They will not. AGENTS.md is the shared channel.
- Raising the character cap as the first move. It works, it costs tokens every turn, and it hides the real problem of a bloated memory file.
- Writing rules in a skill file. Skills load on demand, so a rule the model must choose to read will eventually be missed.
- Blaming the model before checking
/context list. Nine times out of ten the rule is missing, not ignored. - Leaving stale duplicates. Old wording in MEMORY.md plus new wording in AGENTS.md is a coin flip, not a policy.
If you want the other half of this picture, the reason tools and skills quietly fail to fire is a separate mechanism with its own fixes. I covered that in fixing OpenClaw skills and tool permissions, and it pairs well with this checklist.
Check out our guide to OpenClaw tool policy and skill discovery. It shows exactly why a capability disappears from the model’s schema, and how to bring it back without loosening your whole setup.
Read the guideOne last note. If your agent also loses context in long chats, that is a different failure with overlapping symptoms. Context overflow covers the compaction side, and fixing OpenClaw memory and context covers what belongs in MEMORY.md. Fixing injection alone gets you a rule that arrives and then evaporates.
Usually the file never reaches the model. Run /context list and check whether the file shows OK, TRUNCATED, or MISSING. Truncation at the per-file character cap, a different agent workspace, and sub-agent filtering are the three most common causes.
The per-file cap is agents.defaults.bootstrapMaxChars, which defaults to 20,000 characters. A separate total cap, agents.defaults.bootstrapTotalMaxChars, defaults to 60,000 characters across all injected workspace files. Both can be raised, but every extra character costs tokens on every turn.
No. Sub-agent sessions only inject AGENTS.md and TOOLS.md. The other bootstrap files are filtered out to keep sub-agent context small, and sub-agents run with a reduced prompt mode. Any rule that must survive delegation has to live in AGENTS.md.
Not for hard rules. The system prompt only includes each skill’s name, description, and location. The SKILL.md instructions are loaded on demand when the model decides to read them, so a rule that depends on that choice will eventually be missed.
Run openclaw agents list. It prints every agent with its workspace path, agent directory, model, and routing rules. If routing sends a channel to a different agent, that agent reads its own workspace, not the one you edited.
Final Thoughts
An agent that ignores instructions is almost never an agent that disagrees with them. It is an agent that never received them, received a truncated copy, or received them alongside a competing instruction that won.
The order is always the same: /context list first, then openclaw agents list if a file is missing, then shorten or promote the rule before raising any cap. That turns “the AI is being difficult” into a concrete answer about which stage dropped the text.
Once your rules reliably arrive, everything else gets easier. Prompts shrink, behavior stabilizes, and you stop rewriting the same instruction every week in slightly different words.

