Work

Skein: A Coding Agent with a Non-Monotone Context

Year: 2026
Type: preprint
Abstract: Agents built on large language models typically keep their work history as a growing tape of messages—a linear transcript replayed to the model—and reduce context management to truncation and compaction. We describe Skein, a coding agent built around two design decisions. First, history is stored in an append-only journal of typed events, and the model’s context is recomputed fromscratch on every turn by a deterministic projection of that journal. The projection is non-monotone: completed phases leave the visible context but remain addressable through the recall and search tools. Second, work is organized into states whose goal and stopping criterion are stored as journal data; admissible transitions are specified by a protocol, and the model decides when to transition. On 13 tasks ported from Terminal-Bench (K = 5, network enabled and disabled, 250 executed runs), we compare Skein with opencode, a conventional tape-based agent, using the same model and verifiers. The solve rate is identical (123 of 125 each; 98.4% overall), but the cost structure differs: Skein uses 33% fewer total tokens, yet 1.87× more fresh (uncached) input, and is 1.42× more expensive on solved runs (1.32× across all runs). Fresh input costs 50× more than cache reads, and opencode has a higher cache share. We interpret the increase in fresh input as the cost of isolation as currently implemented—prefix instability and a higher turn count; at opencode’s cache share the costs are nearly equal (127.4 vs 125.7 RUB, Russian rubles). Goal drift was not measured; explicit re-reads are rare (9 of 170 read calls), and re-reads performed via bash are not separately accounted for. The cost premium is specific to a 50× price ratio: at ratios of 5× or less, Skein becomes cheaper. The potential benefits of the architecture—goal retention and controllability—are not measured here; we state them as hypotheses and outline the next phase of journal-based context managemen
Language: English
Open Access status: green
OpenAlex ID: W7233546732
Cites:
Cited by:
Related to: