Most AI assistants start fresh each session. They read their instructions, follow them, then forget everything.
Mine doesn’t. It maintains its own documentation, reviews it daily, and proposes improvements.
The Core Idea
My AI assistant (ClawdBot) wakes up each session by reading workspace files:
AGENTS.md– its operating instructionsSOUL.md– personality and voiceUSER.md– who I am, what I preferTOOLS.md– local configuration (Telegram topic IDs, RSS feeds, routing rules)MEMORY.md– long-term memorymemory/YYYY-MM-DD.md– daily logs
These files evolve. When I say “remember this,” it updates them. When it learns something, it writes it down.
The problem: over time, these files accumulate inconsistencies, outdated info, and redundancies.
The self-optimisation loop: A daily cron job where the agent reviews its workspace and proposes fixes.
What the Loop Looks For
Every evening at 22:00, ClawdBot runs a self-audit:
Inconsistencies – Does
TOOLS.mdreference a deleted Telegram topic? DoesMEMORY.mdcontradictUSER.md?Outdated information – Are there tasks from weeks ago that never happened? Preferences that changed?
Redundancies – Is the same rule written in three different places? Can it be consolidated?
Missing context – Are there unexplained abbreviations? Incomplete instructions?
Optimization opportunities – Could this workflow be simplified? Is there a pattern it should automate?
Example output:
🔍 Daily Self-Review (2026-02-15)
Potential improvements found:
1. HEARTBEAT.md still mentions checking email, but we moved
that to a dedicated cron job (every 2h, 07:00-21:00).
Remove from HEARTBEAT.md?
2. MEMORY.md has 3 different rules for categorizing Uber
transactions. Consolidate into one rule?
3. TOOLS.md lists topic ID 27 but we deleted that topic
last week. Remove from routing table?
Approve all? [y/n]
I reply “y” or selectively approve. The agent updates the files, commits the changes, and moves on.
Why Telegram Topics Matter
I route all automation outputs to a Telegram group with forum topics:
ClawdBot group:
├─ 📋 Tasks & Projects (GTD rituals)
├─ 📬 Notifications & Alerts (Gmail checks)
├─ 🛠️ System & Admin (self-optimisation, disk space)
├─ 🏃 Health & Fitness (Apple Health summaries)
├─ 📰 News & Updates (RSS digest)
├─ 📝 Blog (davletshin.com drafts)
└─ 💰 Finance (spend tracking, budgets)
Why not just one chat?
Each topic is a focused conversation context:
Token efficiency: When I’m in the Finance topic discussing spend patterns, the session context doesn’t include unrelated GTD tasks or health data. This saves thousands of tokens per conversation.
Bi-directional feedback: Each topic is a feedback loop. The agent posts a report → I reply with corrections/questions → It learns and updates its files → Next report is better.
Context persistence: When I open the Health topic, I see the last 4 weeks of fitness summaries. Pattern recognition becomes trivial. When I ask “why did my step count drop?”, the agent has immediate context.
Parallel workflows: GTD ritual runs at 21:30. News digest runs at 21:00. AWS checks run Wednesdays. Each has its own conversation thread, no cross-contamination.
Example: In the Finance topic, we’ve had a 3-week conversation about bank statement categorization. The agent learned 200+ merchant patterns through iterative feedback. If that conversation happened in the main chat mixed with GTD tasks and news, both contexts would be polluted and token costs would be 3-4x higher.
Implementation
Daily self-review cron job (see why cron reliability matters):
{
"schedule": {
"kind": "cron",
"expr": "0 22 * * *",
"tz": "Europe/London"
},
"payload": {
"kind": "agentTurn",
"message": "Review AGENTS.md, TOOLS.md, MEMORY.md, and recent memory/*.md files. Look for inconsistencies, outdated info, redundancies. Propose specific edits. If nothing needs fixing, reply HEARTBEAT_OK."
},
"delivery": {
"mode": "announce",
"channel": "telegram",
"threadId": "26"
}
}
Routes to System & Admin topic (26). If it finds issues, I get a proposal. If not, silence.
The review process:
- Read workspace files
- Compare recent daily logs with long-term memory
- Cross-check instructions with actual behavior
- Generate specific edit proposals (old text → new text)
- Wait for approval
- Apply changes, commit, push
What makes this work:
Specific edits, not vague suggestions. It doesn’t say “HEARTBEAT.md might be outdated.” It says “Remove email checking from HEARTBEAT.md line 5 (now handled by cron job ‘Email Check - Every 2h’).”
Approve/reject per item. I can approve some proposals and reject others.
Commits are atomic. Each accepted change gets its own commit with a clear message.
Why This Matters
Traditional AI assistants are stateless. They follow static instructions, never evolving.
This approach makes the AI self-maintaining:
- When I change a preference, it updates its own documentation
- When a workflow becomes outdated, it proposes removal
- When I give conflicting instructions, it catches the conflict and asks for clarification
The result: an assistant that gets more accurate over time, not less.
The Broader Pattern
This isn’t just about AI. It’s about self-improving systems:
- Capture state (workspace files)
- Observe behavior (daily logs)
- Detect drift (inconsistencies, outdated rules)
- Propose fixes (specific edits)
- Apply feedback (human approval)
- Repeat
The same pattern works for:
- Documentation (review docs against codebase)
- Process documents (review SOPs against actual practice)
- Configuration files (review against current usage)
Any system that accumulates state over time needs a self-audit loop.
Current Status
The self-optimisation loop runs daily. In the past week it’s:
- Moved email checking from HEARTBEAT.md to dedicated email pipeline cron job (detected duplicate work)
- Consolidated 8 duplicate bank categorization rules in
MEMORY.md - Updated RSS feed priority in
TOOLS.mdafter adding New Scientist - Fixed 2 contradictions between
USER.mdand recent daily logs
Average review time: 30 seconds. Token cost: ~2,000 tokens/day.
The ROI: an assistant that stays accurate without manual maintenance.
Sometimes the best automation is teaching the system to fix itself.
Related: The Silent Killer in AI Automation — on verifying your cron jobs are actually doing what you think. And Your AI is Only as Smart as Its Brain — on why the model underneath everything changes what’s possible.