Extract epitaphs from Cline sessions #170

Closed
opened 2026-08-22 00:22:53 -07:00 by dejima-agent · 1 comment
Collaborator

Filed by LLM agent

Cline is supported, but bin/harness/cline.sh defines no harness_extract_epitaphs, so a compacted Cline session leaves nothing behind. dejima-epitaph treats an undefined hook as "nothing was kept", which is honest but not the intended end state.

Why it was left out rather than written

No compaction of a real Cline session has been observed. Cline has a --compaction agentic|basic|off flag, so summaries presumably exist in some form, but what one looks like inside a .messages.json has not been seen.

Guessing was the alternative and it is worse than absence. dejima's own promise about the artefact is that it is what the session wrote, preserved verbatim — an extractor written against a guessed record shape either silently keeps nothing, or keeps the wrong record under that promise. Absence is at least legible.

What is already in place

The seam exists and needs no further work. harness_transcript_files answers where a workspace's transcripts are, one <key>\t<path> line per file, and harness_extract_epitaphs is handed one file at a time along with the output directory. Everything around it — the store, that nothing mounts it, the 0700 directory, the provenance note, the dedupe on re-runs — is core's and already works for the second harness.

Cline's transcripts are at <data>/sessions/<id>/<id>.messages.json: one JSON document, rewritten in place, with messages[] carrying role and a content array of text / tool_use / tool_result blocks. harness_transform_transcript already parses exactly that shape for conversation logging, so the parsing is understood — what is missing is only which record marks a compaction and which fields describe it.

What would close this

  1. Run a Cline session long enough to compact, with --compaction agentic and again with basic, and keep the resulting .messages.json.
  2. Write down what a compaction looks like in it: the record that carries the summary, and whatever accompanies it (trigger, token counts before and after — Claude Code's compact_boundary carries those, and the epitaph header has fields for them).
  3. Implement harness_extract_epitaphs in bin/harness/cline.sh against that, keyed on something stable per summary so save running on every exit does not duplicate what an earlier run kept.
  4. Test it the way the Claude Code one is tested, against a fixture transcript.

See docs/development.md, "Worked example: Cline", which records this as deliberately absent.

**Filed by LLM agent** Cline is supported, but `bin/harness/cline.sh` defines no `harness_extract_epitaphs`, so a compacted Cline session leaves nothing behind. `dejima-epitaph` treats an undefined hook as "nothing was kept", which is honest but not the intended end state. ## Why it was left out rather than written No compaction of a real Cline session has been observed. Cline has a `--compaction agentic|basic|off` flag, so summaries presumably exist in some form, but what one looks like inside a `.messages.json` has not been seen. Guessing was the alternative and it is worse than absence. dejima's own promise about the artefact is that it is what the session wrote, preserved verbatim — an extractor written against a guessed record shape either silently keeps nothing, or keeps the wrong record under that promise. Absence is at least legible. ## What is already in place The seam exists and needs no further work. `harness_transcript_files` answers where a workspace's transcripts are, one `<key>\t<path>` line per file, and `harness_extract_epitaphs` is handed one file at a time along with the output directory. Everything around it — the store, that nothing mounts it, the 0700 directory, the provenance note, the dedupe on re-runs — is core's and already works for the second harness. Cline's transcripts are at `<data>/sessions/<id>/<id>.messages.json`: one JSON document, rewritten in place, with `messages[]` carrying `role` and a `content` array of `text` / `tool_use` / `tool_result` blocks. `harness_transform_transcript` already parses exactly that shape for conversation logging, so the parsing is understood — what is missing is only which record marks a compaction and which fields describe it. ## What would close this 1. Run a Cline session long enough to compact, with `--compaction agentic` and again with `basic`, and keep the resulting `.messages.json`. 2. Write down what a compaction looks like in it: the record that carries the summary, and whatever accompanies it (trigger, token counts before and after — Claude Code's `compact_boundary` carries those, and the epitaph header has fields for them). 3. Implement `harness_extract_epitaphs` in `bin/harness/cline.sh` against that, keyed on something stable per summary so `save` running on every exit does not duplicate what an earlier run kept. 4. Test it the way the Claude Code one is tested, against a fixture transcript. See `docs/development.md`, "Worked example: Cline", which records this as deliberately absent.
Author
Collaborator

Comment by LLM agent

Answered by observation: there is nothing to extract, and that is the correct end state rather than a gap.

A compaction was forced against a locally served model with contextWindow set small enough to trigger it. Four completed auto_compaction cycles, each dropping the working context from five messages to three.

The persisted record was untouched by every one of them. All five file reads remained in .messages.json in full, tool results included, at ~20 KB apiece — precisely the content compaction had just removed from what was being sent to the model.

So Cline's compaction is a working-context operation and nothing more. Epitaphs exist because Claude Code's compaction destroys context that survives only as the summary written into its transcript, and the container takes everything else with it when it goes. Cline destroys nothing on disk, so there is no summary to preserve and no loss to guard against. harness_extract_epitaphs stays undefined because that is the answer.

Two things worth recording in case this is ever revisited:

  • The summary Cline builds during compaction is real, but it lives only in the event stream, as auto_compaction notices carrying tokensBefore/tokensAfter and messagesBefore/messagesAfter. Nothing of it reaches the session record.
  • A run with too small a budget reports compaction_budget_emergency and falls back from agentic_summary to plain trimming. Both paths leave the record intact, so the distinction does not change the conclusion.

Recorded in docs/development.md's Cline worked example by #176, which replaces the earlier "no compaction has been observed" note.

Closing. If Cline later starts persisting a compaction artifact, this becomes a real task again and the seam is already in place to take it.

**Comment by LLM agent** Answered by observation: there is nothing to extract, and that is the correct end state rather than a gap. A compaction was forced against a locally served model with `contextWindow` set small enough to trigger it. Four completed `auto_compaction` cycles, each dropping the working context from five messages to three. **The persisted record was untouched by every one of them.** All five file reads remained in `.messages.json` in full, tool results included, at ~20 KB apiece — precisely the content compaction had just removed from what was being sent to the model. So Cline's compaction is a working-context operation and nothing more. Epitaphs exist because Claude Code's compaction *destroys* context that survives only as the summary written into its transcript, and the container takes everything else with it when it goes. Cline destroys nothing on disk, so there is no summary to preserve and no loss to guard against. `harness_extract_epitaphs` stays undefined because that is the answer. Two things worth recording in case this is ever revisited: - The summary Cline builds during compaction is real, but it lives only in the event stream, as `auto_compaction` notices carrying `tokensBefore`/`tokensAfter` and `messagesBefore`/`messagesAfter`. Nothing of it reaches the session record. - A run with too small a budget reports `compaction_budget_emergency` and falls back from `agentic_summary` to plain trimming. Both paths leave the record intact, so the distinction does not change the conclusion. Recorded in `docs/development.md`'s Cline worked example by #176, which replaces the earlier "no compaction has been observed" note. Closing. If Cline later starts persisting a compaction artifact, this becomes a real task again and the seam is already in place to take it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dejima/dejima#170