Skip to content

reyn storage

Inspect Reyn-managed on-disk storage: media, offloaded tool results, and every agent's history.jsonl. Read-only — this command never deletes anything (#4478/#4476 Phase 1: measurement only, no TTL/max-N/retention eviction policy yet; media_store.py and history_tail_reader.py's own module docstrings name measurement evidence, not hypothesis, as the precondition for any future Phase 2 policy).

Named storage, not media — the command started as reyn media stats (#4478), then #4476 landed history.jsonl reporting on the same surface rather than as a second command (one operator-facing place to look, since both answer the same underlying question — "how much of reyn's own on-disk footprint currently exists" — for different subsystems). "media" stopped describing what the command covers once history.jsonl joined it, so the command was renamed (#4488) before its reference page ever landed.

Synopsis

reyn storage stats [--project-root <path>]

Subcommands

stats [--project-root <path>]

Print on-disk file counts + byte totals for .reyn/media/ and .reyn/tool-results/, plus file/byte/turn counts summed across every history.jsonl found under .reyn/agents/. Gives MediaStore.storage_stats() and aggregate_history_stats() — each previously a measurement method with no caller — an actual reader, so an operator (or a script) can decide whether disk pressure is real before any eviction/retention policy gets designed.

$ reyn storage stats

directory            files           bytes
media/                   12         4,718,592
tool-results/            37        18,874,368

                     files           bytes       turns
history.jsonl             3         623,411         842

--project-root defaults to the current directory; it must contain a .reyn/ tree (the same resolution reyn chat and other project-scoped commands use). A project with no .reyn/agents/ yet reports all-zero for the history.jsonl row, not an error.

Storage this command reports on

  • .reyn/media/ — resolved image/media bytes fetched for the present op's image component (see Present op reference).
  • .reyn/tool-results/ — offloaded large tool results (the chat-string offload path, reyn.runtime.services.tool_result_cap.cap_tool_result). Per .reyn/ directory layout, both media/ and tool-results/ are classified audit — an append-only record kept, never restored on rewind — not cache/, despite both being safe to grow without affecting recovery correctness.
  • history.jsonl (one per agent/session, .reyn/agents/<name>/history.jsonl and .reyn/agents/<name>/sessions/<sid>/history.jsonl, glob **/history.jsonl) — the durable, append-only turn log CompactionController and branch-visibility filtering read directly (#4472); total_lines counts non-empty JSONL lines the same way a real reader does, not a raw line count. This command counts and sizes these files; it does not itself appear in .reyn/ directory layout's canonical tree today — that page's five-way classification does not yet have a history.jsonl row (a pre-existing doc gap this command's landing surfaced, not something #4476/#4488 changed).

Spill-manifest self-prune (#4478)

MediaStore tracks which tool-result files it has spilled to disk via a manifest at .reyn/memory/tool_result_spills.jsonl (#4584: moved from .reyn/cache/ — that tier's "derived, rebuilt after restore" promise never held for this manifest; see .reyn/ directory layout), read in full on every MediaStore construction. An entry whose target file no longer exists on disk (deleted manually, or by a future Phase 2 GC policy) is dropped from the manifest the next time it's loaded — this bounds the manifest's otherwise-unbounded growth. This is a self-PRUNE of existing entries only, never a REBUILD: if the manifest file itself were deleted, nothing recreates it. The prune only rewrites the manifest itself; it never deletes any actual media/tool-result bytes, and a write failure here is best-effort (never fails MediaStore construction). reyn storage stats does not report on the manifest directly — it measures the artifact directories the manifest tracks.

  • .reyn/ directory layout — the five-way subtree classification (media//tool-results/ are audit; history.jsonl is currently undocumented there)
  • Present op reference — the image component that populates .reyn/media/