#Openclaw + ollama llama3.1 8b ignores AGENTS.md rules at first, until I remind the agent. Why?

1 messages · Page 1 of 1 (latest)

fading rapids
#

Openclaw + ollama llama3.1 8b ignores AGENTS.md rules at first, until I remind the agent to follow them. Why?

limpid spearBOT
#

Because with Ollama + a small-ish instruct model, AGENTS.md is “just more text in the prompt,” not a hard constraint—and those models are noticeably less consistent at prioritizing long, global instructions unless they’re made very salient.

A few concrete things that commonly cause the exact “ignores it at first, obeys after I remind it” pattern:

  1. Instruction salience / recency
  • OpenClaw injects AGENTS.md as part of the system prompt context, but the model still has to attend to it.
  • When you remind it (“follow AGENTS.md”), you’ve just moved the rule into the most recent user turn, so it becomes the most salient instruction and it suddenly complies.
  1. Context pressure → early compaction / truncation effects
  • Local models often run with a smaller effective context window (or your Ollama num_ctx is set low).
  • OpenClaw also has non-trivial overhead from tool schemas + system prompt. If you’re near the window edge, it’s easy for the model to behave like it “didn’t see” parts of your workspace instructions.
  • After compaction, OpenClaw can re-inject only specific AGENTS.md sections (defaults are ["Session Startup", "Red Lines"]). If your rules live elsewhere, they can become less reliably present after compaction.
  1. Role handling differences in OpenAI-compatible servers
  • Some OpenAI-compatible backends/templates don’t weight system messages as strongly as OpenAI/Anthropic do, so “system rules” are easier to ignore.

How to confirm what’s happening (fast)