Repository navigation
feat: capture thinking blocks from Claude Code (#78) - #156
Merged
Merged
Conversation
) thinking blocks - where an agent shows confusion or a change of approach - were dropped. They are now captured as one redacted, truncated excerpt on the session (400 characters per block, 2,000 total), for analysis only: nothing displays it and no skill, memory entry or handbook practice is generated from it.
This was referenced Nov 20, 2026
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.
What changed and why
claude.tsread onlytextandtool_useblocks;thinkingblocks — where the agent shows where it got confused or changed approach — were dropped, so a recovered session was indistinguishable from a lucky one. They are now captured as one redacted, truncated excerpt on the session (NormalizedSession.thinking→WorkflowTrace.thinking).The shape: each block is redacted and truncated at parse time (400 characters per block, via the same
redactTruncatedpass as assistant text); the blocks join into one excerpt capped at 2,000 characters for the whole session. Verified against real transcripts first: thinking blocks are{type: "thinking", thinking, signature}— the signature is ignored."Used for analysis only", enforced: the excerpt lives on the trace as analysis input. Nothing displays it, and by construction nothing generates from it — skills, memory and the handbook are built from steps, commands and corrections, none of which touch the new field.
docs/architecture.mdstates both the capture and the guarantee. The obvious consumer (telling a genuinely recovered session apart from a lucky one, per the issue's motivation) is a follow-up: the data is now there for it.Docs
docs/architecture.md(the Claude Code paragraph: the excerpt, its caps, and the never-generated-from guarantee).Testing
pnpm lint,pnpm typecheck,pnpm build,pnpm test: 752 passed, 18 skipped.New test: thinking blocks with an embedded npm token come out redacted (
REDACTEDpresent, the raw token absent), eight blocks join into one excerpt capped at 2,000 characters.