swarmvault context

Build and manage agent-ready context packs from the compiled vault.

Usage

swarmvault context build <goal> [--target <path-or-node>] [--budget <tokens>] [--format markdown|json|llms] [--task <id>] [--memory <id>]
swarmvault context list
swarmvault context show <id> [--format markdown|json|llms]
swarmvault context delete <id>

Commands

  • build <goal> - assemble relevant pages, graph evidence, citations, and omitted-item accounting for a goal
  • list - show saved context packs
  • show <id> - print a saved pack
  • delete <id> - remove the saved JSON artifact and markdown companion

Options

  • --target <path-or-node> - Anchor the pack around a file path, page id, node id, or graph label
  • --budget <tokens> - Cap estimated token cost; over-budget candidates are reported in omittedItems
  • --format markdown|json|llms - Choose the printed output shape
  • --task <id> - Link the context pack to an active task
  • --memory <id> - Compatibility alias for --task

Examples

swarmvault context build "Implement the auth refactor" --target ./src --budget 8000
swarmvault context build "Review auth refactor" --target ./src --task <task-id>
swarmvault context build "Review onboarding claims" --target concept:onboarding --format llms
swarmvault context list
swarmvault context show 2026-04-24T10-30-00-000Z-implement-the-auth-refactor --format json

What It Writes

Every build writes two artifacts:

  • state/context-packs/<id>.json - the machine-readable pack with included items, omitted items, citations, and related graph ids
  • wiki/context/<id>.md - a markdown companion with stable frontmatter and rendered pack content

Use context packs when the next agent, PR reviewer, or future session needs bounded evidence instead of a broad search request.

How It Works

context build ensures graph and retrieval artifacts exist, runs local graph traversal plus retrieval against the goal and optional target, then fits pages, nodes, edges, and hyperedges into the requested budget. Items that do not fit are kept as explicit omissions so the receiver can ask for a larger budget or narrower target.