claude-bot
Persistent Claude Code daemon with long-term memory, intelligent consolidation, and scheduled tasks. One always-on agent session + file-based cron scheduling + memory graph with folder organization.
Install
git clone https://github.com/michaelslain/claude-bot.git
cd claude-bot
bun install
claude plugin marketplace add ./
claude plugin install claude-bot@claude-bot-local
Restart Claude Code, then run /claude-bot:setup to initialize the daemon.
Requirements
- Bun runtime
- Claude Code installed and authenticated
- macOS: launchd (automatic)
- Linux: systemd (automatic)
- Windows: Not yet supported
Usage
Memory tools are available in every Claude Code session via MCP. Talk to Claude naturally or use the tools directly.
Remember & Recall
Save notes to your persistent memory graph:
remember({
name: "react-hooks-rules",
type: "fact",
tags: ["react", "rules"],
content: "Custom hooks must follow Rules of Hooks...",
folder: "projects" // optional, single-level
})
Search all notes or scoped to a folder:
recall({ query: "type:project tag:active" })
recall({ query: "tag:active", folder: "projects" }) // folder scoped
Query syntax: type:, tag:, keyword:, link:, after:, before: (all optional, combine with spaces)
Delete notes:
forget({ name: "projects/old-idea" }) // folder-prefixed
forget({ name: "note" }) // from root
Organizing with Folders
Optional single-level folders organize related notes:
- By project:
projects/auth, projects/api
- By domain:
team/alice, infrastructure/kubernetes
- By time:
daily/2026-05-09, archive/2024
- By topic:
books/, research/, conferences/
Rules:
- Alphanumeric, dash, underscore only:
[a-zA-Z0-9_-]+
- Single-level only (no nesting)
- Backlinks are folder-agnostic (resolve across folders)
remember({
name: "voting-standards",
folder: "moltbook", // creates moltbook/voting-standards
content: "Voting rules for [[decision-making]]..." // links to any folder
})
Cron Jobs
Define recurring tasks as markdown files:
---
name: morning-summary
schedule: 0 9 * * *
model: sonnet
---
Summarize yesterday's notes. What are today's top 3 priorities?
Manage via tools:
cron_create({ name: "daily", schedule: "0 18 * * *", prompt: "Review today" })
cron_list()
cron_run({ name: "daily" })
cron_update({ name: "daily", enabled: false })
Memory Consolidation
The bot automatically consolidates memory hourly (or manually):
dream_run() // trigger consolidation
dream_config({ intervalMs: 3600000 }) // 1 hour
dream_status()
Consolidation merges duplicates, improves clarity, removes stale notes, and respects folder boundaries (never merges across folders).
Examples
Project Knowledge Base
Organize project-specific notes in a folder:
remember({
name: "architecture",
folder: "auth-system",
type: "project",
content: "JWT + refresh rotation pattern"
})
remember({
name: "JWT-tokens",
folder: "auth-system",
type: "fact",
content: "Stateless tokens with exp claim"
})
# Later: search only auth project
recall({ query: "type:project", folder: "auth-system" })
Daily Log
Auto-collected session notes (type: auto) + manual promotion to daily log:
remember({
name: "2026-05-09",
folder: "daily",
type: "daily",
tags: ["completed"],
content: "✓ Shipped feature X\n→ Fix bug Y tomorrow"
})
recall({ query: "type:daily", folder: "daily" })
Team Context
Capture team knowledge with cross-folder links:
remember({
name: "alice",
folder: "team",
type: "person",
tags: ["backend", "lead"],
content: "Lead engineer, owns [[auth-system]]. Async communication only."
})
# auth-system is in projects/ folder — link still works
Memory Graph
Lives at ~/.claude-bot/memory/. Notes are markdown with YAML frontmatter:
---
type: person | project | workflow | fact | preference | daily | auto
tags: [tag1, tag2]
created: 2026-05-08
updated: 2026-05-09
---
Content with [[backlinks]] to other notes.
Backlinks
Notes link to other notes via [[note-name]]. Links are folder-agnostic — a note in any folder can link to any other note by bare name:
[[auth-system]] # links to auth-system in any folder
[[database-design]] # resolves across all folders
Use findBacklinks() to discover all notes referencing a target.
Memory Decay
During consolidation, stale, isolated notes (old dates + no backlinks) are candidates for deletion. Connected notes survive because they're part of the knowledge graph.
Architecture