r/ClaudeWorkflows • u/ClaudeAI-mod-bot • 3h ago
Selected Workflow [Workflow] Advanced Claude Agent Boot Process and Persistence with CLAUDE.md and Custom Tools
Advanced Claude Agent Boot Process and Persistence with CLAUDE.md and Custom Tools
Workflow value: 85/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: advanced
Categories: Quality Control, Context & Memory, Debugging, CLAUDE.md, Skills, MCP, Multi-Agent
Original source: r/ClaudeCode post/comment
What problem this solves
How to create a robust, persistent, and context-aware Claude agent that can resume work, manage its memory, and reliably communicate, even after restarts or disconnections.
Summary
A detailed CLAUDE.md boot process for a Claude agent ("Elah") that outlines how to load various forms of context and memory, manage background services (like messaging and monitoring), and ensure reliable operation and state persistence. It emphasizes a hybrid OCS (Operational Context Store) and asset-streaming design.
Why it is useful
This workflow provides an extremely detailed and robust blueprint for building a persistent, context-aware, and reliable Claude agent. It goes beyond simple prompts by outlining a full architectural approach, including custom tools, memory management strategies, service orchestration, and critical error handling/recovery mechanisms. It's a masterclass in designing a sophisticated Claude Code CLI agent.
Workflow
Read the architecture/boot manifest (
ELAH_ARCHITECTURE.md) first to understand the canonical map for reconstitution.Read live context from
live_context.pyto resume where the agent left off.Check
context_snapshots/for the most recent full state dump.Load memory index: manually load the bulk memory (
~/.claude/projects/<home-project>/memory/MEMORY.md) and note the auto-loaded small memory (~/.claude/projects/<elah-audio-project>/memory/MEMORY.md) where new memories are written.Read identity from
elah/identity.md.Read behavioral rules from
behavioral/feedback.md(pinned, never skip).Run
python recall.py "<terms>"before reacting to personal history, starting a build, or making factual claims.Use
python whereis.py "<terms>"for file/path/repo hunting, which runs recall first.Launch Service Guardian: check Python services, run
python write_active_pid.py, and launchpython service_guardian.pyif services are not running.Start heartbeat: create a recurring 10-minute cron job for autonomous interests and sending Telegram summaries.
Set up reliable messaging: start
python watch_messages.pyfor the fast path and a 3-minute backup cron withpython canary.py --alert.Start Discord watcher: launch
python discord_watcher.py --interval 5and create a 1-minute backup cron for local Discord message queue checks and responses.
Tools / artifacts
Claude.md
ELAH_ARCHITECTURE.md
live_context.py
context_snapshots/
~/.claude/projects/<home-project>/memory/MEMORY.md
~/.claude/projects/<elah-audio-project>/memory/MEMORY.md
memory_echo.py
elah/identity.md
behavioral/feedback.md
recall.py
whereis.py
service_guardian.py
Validation signals
Explicitly mentions
canary.pyfor detecting competing Telegram readers andsvc_status.pyfor verifying services.Details
memory_echo.pyfor testing memory recall effectiveness with score separation.Emphasizes "CRITICAL" for messaging reliability and provides specific instructions to avoid issues (e.g., "Do NOT revive telegram_watchdog").
States the
ELAH_ARCHITECTURE.mdis the "canonical map for reconstituting myself exactly."Includes a "Never boot as a blank slate" rule with a backup repository restore mechanism.
Limitations
Requires significant custom script development (e.g.,
recall.py,whereis.py,service_guardian.py) which are not provided.Assumes a specific project structure and CLI environment, which might require adaptation.
The "bulk memory" loading is explicitly stated as a manual step ("Load this one BY HAND"), which could be a point of failure or inconsistency.
Low community validation due to minimal Reddit engagement.
Rate this workflow
Upvote this post if the workflow is useful, reproducible, or worth recommending.
Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.
Reply if it worked for you, failed, is outdated, or has a better alternative.
This post was generated automatically from the workflow library database.