Repository navigation
Stop showing harness-written records as user turns in Claude sessions - #19
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 Nspent 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.