Repository navigation
Conversation
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.
Problem
tracer sessions replayfinds nothing for a Claude Desktop session that runs in a git worktree, whiletracer sessions showreads the same session fine:These sessions are never indexed. The Stop hook is meant to keep the index current for every session, worktrees
included (
tracer sessionscounts a worktree as part of its project), but it indexes the main checkout's transcriptfolder, and a worktree session's transcript is stored under the worktree's own folder.
Cause: the hook takes the folder from
$CLAUDE_PROJECT_DIR, then its own cwd. In a Desktop worktree session bothname the main checkout (
/src/app), asdocumented,
while the transcript is filed under the worktree's project folder in
~/.claude/projects. The hook's stdin input does carry the session'stranscript_path.It is easy to miss: nothing says the session was skipped, and a plain
tracer trace indexfrom the main checkoutdoes not reach it either. Only
tracer trace index --session <id>, run for each missing session, fills the gap.Change
tracer indextakes an optional--transcript PATH. When the path is a transcript inside the Claude projectsfolder, the engine indexes that transcript's folder first, then the project as before, in the same run.
transcript_pathto the onetracer indexit already starts. A session outside aworktree is indexed with the same result as before; missing or unusable input falls back to today's invocation.
also holds.
After:
tracer sessions replay 1a2b3c4dshows the session's dialogue.Testing
tests/test_index_hook.py: the hook passestranscript_pathon, and unusable input falls back to today'scommand.
tests/test_indexer_regressions.py: the index contents for a worktree session, an unchanged plainsession, invalid paths, duplicate sessions, and a failed extra pass that still indexes the project. Every new case
fails on
main.uv run pytest -q: 368 passed, 8 skipped (358 passed onmain).