Documentation
¶
Overview ¶
Package artifacts reads the claude.ai artifacts Claude Code published from its session transcripts (~/.claude/projects/FOLDER/SESSION.jsonl). Nothing else records them: claude.ai offers no list, and the link an agent printed has scrolled off its full-screen interface by the time anybody looks. A transcript keeps every Artifact tool call and the tool's reply, which names the artifact's address.
The phone gateway (GET /api/artifacts) and the server (artifact.list) both read through here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MaxCached = 1 << 14
MaxCached bounds a cache. Listing every artifact reads every transcript on the computer, and there can be thousands, so a small bound would empty the cache part-way through each listing and make every request read them all again; an entry is a size, a time and a short list.
Shared is the cache both readers use: one process reads a transcript once until it changes.
Functions ¶
func FindTranscript ¶
FindTranscript is Claude Code's transcript for a session: a session id names one file, in the folder of whichever directory it started in.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache remembers each transcript's artifacts until the file changes: a long session's transcript runs to megabytes, and a live one to hundreds. A transcript only grows, so one that grew is read from where it was left (as internal/usage's history is), and one being read already is waited for rather than read a second time: every window of Conch.app asks for the whole list as it connects, and on an empty cache — the first start, and every reload — that was each of them reading every transcript.
type Found ¶
Found is an artifact and the transcript folders that published it: a folder is one directory's sessions, which is how a pane's agent is matched to what it published.
func OfSession ¶
OfSession is what the sessions saved beside session published: every session that ran in its directory, not just this one, since a resumed or cleared agent starts a new transcript there. Found is false when the session's transcript is not on disk (yet: it is written after the first answer).