Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Persistent Local Agent Framework Guide

Architecture patterns and templates for building persistent AI agents with Claude Code.

What This Is

A reference guide documenting patterns that emerge when you run an AI agent as a persistent local system — not a one-off chat, but an always-available assistant with memory, scheduled tasks, voice, messaging, and OS integration.

These patterns were developed through months of daily use with Claude Code (Opus/Sonnet, 2026). They're opinionated, practical, and battle-tested. Some details may shift as Claude Code evolves — the architectural patterns should remain relevant.

What This Isn't

  • Not a library or framework. There's no npm install or pip install. This is documentation and templates.
  • Not a tutorial. It assumes you're comfortable with CLI tools, Python, and shell scripting.
  • Not official Anthropic documentation. These are community-developed patterns.

Who This Is For

Developers who are already using Claude Code and want to push it beyond single-session conversations. You want your agent to:

  • Remember context across sessions
  • Run on a dedicated machine (Mac Mini, Linux server, etc.)
  • Integrate with your OS (notifications, calendar, reminders)
  • Communicate through messaging platforms
  • Manage its own tasks and self-improve over time
  • Speak and listen (voice pipeline)

Docs

# Topic What You'll Learn
01 Identity Persona, anchor characters, communication modes
02 Memory Three-layer memory: files, graph DB, context injection
03 Context Management Window strategy, compaction, delegation bias
04 OS Integration launchd, hooks, startup sequence, tmux patterns
05 Voice Pipeline TTS, STT, wake word, push-to-talk
06 Async Relay Messaging bridges, queues, handoff pipeline
07 Skills Skill architecture, slash commands, domain knowledge
08 Safety Permissions, access control, data isolation
09 Task Management File-based tasks, reconciliation, lifecycle
10 Self-Improvement Learnings, reflections, pattern promotion
11 Lessons Learned What worked, what didn't, pitfalls
12 Multi-Agent Patterns Peer agents, message broker, consent gates, dossier study mode
13 Autonomy & Authority Standing orders, authority tiers, async-commitment, the board
14 Backups & Durability rsync snapshots, offsite memory copy, exclusions, verification

Diagrams

Templates

Starter files to bootstrap your own agent:

Where to Start

If you're building from scratch, the recommended order is:

  1. Identity (01) — define who your agent is
  2. Memory (02) — start with file-based state, add layers later
  3. OS Integration (04) — get the tmux loop and startup hook running
  4. Context Management (03) — add threshold warnings before you hit compaction
  5. Safety (08) — set guardrails early
  6. Everything else as needed

Chapters 12–14 are advanced patterns — reach for them only once the core system is solid. Autonomy & authority (13) and backups (14) become relevant as you let the agent act unattended; multi-agent (12) is for the rare case where a second agent earns its place. Don't build these on day one.

See Lessons Learned for a more detailed build order and the reasoning behind it.

Contributing

Issues and PRs welcome. If you've built a persistent agent and discovered patterns not covered here, contributions are appreciated.

License

MIT

About

Architecture patterns for building persistent local AI agents with Claude Code

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages