Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
caprock
command
caprock is the mission-control CLI and daemon: `caprock up` starts the local daemon (hook receiver + transcript ingest + API + dashboard), `caprock down` stops it, `caprock status` reports, `caprock hooks install|uninstall|status` manage the shim in ~/.claude/settings.json, and `caprock service install|uninstall|status` registers the daemon with the OS's login-time supervisor so it survives a reboot.
|
caprock is the mission-control CLI and daemon: `caprock up` starts the local daemon (hook receiver + transcript ingest + API + dashboard), `caprock down` stops it, `caprock status` reports, `caprock hooks install|uninstall|status` manage the shim in ~/.claude/settings.json, and `caprock service install|uninstall|status` registers the daemon with the OS's login-time supervisor so it survives a reboot. |
|
caprock-hook
command
caprock-hook is the shim Claude Code runs on every hook event.
|
caprock-hook is the shim Claude Code runs on every hook event. |
|
internal
|
|
|
agents
Package agents spawns and controls Claude Code sessions Caprock owns: a real `claude` process in a PTY, its output buffered for the terminal view and its exit recorded.
|
Package agents spawns and controls Claude Code sessions Caprock owns: a real `claude` process in a PTY, its output buffered for the terminal view and its exit recorded. |
|
api
Package api serves the loopback HTTP surface: REST queries under /v1, the /v1/live WebSocket, the hook receiver, and the embedded dashboard at /.
|
Package api serves the loopback HTTP surface: REST queries under /v1, the /v1/live WebSocket, the hook receiver, and the embedded dashboard at /. |
|
board
Package board is the Phase 2 task board: it bridges the hive's task files and mailboxes to the SQLite mirror and the API.
|
Package board is the Phase 2 task board: it bridges the hive's task files and mailboxes to the SQLite mirror and the API. |
|
bus
Package bus is the in-process fan-out for live frames: every stored event, session change, or alert is published once and delivered to every subscriber (WebSocket clients, the loop detector, tests).
|
Package bus is the in-process fan-out for live frames: every stored event, session change, or alert is published once and delivered to every subscriber (WebSocket clients, the loop detector, tests). |
|
config
Package config resolves Caprock's data directory and the small on-disk files that live in it: config.json (user settings) and runtime.json (per-run port + token, read by the hook shim).
|
Package config resolves Caprock's data directory and the small on-disk files that live in it: config.json (user settings) and runtime.json (per-run port + token, read by the hook shim). |
|
cost
Package cost turns token usage into dollars using the versioned pricing table, and computes the cache-savings math ported from Caprock-python (_savings.py).
|
Package cost turns token usage into dollars using the versioned pricing table, and computes the cache-savings math ported from Caprock-python (_savings.py). |
|
daemon
Package daemon wires every component into the running `caprock up` process: store, pricing, recorder, hookd, ingest, loop detector, API/WS server, the idle sweeper, and the runtime.json lifecycle.
|
Package daemon wires every component into the running `caprock up` process: store, pricing, recorder, hookd, ingest, loop detector, API/WS server, the idle sweeper, and the runtime.json lifecycle. |
|
desktop
Package desktop reads the plan-usage history the Claude desktop app keeps on disk, so the dashboard can say whether your plan limits were spent somewhere other than Claude Code.
|
Package desktop reads the plan-usage history the Claude desktop app keeps on disk, so the dashboard can say whether your plan limits were spent somewhere other than Claude Code. |
|
event
Package event defines the single normalized event type that every part of Caprock consumes — the UI, stats, the loop detector, the orchestrator, and any future avatar skin.
|
Package event defines the single normalized event type that every part of Caprock consumes — the UI, stats, the loop detector, the orchestrator, and any future avatar skin. |
|
gitdiff
Package gitdiff produces the live diff for a session's working directory by shelling out to git.
|
Package gitdiff produces the live diff for a session's working directory by shelling out to git. |
|
hive
Package hive owns the on-disk orchestration state (Phase 2): one directory per registered project workspace holding agents, tasks, approvals, mailboxes and an append-only ledger.
|
Package hive owns the on-disk orchestration state (Phase 2): one directory per registered project workspace holding agents, tasks, approvals, mailboxes and an append-only ledger. |
|
hookd
Package hookd receives Claude Code hook payloads from the caprock-hook shim on POST /v1/hook, normalizes them into events, and hands them to the recorder.
|
Package hookd receives Claude Code hook payloads from the caprock-hook shim on POST /v1/hook, normalizes them into events, and hands them to the recorder. |
|
hooks
Package hooks installs and removes the caprock-hook shim in Claude Code's user-level settings.json, non-destructively.
|
Package hooks installs and removes the caprock-hook shim in Claude Code's user-level settings.json, non-destructively. |
|
ingest
Package ingest discovers Claude Code transcript files (~/.claude/projects/**), tails them, and turns their JSONL lines into normalized events.
|
Package ingest discovers Claude Code transcript files (~/.claude/projects/**), tails them, and turns their JSONL lines into normalized events. |
|
loop
Package loop implements the loop detector: ≥ K tool.pre events with the same tool and normalized-similar input within T minutes ⇒ one alert per episode.
|
Package loop implements the loop detector: ≥ K tool.pre events with the same tool and normalized-similar input within T minutes ⇒ one alert per episode. |
|
narrate
Package narrate turns tool events into the human-readable phrases the Now screen shows ("editing main.go", "running go test — 2nd attempt") and derives a session's health badge and plan progress.
|
Package narrate turns tool events into the human-readable phrases the Now screen shows ("editing main.go", "running go test — 2nd attempt") and derives a session's health badge and plan progress. |
|
opencode
Package opencode reads sessions from OpenCode's SQLite database.
|
Package opencode reads sessions from OpenCode's SQLite database. |
|
orchestrator
Package orchestrator manages the Phase 2 orchestrator + worker lifecycle: it spawns Claude Code sessions with the hive-aware system prompt, runs the mailbox router on a tick, and registers agents in the hive.
|
Package orchestrator manages the Phase 2 orchestrator + worker lifecycle: it spawns Claude Code sessions with the hive-aware system prompt, runs the mailbox router on a tick, and registers agents in the hive. |
|
premium
Package premium holds what the paid plan costs and where to buy it.
|
Package premium holds what the paid plan costs and where to buy it. |
|
ptyman
Package ptyman owns pseudo-terminal sessions: spawn a process attached to a PTY (ConPTY on Windows), stream its bytes, write input, resize, signal, kill.
|
Package ptyman owns pseudo-terminal sessions: spawn a process attached to a PTY (ConPTY on Windows), stream its bytes, write input, resize, signal, kill. |
|
rollup
Package rollup is the single write path for events: it stores the event, upserts the session, prices assistant turns, and maintains session_stats / daily_stats / session_files in one transaction, then publishes live frames.
|
Package rollup is the single write path for events: it stores the event, upserts the session, prices assistant turns, and maintains session_stats / daily_stats / session_files in one transaction, then publishes live frames. |
|
service
Package service registers the Caprock daemon with the operating system's own login-time supervisor, so it comes back after a reboot without the user running `caprock up` by hand.
|
Package service registers the Caprock daemon with the operating system's own login-time supervisor, so it comes back after a reboot without the user running `caprock up` by hand. |
|
shim
Package shim is the hook shim logic shared by the caprock-hook binary and the hidden `caprock hook` fallback command.
|
Package shim is the hook shim logic shared by the caprock-hook binary and the hidden `caprock hook` fallback command. |
|
statusline
Package statusline is the `caprock statusline` command's logic: Claude Code invokes it (statusLine.command in settings.json) on every assistant message, piping a JSON status object on stdin.
|
Package statusline is the `caprock statusline` command's logic: Claude Code invokes it (statusLine.command in settings.json) on every assistant message, piping a JSON status object on stdin. |
|
store
Package store owns the SQLite database: opening, migrating, and every query.
|
Package store owns the SQLite database: opening, migrating, and every query. |
|
update
Package update checks whether a newer Caprock release exists and works out the command that would install it.
|
Package update checks whether a newer Caprock release exists and works out the command that would install it. |
|
version
Package version exposes the build-time version string stamped via -ldflags.
|
Package version exposes the build-time version string stamped via -ldflags. |
|
Package pricing embeds the versioned model pricing table.
|
Package pricing embeds the versioned model pricing table. |
Click to show internal directories.
Click to hide internal directories.





