works.iterative.claude.core.log
Members list
Packages
Type members
Classlikes
Configuration for SessionCatalog.
Configuration for SessionCatalog.
Value parameters
- cwd
-
the working directory the sessions ran under, when it is known. The vendor tree is keyed by the encoded cwd, so with no cwd only the kept copy is read.
- installation
-
the Claude installation the catalog is scoped to; its records are kept under CustodyRoot.installationDir and never read as another's
- root
-
the directory custody keeps records under (see CustodyRoot.default)
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Errors surfaced by SessionCatalog operations. Extends Throwable so an implementation may also let it propagate through effect types whose error channel is Throwable.
Errors surfaced by SessionCatalog operations. Extends Throwable so an implementation may also let it propagate through effect types whose error channel is Throwable.
Attributes
- Supertypes
-
trait Enumtrait Producttrait Equalsclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ArchivePaths.type
Reads the last complete lines of a byte region without scanning it from the start.
Reads the last complete lines of a byte region without scanning it from the start.
The region is a file being appended to by the CLI. Lines are delimited by 0x0A; because no byte of a multi-byte UTF-8 sequence is ever 0x0A, splitting on the raw byte never severs a character, so each line's byte slice decodes as UTF-8 independently. A single trailing \r is stripped so a CRLF-terminated line reads the same as an LF-terminated one.
Torn-final-line rule: bytes after the last 0x0A in the region are a line whose terminating newline has not been written yet — a live append in progress — and are excluded from the tail. A region that ends exactly on a newline (or on a previous page's cursor, which is always a line start) has no such remainder.
Blocks are read backward from the region end, only far enough to expose the requested number of complete lines, so cost is proportional to the page, not the region.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
BackwardLineReader.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ByteRangeReader.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ClaudeProjects.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Whether a session the SDK runs is kept, and under which root.
Whether a session the SDK runs is kept, and under which root.
The installation a record is kept for is never part of this choice: it is the one the session's CLI runs under (Installation.resolve).
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CustodyRoot.type
Reads the complete lines appended to a file after a byte offset.
Reads the complete lines appended to a file after a byte offset.
The region is a file the CLI is still writing. Lines are delimited by 0x0A; because no byte of a multi-byte UTF-8 sequence is ever 0x0A, splitting on the raw byte never severs a character, so each line's byte slice decodes as UTF-8 independently. A single trailing \r is stripped so a CRLF-terminated line reads the same as an LF-terminated one — the same rules BackwardLineReader reads a tail by, so a transcript read once at the end and then followed says the same thing either way.
Torn-final-line rule: bytes after the last 0x0A are a line whose terminating newline has not been written yet. They are left unread and the returned cursor stops before them, so the next read starts at that line and sees it whole once the writer finishes it. An entry is therefore never shown half-written, and never shown twice.
The cursor is the whole of what a follower has to remember: it is a byte position into an append-only file, so feeding it back is what makes reading resumable without holding on to anything that was read.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ForwardLineReader.type
One Claude installation: the config directory the CLI runs under.
One Claude installation: the config directory the CLI runs under.
It is custody's tenancy boundary — records kept for one installation are never read as another's. Which account the installation is logged into is in its credentials, which custody does not read.
Value parameters
- configDir
-
the absolute config directory (
CLAUDE_CONFIG_DIR, or~/.claude)
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
Installation.type
A session's live stream, written as the entries its transcript will hold.
A session's live stream, written as the entries its transcript will hold.
A page reads a conversation from the transcript, and a transcript is only what the CLI has finished writing down. The same conversation is also coming past on the process's own stream, ahead of the file — so this puts it in the transcript's shape, and everything downstream (the reader, the rendering, the follow) stays one code path with one encoding.
That is the whole point: it does not render, and there is no second way for a row to be drawn. A live entry and the file's entry for the same turn produce the same row, so a page that has been shown the live one and then re-reads the file sees nothing move.
Two kinds of message carry conversation and become entries. Everything else on the stream — the session's own bookkeeping, keep-alives, control replies, anything unparsed — is not a turn and yields nothing, the same as the bookkeeping lines a transcript file holds.
The end-of-turn envelope is the exception, and only when the turn ended badly. A turn that dies has no words to write down, so the transcript stops mid-conversation and says nothing about why; the envelope is the only account of the ending anyone gets, and a reader who is not shown it is left waiting for an answer that is never coming.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
LiveEntries.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
One planned mirror operation for a single file, keyed by its path relative to the tree root.
One planned mirror operation for a single file, keyed by its path relative to the tree root.
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
MirrorPlanner.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PageSize.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ProjectPathDecoder.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ProjectPathEncoder.type
Custody of one installation's session records: locate a record by its session id, read its conversation entries (main thread and sub-agent sidechains), and keep the whole tree under the custody root.
Custody of one installation's session records: locate a record by its session id, read its conversation entries (main thread and sub-agent sidechains), and keep the whole tree under the custody root.
The catalog is scoped to one installation; a record kept for another is never read through it. When the catalog knows the cwd the sessions ran under, every locate and read resolves the session in the vendor tree first — keyed by the encoded cwd, never by decoding a directory name, which is ambiguous — and falls back to the kept copy once the vendor tree has been pruned. With no cwd known, only the kept copy is read, and it is found by the session id alone. The located record's root names which one won. The record is a tree (the main .jsonl plus the sub-agent .jsonl and .meta.json sidechains), so a keep copies the tree, not a single file. Entry reads tolerate vendor drift by degrading unrecognized lines to raw entries rather than losing them.
Following a session while it is being written is deliberately not here. Its shape is an interval and a stream of batches, both of which name the effect system in a way none of the reads below do, and there is one interpreter to serve. It lives on that interpreter instead — works.iterative.claude.zio.log.ZioSessionCatalog.follow — and a second interpreter is the moment to decide whether the port should carry it.
Type parameters
- F
-
the effect type; the abstract
EntryStreamlets each backend pick its own streaming type.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
One line of a transcript, as the bytes on either side of it say it is.
One line of a transcript, as the bytes on either side of it say it is.
A transcript is read in two directions — backward for a page, forward for a follow — and the two must agree on what a line is, or a line read one way and the same line read the other would not be the same string.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
TranscriptLine.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
TranscriptPage.type