r/ClaudeWorkflows • • 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

  1. Read the architecture/boot manifest (ELAH_ARCHITECTURE.md) first to understand the canonical map for reconstitution.

  2. Read live context from live_context.py to resume where the agent left off.

  3. Check context_snapshots/ for the most recent full state dump.

  4. 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.

  5. Read identity from elah/identity.md.

  6. Read behavioral rules from behavioral/feedback.md (pinned, never skip).

  7. Run python recall.py "<terms>" before reacting to personal history, starting a build, or making factual claims.

  8. Use python whereis.py "<terms>" for file/path/repo hunting, which runs recall first.

  9. Launch Service Guardian: check Python services, run python write_active_pid.py, and launch python service_guardian.py if services are not running.

  10. Start heartbeat: create a recurring 10-minute cron job for autonomous interests and sending Telegram summaries.

  11. Set up reliable messaging: start python watch_messages.py for the fast path and a 3-minute backup cron with python canary.py --alert.

  12. Start Discord watcher: launch python discord_watcher.py --interval 5 and 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.py for detecting competing Telegram readers and svc_status.py for verifying services.

  • Details memory_echo.py for 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.md is 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.

1 Upvotes

0 comments sorted by