Repository navigation
Record earlier Claude Code turns as plan context and track Bash edits - #144
Open
ranimkhojah wants to merge 1 commit into
Open
ranimkhojah wants to merge 1 commit into
ranimkhojah wants to merge 1 commit into
Conversation
A Claude Code tasklet only kept the prompt of the turn that edited files, so a discussion ending in "yes" was recorded as just "yes". Turns that change nothing are now saved per session and attached to the next turn that does, shown as the Plan stage (in a collapsed "Earlier context" section) with the first one as the tasklet title. Saved turns are only attached to changes in the repo they happened in, and the temp files holding them are owner-only. Edits made through Bash (e.g. sed) were not detected, so they went unrecorded and were later credited to an unrelated prompt. PostToolUse now also matches Bash, and the Stop hook records a snapshot whenever tracy.py finds a change. Both installers update the matcher on existing installs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
There is a limitation introduced by this PR: it clears all saved context for the Claude session after recording a snapshot. If the user discusses changes in repo A, then edits repo B, repo A’s context is also deleted. |
This branch has not been deployed
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.
Summary
Two problems with how Claude Code tasklets were recorded:
sed) weren't detected. They went unrecorded and were later credited to an unrelatedprompt.
Changes
Plan context
Plan/Build).
to OpenCode tasklets.
0600).Bash edits
PostToolUsenow also matchesBash. At the end of the turn, a snapshot is taken iftracy.pyfinds a change, andskipped if nothing changed.
deploy.jsand the extension's auto-installer) update the matcher on existing installs.Things to know
above, just like OpenCode's plan prompts.
release.
Testing
bun test), including end-to-end tests that run the real hook andtracy.py.buildHistorytest covers plan context.sed-only rename got its own tasklet, and a discussion followed by"yes" was attached as context.
buildHistoryperformance test (10s limit) fails locally at ~11s. It fails the same way onmain.🤖 Generated with Claude Code