How letta-ai/claude-subconscious works
Claude Subconscious is a Claude Code plugin that runs background hooks to share session context with a persistent Letta agent and surface guidance back to Claude. The main loop starts or reuses a Letta conversation, reads and formats transcript updates, sends them asynchronously through the Letta Code SDK, then injects agent messages or memory updates before prompts and tool use. The README also documents agent setup and model selection, shared cross-project memory, and agent access to code and web tools. Some hook wiring and implementation details are not shown in the excerpts; unsampled relationships are omitted.
Main entry points: session_start.ts Session start · send_messages_to_letta.ts Transcript sender · sync_letta_memory.ts Prompt memory sync · pretool_sync.ts Pre-tool updates
Components 14
Claude hooks
- Session start
scripts/session_start.ts - Transcript sender
scripts/send_messages_to_letta.ts - Prompt memory sync
scripts/sync_letta_memory.ts - Pre-tool updates
scripts/pretool_sync.ts
Session and state
- Transcript parsing
scripts/transcript_utils.ts - Conversation and state utilities
scripts/conversation_utils.ts - Local session state
scripts/conversation_utils.ts
Letta integration
- Agent configuration
scripts/agent_config.ts - API URL builder
scripts/letta_api_url.ts - Letta service
Background agent
- SDK worker
scripts/send_worker_sdk.ts - Letta Code SDK
- Code and web tools
Other components
- Claude Code
Connections 23
- Claude Code → Session start: starts session
README.md - Claude Code → Transcript sender: provides transcript
README.md - Transcript sender → Transcript parsing: reads and formats
scripts/send_messages_to_letta.ts - Transcript sender → Conversation and state utilities: gets conversation
scripts/send_messages_to_letta.ts - Transcript sender → Local session state: loads and saves
scripts/send_messages_to_letta.ts - Session start → Conversation and state utilities: creates or reuses
scripts/session_start.ts - Session start → Local session state: maps session
README.md - Transcript sender → SDK worker: spawns worker
- SDK worker → Letta Code SDK: resumes session
scripts/send_worker_sdk.ts - Letta Code SDK → Letta service: sends agent messages
README.md - Agent configuration → API URL builder: builds requests
scripts/agent_config.ts - Session start → Agent configuration: resolves agent
scripts/session_start.ts - Session start → Letta service: notifies agent
README.md - Prompt memory sync → Agent configuration: resolves agent
scripts/sync_letta_memory.ts - Prompt memory sync → Local session state: loads and saves
scripts/sync_letta_memory.ts - Prompt memory sync → Letta service: fetches updates
README.md - Prompt memory sync → Claude Code: injects guidance
README.md - Pre-tool updates → Agent configuration: resolves agent
scripts/pretool_sync.ts - Pre-tool updates → Local session state: loads and saves
scripts/pretool_sync.ts - Pre-tool updates → Letta service: checks updates
README.md - Pre-tool updates → Claude Code: injects updates
README.md - Letta Code SDK → Code and web tools: invokes tools
README.md - Letta service → Claude Code: whispers guidance
README.md