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.
The store
Section titled “The store”~/.config/threadle/payloads/ ab/ ab3f…d21.json ← the payload ab3f…d21.md ← human-readable sidecar (not written for kind "files") tags.json ← hash → tagsThe 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:
| Field | Meaning |
|---|---|
hash | Content address |
kind | distilled-summary · transcript-excerpt · files |
createdAt | Capture timestamp |
source | Provider + session id it came from |
content | The markdown itself |
meta | Model (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.
Browsing
Section titled “Browsing”
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).
| Control | Values |
|---|---|
| Source chips | all plus every provider that actually produced a payload |
| Kind | any kind · distilled · excerpt · files |
| Sort | recent first · largest first · title A–Z |
| Filter box | preview, 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.
curl -X POST http://127.0.0.1:4570/api/payloads/<hash>/tags \ -H 'content-type: application/json' \ -d '{"tags":["auth-refactor","handoff"]}'Onto the canvas
Section titled “Onto the canvas”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.
| Endpoint | Returns |
|---|---|
GET /api/payloads | Metadata for every payload, newest first, tags merged in |
GET /api/payloads/:hash | The full payload JSON |
POST /api/payloads/:hash/tags | Replace a payload’s tags |
Payload content is also indexed for search — filter type: context to search only captured context.
Housekeeping
Section titled “Housekeeping”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.
Related
Section titled “Related”- Cross-tool handoff — how payloads are produced and injected
- Lineage — which payload reached which session
- Search — full-text across payloads and transcripts