Skip to content

Stop showing harness-written records as user turns in Claude sessions - #19

Merged
wilbeibi merged 3 commits into
mainfrom
claude-drop-harness-injected-turns
Sep 20, 2026
Merged

wilbeibi merged 3 commits into
mainfrom
claude-drop-harness-injected-turns

Conversation

@wilbeibi

Copy link
Copy Markdown
Owner

Claude Code files some of its own bookkeeping as user records: background-task reports, the output of a local command and the caveat around it, injected reminders. catchup read each one as something you said, so a handoff put XML in your mouth, --last N spent exchanges on records nobody typed, and a listing could match or quote them.

A user record whose text is nothing but those wrappers is now skipped. Everything you did stays: a slash command, a ! bash line, a message that opens with a reminder and then says something of its own, and pasted markup such as a message starting with <div>. A wrapper that never closes is kept too.

wilbeibi and others added 3 commits September 20, 2026 13:06
Claude Code files background-task reports, local command output and its
caveat, and injected reminders as type:"user" records. catchup read them
as turns, so a handoff put XML in the user's mouth, --last N spent
exchanges on records nobody typed, and a listing could match or quote
them.

A user record whose text is nothing but those wrappers is now skipped,
recognised by an explicit list of wrapper names matched at the start of
the message. A slash command and a ! bash line stay: those record
something the user did, and their text is the request. So does a record
that says something of its own, and pasted markup — a message opening
with <div> or <my-element> is a turn the user meant to send.
The listing, --last and harnessOnly unit tables each re-checked what the
end-to-end test already decides. TestHarnessWrittenUserRecordsDropped reads a
transcript through Resolve and Read and asserts the exact entry list, so it
covers both halves that matter: the records that go, and the ones a name list
exists to keep — a slash command, a ! bash line, an unclosed wrapper, a
reminder with a question after it, pasted markup, and <system-reminder-notes>.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1bnmAA2o7tPADLVLD46cA
# Conflicts:
#	internal/claude/claude_test.go
@wilbeibi
wilbeibi merged commit e67a85d into main Sep 20, 2026
2 checks passed
@wilbeibi
wilbeibi deleted the claude-drop-harness-injected-turns branch September 21, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants