Problem
The default AGENTS.md template instructs agents to read memory/YYYY-MM-DD.md (today + yesterday) at session startup. However, YYYY-MM-DD is literal text — there is no runtime substitution in the bootstrap/session-startup flow.
The system prompt provides the user's timezone but never the current date. As a result, agents guess the date based on their training cutoff (e.g., Claude Sonnet 4.6 guesses ~July 2025 when the actual date is March 2026).
Where substitution DOES work
memoryFlush prompt — YYYY-MM-DD is replaced with the actual date via replaceAll("YYYY-MM-DD", dateStamp) (confirmed in source)
- Heartbeat — the date is injected in the heartbeat time section
Where it does NOT work
/new — BARE_SESSION_RESET_PROMPT re-reads Session Startup from AGENTS.md, agent sees literal YYYY-MM-DD
/reset — same path
- Post-compaction —
post-compaction-context.ts extracts Session Startup, same literal text
- First session — initial bootstrap, same literal text
Observed behavior
- Agents with many daily notes (e.g., main agent) can work around this by listing
memory/ directory and inferring the date from filenames
- Agents with few or no daily notes guess wrong consistently
- Tested across multiple agents on the same instance — all agents without daily note history fail to determine the correct date
Expected behavior
The current date should be available to agents at session startup, either by:
- Injecting the date into the system prompt (like timezone already is), or
- Performing runtime
YYYY-MM-DD substitution in AGENTS.md at bootstrap, or
- Exposing a
session_status / date tool that agents can call
Environment
- OpenClaw 2026.3.1
- Model: Anthropic Claude Sonnet 4.6
- VPS (Ubuntu), single-agent and multi-agent setup
Problem
The default AGENTS.md template instructs agents to read
memory/YYYY-MM-DD.md(today + yesterday) at session startup. However,YYYY-MM-DDis literal text — there is no runtime substitution in the bootstrap/session-startup flow.The system prompt provides the user's timezone but never the current date. As a result, agents guess the date based on their training cutoff (e.g., Claude Sonnet 4.6 guesses ~July 2025 when the actual date is March 2026).
Where substitution DOES work
memoryFlushprompt —YYYY-MM-DDis replaced with the actual date viareplaceAll("YYYY-MM-DD", dateStamp)(confirmed in source)Where it does NOT work
/new—BARE_SESSION_RESET_PROMPTre-reads Session Startup from AGENTS.md, agent sees literalYYYY-MM-DD/reset— same pathpost-compaction-context.tsextracts Session Startup, same literal textObserved behavior
memory/directory and inferring the date from filenamesExpected behavior
The current date should be available to agents at session startup, either by:
YYYY-MM-DDsubstitution in AGENTS.md at bootstrap, orsession_status/datetool that agents can callEnvironment