CLAUDE.md - Session Knowledge Persistence
Last Updated: 2026-01-17 Session Context: Anemoi A2A Research Integration Purpose: Persistent memory across future agent instances
Research Summary: Anemoi A2A Communication Patterns
Question Under Investigation
Does Anemoi's A2A structured direct communication offer better context transfer than current file-based (CONTEXT.md) + webhook + Redis approach for terminal agent session orchestration?
Answer (from Perplexity Research)
Yes, but with nuance: Anemoi A2A provides real-time coordination for multi-session scenarios. However, for fork/resume context inheritance, Agent Continuations (Snaplogic) is lower-friction entry point.
Key Findings Extracted from Research
1. Anemoi Architecture (Thread-Based Communication)
MCP Server Primitives:
list_agents()→ Discover available agentscreate_thread(P_0)→ Initialize conversation contextsend_message(τ, msg)→ Broadcast/directed messagewait_for_mentions(τ)→ Block until mentioned (real-time awareness)close_thread(τ)→ Terminate with outcome logging
Performance: +9.09% on GAIA benchmark vs centralized approaches (OWL, CAMEL, AutoGen)
2. Recommended Implementation Phases
| Phase | Pattern | Effort | Solves | Status |
|---|---|---|---|---|
| 1 | Agent Continuations | 1-2 wks | Fork context loss | Not Started |
| 2 | Anemoi A2A | 3-4 wks | Multi-session coordination | Not Started |
| 3 | Semi-centralized | 8-12 wks | Full architecture | Defer |
3. Trade-Off Analysis: Context Transfer Methods
| Method | Latency | Multi-Session | Token Overhead | CLI Support | Effort |
|---|---|---|---|---|---|
| File-based (Now) | 50-200ms | Eventual | High | Native | 0 |
| Continuations | 0ms | Manual poll | Very Low | Native | 1-2 wks |
| Anemoi A2A | 5-20ms | Real-time | Very Low | Needs wrapper | 3-4 wks |
Infrastructure Checkpoint: Current State
Session Lifecycle (newsessionuuid)
- UUID generation + namespace + MCP configs
- Launcher script generation:
LAUNCH__session_id_<namespace>_<timestamp>.sh - Output to _env.sh with resume/fork aliases
Pre-Launch Context Agent (miette_newsession_context.sh)
- Haiku model analyzes session intentions
- Creates CONTEXT.md (FILE-BASED ← bottleneck)
- Langfuse trace with metadata
- Redis cache entry
Session Observability (v2_claude_hooks)
- Pre/post tool execution hooks
- Langfuse trace instrumentation
- State in
._langfuse_state
Pain Points Identified
- Context bloat on fork: Child session loses parent semantic continuity
- Pre-launch isolation: Haiku agent cannot query main session about preferences
- Parallel agent coordination: Manual state sync, file-based handoffs
- Hook-to-hook communication: No cross-hook coordination mechanism
Self-Inquiry Questions (From Research)
Before implementing any phase, answer these:
-
Context loss on fork: What % of parent state is needed by child?
- <20% → File-based sufficient
- 50%+ → Continuations essential
-
Token waste: What % goes to redundant context injection?
- <5% → Redis webhooks acceptable
- >15% → Anemoi threading worthwhile
-
Pre-launch clarification: How often does main session need more from pre-launch?
- Rarely → One-shot acceptable
- >30% → Bidirectional negotiation valuable
-
MCP server maturity: Already running iaip/coaia MCPs?
- Yes → A2A server is low-friction
- No → Requires SDK setup (2-3 days)
-
Shell script integration: Must
LAUNCH__*.shstay in loop?- Yes → Anemoi needs API wrapper
- No → Native support available
Related Files & References
Research Artifacts
/251230-anemoi-a2a-research/CONTENT.md— Full Perplexity research response/251230-anemoi-a2a-research/SYNTHESIS.md— Actionable synthesis/251230-anemoi-a2a-research/251230-Anemoi-Inquiry-PROMPT.md— Research query/251230-anemoi-a2a-research/251230-Anemoi-Inquiry-CONTEXT-ATTACHMENT.md— Infrastructure context
Implementation Scripts
/scripts/fn_llm.sh— newsessionuuid function, Haiku agent patterns/scripts/v2_claude_hooks/— Langfuse instrumentation (draft)/scripts/miette_newsession_context.sh— Pre-launch agent
Structural Tension Charts
chart_1768301874719— Multi-Universe Narrative System (patenting + implementation)- Anemoi implementation phases should become action steps under patenting/implementation
Decision Required
What is the most urgent pain point?
| If... | Then... | Priority |
|---|---|---|
| Fork context loss is blocking work | Start Phase 1 (Continuations) immediately | HIGH |
| Running 3+ parallel sessions often | Prioritize Phase 2 (Anemoi A2A) | MEDIUM |
| Current system "good enough" | Document patterns, defer implementation | LOW |
Notes for Next Session
- Anemoi GitHub: https://github.com/Coral-Protocol/Anemoi
- Internal fork: https://github.com/miadisabelle/mia-anemoi
- Related: Agent Continuations (Snaplogic), SagaLLM (arXiv:2503.11951), MCP-Zero (arXiv:2506.01056)
- Consider accountability alignment ceremony before Phase 1 implementation
- Medical Wheel integration point: East (vision) → Phase identification, South (growth) → embodied testing, West (reflection) → decision-making, North (wisdom) → pattern documentation
Next Actions
- ⏳ Choose priority: Phase 1 (Continuations) vs Phase 2 (Anemoi A2A)
- ⏳ Answer self-inquiry questions above
- ⏳ Create STCs for chosen phase(s)
- ⏳ Set up accountability ceremony using medicine-wheel tools
- ⏳ Begin implementation planning