Skip to content

Context library

Every distillation, excerpt, and file manifest is written to a local payload store and listed in the Library view. Payloads are immutable and content-addressed, so re-running the same capture costs nothing and produces the same hash.


~/.config/threadle/payloads/
ab/
ab3f…d21.json ← the payload
ab3f…d21.md ← human-readable sidecar (not written for kind "files")
tags.json ← hash → tags

The hash is sha256(kind ␀ provider ␀ sessionId ␀ content), sharded by its first two hex characters. Writes are atomic (temp file + rename) and skipped entirely when the file already exists.

A stored payload carries:

FieldMeaning
hashContent address
kinddistilled-summary · transcript-excerpt · files
createdAtCapture timestamp
sourceProvider + session id it came from
contentThe markdown itself
metaModel (for distills), message range, token estimate (chars ÷ 4), source title

Listing a payload derives a preview: the first line that carries meaning — blanks, code fences, role headers, and tool-call lines are skipped.


The Library view listing stored payloads grouped by source session

Payload rows under their source session, each with kind, size, and age.

Library rows are grouped by source session, newest group first. The group header links back to that session (❯ session).

ControlValues
Source chipsall plus every provider that actually produced a payload
Kindany kind · distilled · excerpt · files
Sortrecent first · largest first · title A–Z
Filter boxpreview, tags, source title, or hash

Each row shows preview, kind, size, and age. The menu holds Source blueprint, Lineage, and Download raw; the inline workflow button seeds a canvas with the payload.

The detail aside shows hash, created, source, the tag editor, and the full content, with actions: → workflow, ❐ copy, ⇓ raw, ⌗ source, ❯ session.


Tags live in a sidecar (tags.json) so stored payloads stay byte-identical to their hash. Type into the tag box and press ⏎; the ✕ on a chip removes one.

Limits: up to 20 tags, each ≤ 40 characters. Duplicates and blanks are dropped; clearing every tag removes the entry.

Terminal window
curl -X POST http://127.0.0.1:4570/api/payloads/<hash>/tags \
-H 'content-type: application/json' \
-d '{"tags":["auth-refactor","handoff"]}'

Palette → library lists the 15 most recent payloads. Drag one onto the canvas and you get a context node that is already materialized — its payloadHash is set, so it needs no source session and no Materialize press. Wire-dropping from a handle offers the same payloads under a library heading.

This matters for detached runs: a context node without a payload hash is a hard block there, because headless runs cannot materialize on the fly.


EndpointReturns
GET /api/payloadsMetadata for every payload, newest first, tags merged in
GET /api/payloads/:hashThe full payload JSON
POST /api/payloads/:hash/tagsReplace a payload’s tags

Payload content is also indexed for search — filter type: context to search only captured context.


The store is listed under Settings → internals as Context payloads, with its size and file count, and can be cleared from there. Clearing removes captures only; sessions are untouched, since threadle never writes to provider storage.


  • Cross-tool handoff — how payloads are produced and injected
  • Lineage — which payload reached which session
  • Search — full-text across payloads and transcripts