Free Intensive Nov 21–22Free 2-day hands-on Vibecoding Intensive on Nov 21–22 at 16:00 MSK (Sat–Sun) · Live Cohort 3 starts Nov 23Join Free →Cohort 3 (Nov 23)
ReleaseInsight · On RadarHabr AI→ original

Skein Agent Erases Finished Stages From Context: 97% Success Rate, But More Expensive Than OpenCode

Coding agents like Claude Code accumulate the entire conversation with the model, and the long transcript gets more expensive and scatters attention. The Skein agent erases completed stages and keeps a short summary. Across 13 Terminal Bench tasks (65 runs), it succeeded in 63 cases, or 97%, while OpenCode succeeded in all 65. But Skein costs more: 0.70 vs 0.47 rubles. Erasing context pays off on long research tasks; on short ones, the cache wins.

AI-processed from Habr AI; edited by Hamidun News
Skein Agent Erases Finished Stages From Context: 97% Success Rate, But More Expensive Than OpenCode
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1The provider's cache is 50 times cheaper than input, and erasing the transcript breaks it
Key metric #2Skein makes 14 turns instead of OpenCode's 9: transitions also cost tokens
Key metric #3Hypothesis mode cut new input from 34.5k to 19.6k tokens on 7 tasks

Imagine working on a bug all day without throwing away a single note: every draft, log, and failed guess stays on the desk. That is roughly how modern coding agents work, from Claude Code to Cursor. The model calls a tool, the agent executes the call, the result is appended to the end of the conversation, and the whole transcript is sent back to the model.

The context only grows. This is convenient for caching, but a long transcript has two known problems: the model's window is finite, and attention to the middle of a long text weakens. The developer behind Skein, writing on Habr, tried a different way around this: not trimming the beginning or summarizing everything in sequence, but erasing whole completed chunks of work.

The result is mixed. Of 65 test runs, the agent solved 63 (97%), while the competitor OpenCode, with a conventional transcript, solved all 65 and cost less.

How the "accordion" works

In Skein, every turn is written to a journal: the model's message, the tool call, and the result. Before calling the model, a special function assembles the transcript from the journal, and some events are left out of it. As a result, the context length alternately grows and shrinks. The author compares this to an accordion, which a regular agent only ever stretches.

The first variant works through states, that is, development phases: Patch (fix the bug), Verification (check the fix), Research (investigate), Construction (write from scratch), and End. Each state is a small agent with its own prompt, goal, and stopping criterion. When the model decides the goal has been reached, the state's transcript is deleted.

Two service messages remain, "Start state" and "Finish state," along with the summary the model wrote itself. Transitions between states follow a fixed table through the move tool. For example, after Patch the agent can go to Verification or Research, and after a failed check it can return to Patch.

Tools also change by phase: before starting, only move is available; inside a state, only the working tools are.

The second variant is built on hypotheses. The author drew on Charles Peirce's ideas about abduction, that is, constructing an explanation for an observed fact. The model formulates a hypothesis and a stopping criterion itself, tests it with tools, and returns JSON with observations, a brief summary, and a verdict: confirmed, refuted, or dropped due to the turn limit. The hypothesis transcript is then erased. Hypotheses can nest inside one another (identifiers like H1.2.3). To read saved results there are the recall and search tools, and no more than 8K characters of them enter the transcript at a time.

What the tests showed

The author took 13 tasks from Terminal Bench, a set of tasks for terminal agents (git recovery, regular expressions, OpenSSL, fixing a vulnerability in bottle.py, a bug in the OCaml garbage collector, COBOL, and others), and ran each one 5 times. A single model was used, DeepSeek V4.1 Flash, and the competitor was the first version of OpenCode with the classic linear transcript.

With network access, Skein solved 63 of 65 runs using states, while OpenCode solved all 65. Without network access, Skein's result was 60 of 60, while OpenCode solved 58 of 60. The author considers the quality difference indistinguishable. Skein does lose on cost, however. On average it makes 14 turns versus 9, 22.1k versus 10.4k tokens of new input, and an 86.7% cache share versus 95.3%. The cost was about 0.70 rubles versus 0.47 rubles with network access, and 1.00 rubles versus 0.44 rubles without it.

The cause lies in token economics. The author's provider prices the cache at 50 times less than regular input. The cache only works if the text matches character for character. A linear transcript is cached almost entirely, but when Skein erases a chunk from the middle, the text after that point changes, and the cache there doesn't hit. On top of that, transitions and opening hypotheses are separate turns. The author notes that Skein may use fewer tokens in total, but the cache still gives OpenCode the win.

The two Skein modes were compared against each other on 7 tasks. The state mode solved 35 of 35 with network access, and the hypothesis mode solved 34 of 35. Hypotheses consumed less fresh input (19.6k versus 34.5k tokens) but made more turns (20 versus 17). The cost advantage depended on conditions: with network access, hypotheses cost 1.88 rubles versus 2.42 rubles, and without it the opposite held, 1.98 rubles versus 1.61 rubles.

Limitations and practical takeaways

These findings should be read with caution. The test is small, uses a single model, and the provider runs that model through different subcontractors with different quantization, down to 4-bit, which adds noise to the reasoning. The tasks are mostly too easy, and according to the author, the density of results does not allow the approach's effectiveness to be assessed. All failures were tied to the turn limit. The observer agent, which is supposed to watch for states that run too long, is not yet ready.

For those building their own agents, there are three useful points. First, assemble the context from an event journal rather than simply appending to it: this makes it easier to experiment with projections. Second, account for the cache price when erasing the transcript: on short tasks it loses. Third, the author sees a use for Skein, especially in hypothesis mode, on research tasks with long chains of reasoning, where the extra transitions will pay off. This is so far his own assessment, not a verified result.

Story

Key Questions Answered

How the "accordion" works?

In Skein, every turn is written to a journal: the model's message, the tool call, and the result. Before calling the model, a special function assembles the transcript from the journal, and some events are left out of it. As a result, the context length alternately grows and shrinks. The author compares this to an accordion, which a regular agent only ever stretches.

What the tests showed?

The author took 13 tasks from Terminal Bench, a set of tasks for terminal agents (git recovery, regular expressions, OpenSSL, fixing a vulnerability in bottle.py, a bug in the OCaml garbage collector, COBOL, and others), and ran each one 5 times. A single model was used, DeepSeek V4.1 Flash, and the competitor was the first version of OpenCode with the classic linear transcript. With network access, Skein solved 63 of 65 runs using states, while OpenCode solved all 65.

What are the key details on Limitations and practical takeaways?

These findings should be read with caution. The test is small, uses a single model, and the provider runs that model through different subcontractors with different quantization, down to 4-bit, which adds noise to the reasoning. The tasks are mostly too easy, and according to the author, the density of results does not allow the approach's effectiveness to be assessed. All failures were tied to the turn limit. The observer agent, which is supposed to watch for states that run too long, is not yet ready.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Hands-On AI Engineering · Hamidun Academy

Build & Ship Production AI Agents Without Boilerplate Code

Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.

Start 72h Free Trial →Vibe-Coding Intensive
What do you think?
Loading comments…