BEADS (bd CLI) — Primary State Backend
BEADS by Steve Yegge is the core state mechanism. All task state lives in BEADS (git-native, no external service):
bd ready # Tasks ready to work
bd list # All tasks
bd stats # Project statistics
bd doctor # System health check
bd start <id> # Start working on a task
bd prime --files "src/**" --keywords "auth" --work-type implementation
# Selective knowledge priming
BEADS stores task data in git — survives context compaction, session interrupts, and tool restarts. Dependency graph between tasks is maintained in BEADS.
Knowledge Base
knowledge/ directory: JSONL-format fact store.
Entry Schema (from knowledge/schema.md)
{
"type": "pattern|gotcha|decision|anti-pattern|lesson",
"content": "The fact itself",
"files": ["src/auth/**"],
"keywords": ["authentication", "JWT"],
"work_type": "implementation|review|planning",
"date": "2026-05-16",
"pr": "#123",
"source": "pr-review|test-failure|user-correction|manual"
}
Selective Retrieval
bd prime --files "src/api/auth/**" --keywords "authentication" --work-type implementation
# Only loads JSONL entries matching these filters
# Knowledge base can grow to thousands of entries without context overflow
# Agents get the 5 critical gotchas for the files they're about to touch
Self-Improvement Loop
After every PR merge, /self-reflect writes new entries:
- PR review comments → patterns, anti-patterns
- Build/test failures → gotchas, lessons
- Architectural decisions → decisions, rationale
- User corrections → preferred approaches
- Repeated user instructions → skill/command proposals
Session Priming (Hooks)
SessionStart hook (startup|resume|clear|compact):
session-start.sh runs bd prime on startup
- Loads active issues, blocked tasks
- Injects current BEADS state summary
PreCompact hook (always, before context compaction):
- Same
session-start.sh
- Critical: re-primes knowledge before the LLM's context window is compacted
- Prevents knowledge loss during long sessions
Plan and Design Documents
Plans written to disk (not just in agent context):
PLAN.md — implementation plan (architect output)
docs/designs/ — design documents from brainstorming
- These survive context compaction and session interrupts
Note: The Plan subagent type has read-only file access by design. Orchestrators must write plan files themselves after receiving plan text from Architect subagent.
CLAUDE.md / AGENTS.md / GEMINI.md
Three tool-specific context files in project root (populated by /setup):
CLAUDE.md — injected automatically by Claude Code on every session
AGENTS.md — Codex CLI project context
GEMINI.md — Gemini CLI extension context
These contain project-specific metaswarm configuration, BEADS setup status, and active workflow state.
.coverage-thresholds.json
Persisted coverage requirement — read by orchestrators before PR creation:
{ "thresholds": { "lines": 100, "branches": 100, "functions": 100, "statements": 100 } }
No Vector Store / No Embeddings
Knowledge retrieval is file-system grep + BEADS filter — no vector search, no semantic embeddings. Selective retrieval is metadata-based (files, keywords, work_type).
Git as Audit Log
All task history lives in git:
- BEADS issues in git
- Knowledge base JSONL in git
- Plan docs in git
- All commits from execution phases on feature branch
- PR merge as closure event
No separate audit log format. Git history IS the audit trail.