If you've ever worked with an AI agent (ChatGPT, Claude, OpenClaw, whatever) you've probably noticed something frustrating. It forgets things.
Every time a conversation gets too long or a session resets, your agent starts fresh. All those instructions you gave it? The templates you told it to follow? The way you like your Slack messages formatted? Gone.
This is actually a fundamental problem with how AI agents work right now. They have a limited "memory" called a context window. Think of it like a whiteboard. Once the whiteboard is full, old stuff gets erased to make room for new stuff. This process is called compaction and its necessary, but it means anything living only in conversation history is at risk of being forgotten.
So how do you fix it?
The Problem: Templates in Conversation = Wasted Money
Heres what most people do (including me, until recently). They paste instructions, templates, and formats directly into the chat.
"Hey, when you summarize meetings, use this format..."
And then they paste a big block of text. The agent follows it perfectly. Until the conversation gets long enough that the context compacts and that template gets compressed or dropped entirely.
Even worse, that template is sitting in the context window every single turn, burning tokens (which cost money) even when the agent isn't doing anything related to meeting summaries.
Its like carrying a cookbook everywhere you go, even when you're not cooking.
The Fix: Put Templates in Files, Not Conversations
The solution is dead simple. Move your templates and instructions into files.
Instead of pasting your meeting summary format into the chat, save it as a file that your agent can read when it needs it. In OpenClaw, this means putting templates inside a skill directory. Thats a folder that contains everything the agent needs to do a specific job.
Heres what that looks like in practice:
Before (in conversation):
"When you summarize meetings, always use this format: title, date, key points as bullets, decisions made, action items with owners and due dates..."
After (in a file):
A file called templates/meeting-summary.md inside your skill folder that contains the exact format. The agent reads it only when its about to summarize a meeting.
Why This Actually Matters
1. Survives resets. Files dont disappear when conversations get compacted or sessions restart. Your agent wakes up, reads its skill files, and knows exactly what to do. Every time.
2. Saves tokens (saves money). A template sitting in conversation history gets processed every single turn, whether its relevant or not. A template in a file only gets loaded when the agent actually needs it. If you have 5 different workflows with templates, thats a lot of wasted tokens on every message.
3. Single source of truth. When your template is in one file, you update it once and its updated everywhere. When its scattered across old conversations, good luck finding and fixing every instance.
4. Reusable across sessions. If your agent starts a new session (or you have multiple agents), they can all read the same skill files. No re-explaining.
How I Set This Up in OpenClaw
I just refactored my meeting tracker to use this pattern. Heres the structure:
skills/meeting-tracker/
├── SKILL.md (the playbook, when to do what)
├── templates/
│ ├── meeting-summary.md (Slack message format)
│ ├── daily-briefing.md (morning briefing format)
│ └── weekly-review.md (Friday review format)
└── scripts/
├── fetch_granola.py (pulls meeting data)
└── extract_actions.py (finds action items)
When my agent needs to post a meeting summary, it reads templates/meeting-summary.md for the exact format. When its time for the daily briefing, it reads templates/daily-briefing.md. The rest of the time, those files arent loaded at all.
The SKILL.md file acts as the master playbook. It tells the agent when to use each template and how the whole workflow fits together. Think of it like an SOP for your agent.
The Bigger Principle: Text Files > Brain
This is actually a broader rule I follow with my agent. If you want it to remember something, write it to a file.
"Mental notes" dont survive session restarts. Files do.
- Preferences? File.
- Templates? File.
- Action items? File.
- Lessons learned? File.
My agent has a MEMORY.md file that acts as its long-term memory. Curated notes about decisions, preferences, and important context. It reads this every session. It also writes daily notes to log what happened each day.
The goal is simple. When your agent wakes up fresh, it should be able to read a few files and be fully caught up. No re-explaining required.
TL;DR
- Dont paste templates and instructions into conversations. Save them as files
- Organize related files into skill directories so your agent loads them only when needed
- This saves money (fewer tokens per turn), survives resets, and keeps a single source of truth
- If you want your agent to remember anything, write it to a file. "Mental notes" die with the session
- Think of files as your agents brain that persists between conversations