shynlee04/hivemind-plugin/hm-l3-hivemind-state-reference
Claude Code and agent skill by shynlee04/hivemind-plugin
- community
Checking that the SKILL.md file is still in the repository.
Documents the complete `.hivemind/` state root structure — session continuity, delegation records, event journals, workflow config, planning persistence, and recovery paths. Use when navigating `.hivemind/` directories, reading/writing state files, recovering from interrupted sessions, understanding delegation records, or consuming Hivemind runtime state. NOT for mutating state directly — this is a read-only reference for hm-* agents.
Install
npx vskill@latest install shynlee04/hivemind-plugin/hm-l3-hivemind-state-referenceSKILL.md
Overview
Complete reference for the .hivemind/ state root — the canonical deep module persistence layer defined by Q6 State Root Separation (locked 2026-04-25). All Hivemind runtime state (session journals, delegation records, continuity, planning artifacts) writes to .hivemind/ at project root. .opencode/ is ONLY for OpenCode primitives (agents, commands, skills) — no runtime state is stored there.
This skill is read-only reference for hm-* agents. You consume state, you don't mutate it. For mutation, use the Hivemind tools (delegate-task, delegation-status, session-journal-export, configure-primitive, session-patch).
.hivemind/ Directory Structure
Core State Files — Contracts
1. session-continuity.json — Cross-Session State
Format: ContinuityStoreFile (versioned JSON object)
Schema:
Read contract:
- Deep-clone-on-read via
cloneSessionContinuity()/getSessionContinuity(sessionID)— prevents mutation aliasing - Single-record read:
getSessionContinuity(sessionID)→SessionContinuityRecord | undefined - Bulk read:
listSessionContinuity()→SessionContinuityRecord[] - Always use the read functions through the
continuity.tsmodule — never read the raw file directly
Write contract (for tools only, not agents):
patchSessionContinuity(sessionID, partial)— shallow merge into existing recordrecordSessionContinuity(record)— full upsert- All writes go to
.hivemind/state/session-continuity.json - Write-before-respond: always persist state changes before returning tool results
Recovery paths:
hydrateFromContinuity()— loads all sessions from disk, rehydrates delegation state into in-memory MapsrecoverPending()— called on plugin init, replays delegation polling for sessions not yet terminalreplayPendingNotificationsForEvent(sessionID, eventType)— delivers queued parent-session notifications onsession.createdorsession.updatedevents
2. delegations.json — Delegation Records
Format: Array of Delegation objects (persisted by delegation-persistence.ts)
Schema:
Read contract:
readPersistedDelegations()— reads the full array from disk- Always use through the persistence helper — never read the raw file directly
- File may be empty after pruning (empty array, not missing)
Write contract (tools only):
persistDelegations(delegations: Delegation[])— overwrites the full array- Pruning: when delegations exceed
MAX_DELEGATIONS_BEFORE_PRUNE(50), oldest completed/error records exceedingDEFAULT_PRUNE_MAX_AGE_MS(30 min) are removed
Recovery paths:
- On plugin init:
recoverPending()scans for non-terminal delegations and resumes polling handleSessionIdle(sessionID)— triggered bysession.idleevent, transitions to completedhandleSessionDeleted(sessionID)— triggered bysession.deletedevent, transitions to error with cleanup
3. event-tracker/ — Session Event Journals
Format: One JSON + one Markdown file per session (ses_XXXX.json, ses_XXXX.md)
JSON record:
Read contract:
createEventTrackerArtifactsFromHook()— writes events to.hivemind/event-tracker/- Controlled by
shouldTrackEventTrackerEvent(event)— filters relevant event types - Sessions are identified by the last 4 hex chars of the session ID (e.g.,
ses_2252) - Best-effort audit projection: failures are silently ignored, never block canonical event handling
File naming: ses_{last4hex}{json|md} — both JSON and Markdown versions are generated for each tracked session.
4. config-workflows.json — Workflow Configuration State
Format: Versioned JSON object tracking batch-config workflow progress
Schema:
Read contract:
readWorkflow(id)— reads a single workflow recordadvanceTurn(workflow, turnNumber)— marks a turn as completepersistWorkflow(workflow)— writes updated state to disk
Write contract (tools only):
- Auto-persisted by
configure-primitivetool'stool.execute.afterhook - Best-effort: failures are silently ignored — does not affect the tool call result
5. planning/ — Task Persistence (hm-planning-persistence)
Format: Subdirectories containing task_plan.md, findings.md, and progress.md
Structure:
Read contract:
- These files follow the hm-planning-persistence template format
- Read for cross-session context recovery
- Written by agents using Manus-style file-based planning
6. SESSION-STATE.md — Session State (WAL Protocol)
Format: Markdown with WAL (Write-Ahead Log) protocol
Structure:
Read contract:
- WAL protocol: always read BEFORE responding to maintain context
- Survives context compaction — this is cross-session durable state
- Write-before-respond: update status before returning results
Agent Access Boundaries
| Agent Depth | .hivemind/state/ Read | .hivemind/state/ Write | Notes | |
|---|---|---|---|---|
| L0 (orchestrator) | Full read access | Conditional write via tools | May dispatch sessions, read all state for coordination | |
| L1 (coordinator) | Read current session records | Write via delegation tools only | delegate-task, delegation-status tools proxy writes | |
| L2 (specialists) | Read-only | No direct write | Consume state, don't mutate. Use tools for mutations | |
| L3 (reference) | Read-only | No direct write | This skill level — reference only | |
| Human user | Full read access | Direct .hivemind/ edit (not recommended) | Prefer tool-mediated access |
Anti-Patterns
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingassets/.hivemind/skills/hm-l3-hivemind-state-reference/SKILL.md
Popularity
- Repository stars
- 51
- Repository forks
- 16
- Repository npm downloads, 7 days
- 9
- 7-day trend score
- 27
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 20 Sep 2026, a month ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/shynlee04/hivemind-plugin/hm-l3-hivemind-state-reference)