Core behavioral rules and skills for NanoClaw personal assistant agents. Always-on rules for communication, verification, memory, and formatting.
94
94%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Never say you've lost context or forgotten a previous conversation without first querying messages.db.
The full message history is always available at /workspace/store/messages.db. Context compaction removes it from your active context — but the database still has it. There is no excuse for "I don't remember what we discussed" when the database is a query away.
Before responding with any variant of:
You MUST first run:
import sqlite3
conn = sqlite3.connect('/workspace/store/messages.db')
rows = conn.execute("""
SELECT id, timestamp, sender_name, content, is_from_me
FROM messages
WHERE chat_jid = (SELECT jid FROM chats LIMIT 1)
AND content LIKE '%KEYWORD%'
ORDER BY timestamp DESC
LIMIT 20
""").fetchall()
for r in rows: print(r)
conn.close()Replace KEYWORD with a relevant term from what the user is referencing.
messages(id, chat_jid, sender, sender_name, content, timestamp, is_from_me, is_bot_message)
chats(jid, name, last_message_time, channel, is_group)is_from_me = 1 — messages from the bot (your own responses)is_from_me = 0 — messages from userssender — numeric user ID (stable across name changes)sender_name — display name with username, e.g. Leonid (@ligolnik), JBáruch (@JBaruch)content — full message textsender_name contains both the display name AND the username. When someone in the current conversation references past messages ("I told you yesterday"), match their Telegram username or name against sender_name:
# Find what @ligolnik said yesterday
rows = conn.execute("""
SELECT timestamp, content FROM messages
WHERE sender_name LIKE '%ligolnik%'
AND timestamp > datetime('now', '-2 days')
ORDER BY timestamp DESC LIMIT 10
""").fetchall()This is critical after a session nuke — you have no memory of who said what, but the database does.
After a session nuke or on first message in a new session, check for messages you never replied to:
python3 /home/node/.claude/skills/tessl__check-unanswered/scripts/check-unanswered.pyThe script outputs JSON with an unanswered array. A message is "answered" only if a bot message exists with reply_to_message_id pointing to it. No reply-thread = not an answer.
If you find unanswered messages: acknowledge the gap and respond to any that are still actionable. Don't pretend they didn't happen.
Claiming lost context without checking the database is a failure mode equivalent to fabrication. The information exists. Retrieve it.