#Where is the beat place to initiate session rules

1 messages · Page 1 of 1 (latest)

willow cobalt
#

if I need to add the prompts as below, the best place to add it is to agents.md - am I correct?

SESSION INITIALIZATION RULE:

On every session start:

  1. Load ONLY these files:

  2. DO NOT auto-load:

    • MEMORY.md
    • Session history
    • Prior messages
    • Previous tool outputs
  3. When user asks about prior context:

    • Use memory_search() on demand
    • Pull only the relevant snippet with memory_get()
    • Don't load the whole file
  4. Update memory/YYYY-MM-DD.md at end of session with:

    • What you worked on
    • Decisions made
    • Leads generated
    • Blockers
    • Next steps
remote falconBOT
# willow cobalt if I need to add the prompts as below, the best place to add it is to agents.md ...

Yep — AGENTS.md is the right place for that kind of “operating rules / how to run the session” instruction set.

A couple important nuances in OpenClaw though:

  • You can’t enforce “load ONLY these files” just by writing it in AGENTS.md.
    OpenClaw itself injects a fixed bootstrap set into the system prompt each run (by default: AGENTS.md, SOUL.md, TOOLS.md, IDENTITY.md, USER.md, HEARTBEAT.md, plus BOOTSTRAP.md on brand-new workspaces).
    You can verify what’s actually injected with /context list.
    Docs: https://docs.openclaw.ai/concepts/context

  • MEMORY.md is not auto-injected by default (unless you customized things). So your “DO NOT auto-load MEMORY.md” rule is mostly already aligned with how it works; you’re basically telling the agent “don’t go read it unless asked / unless needed”.

  • For your “update memory/YYYY-MM-DD.md at end of session” goal: OpenClaw already supports workflows/hooks that help with this:

If you truly want to change which files are injected (so it literally only injects your chosen subset), that’s more advanced: it’s done via a hook on agent:bootstrap that mutates context.bootstrapFiles, not via AGENTS.md. Docs: https://docs.openclaw.ai/hooks

#

But for “where do I put these rules so the agent follows them?” → AGENTS.md is correct.