Conversation
Add TDD tests for --checkpoint, --verbose (-v), and --full flags that will be implemented on the explain command. These tests verify the flags exist but are expected to fail until the flags are added. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: d599f72ee73a
Add three new flags to the explain command: - --checkpoint: explain a specific checkpoint by ID or prefix - --verbose/-v: show prompts, files, and session IDs - --full: show complete transcript Flags are registered but not yet wired to runExplain. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: ec6d3a8b5152
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: b53cfcd0f538
- Update runExplain signature to accept checkpointID, verbose, full params - Add mutual exclusivity check for --session, --commit, --checkpoint - Wire up flags in newExplainCmd RunE - Add runExplainCheckpoint stub - Update TestExplainBothFlagsError to use new signature Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 95648a30fde0
TDD Red phase: test expects runExplainCheckpoint to return "checkpoint not found" error for nonexistent checkpoints. Currently fails because stub returns "not implemented". Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 95648a30fde0
Add checkpoint lookup functionality to runExplainCheckpoint: - Open git repository and create GitStore - List committed checkpoints from entire/sessions branch - Find checkpoint by prefix match - Return "checkpoint not found" error if no match - Load checkpoint data using ReadCommitted - Call formatCheckpointOutput stub for formatting Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 8bc5137450f6
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 5d2a9aa7b90d
Add formatCheckpointOutput function with tiered output levels: - Default: checkpoint ID, session ID, timestamp, token count, intent - Intent is extracted from first line of prompts as fallback - Token count is sum of input, cache creation, cache read, and output Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 102b7007badc
Verbose mode (--verbose, -v) adds: - Files section with list of touched files - Full prompts section (not just first line) Test: TestFormatCheckpointOutput_Verbose Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 102b7007badc
Full mode (--full) adds transcript section showing complete JSONL transcript content in addition to verbose output. Test: TestFormatCheckpointOutput_Full Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: e6d2bbd73e25
- TestExplain_CheckpointNotFound: verify error for nonexistent checkpoint - TestExplain_CheckpointMutualExclusivity: verify mutual exclusivity - Renamed TestExplain_BothFlagsError -> TestExplain_MutualExclusivity - Updated error message check to 'cannot specify multiple' Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 9e5aa3277660
Use sb.Write(result.Transcript) instead of sb.WriteString(string(...)) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: e6d2bbd73e25
- Add --checkpoint flag to short and long descriptions - Document tiered verbosity levels (default, --verbose, --full) - Note mutual exclusivity of --session, --commit, --checkpoint Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: e6d2bbd73e25
Add commitMessage parameter to formatCheckpointOutput function. In verbose/full mode, if a commit message is found for the checkpoint, display it in a 'Commit:' section. The commit message is looked up by searching git history for commits with an Entire-Checkpoint trailer matching the checkpoint ID. Tests: - TestFormatCheckpointOutput_Verbose: verifies commit message is shown - TestFormatCheckpointOutput_Verbose_NoCommitMessage: verifies no section when commit message is empty - TestFormatCheckpointOutput_Full: verifies commit message in full mode Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: e12c3e2b3f2a
Reorder verbose output sections: 1. Commit message (if available) 2. Files 3. Prompts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 48cfe773289f
Replace sb.WriteString(fmt.Sprintf(...)) with fmt.Fprintf(&sb, ...) for more efficient writes without intermediate string allocation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: ba5e23ccb05b
…put-checkpoint-flag
…put-checkpoint-flag
Instead of failing with "session not found" when the current session has no checkpoints yet, show a helpful overview listing available sessions that the user can explore. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 737e6e3ea2ad
Replace session-focused default with branch-focused view showing all checkpoints grouped by date. Includes [Task] and [committed] indicators, session prompts, and consistent formatting. - Add formatBranchCheckpoints with date grouping - Extract magic numbers to named constants - Update integration tests for new behavior Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 0999195c12b1
…put-checkpoint-flag
Update explain.go and explain_test.go to use the new id.CheckpointID type instead of raw strings for checkpoint IDs: - Change function signatures to take id.CheckpointID - Use trailers.ParseCheckpoint instead of paths.ParseCheckpointTrailer - Use id.MustCheckpointID in tests for type safety - Change checkpoint.TokenUsage to agent.TokenUsage Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: c1c35c964733
…filtering Query checkpoints directly from the checkpoint store instead of through strategy.GetRewindPoints(). On feature branches, only show checkpoints unique to that branch (not reachable from main). On main branch, show all checkpoints up to limit. Fixes issue where checkpoints from main appeared after merging main into a feature branch. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 8ccdd0fbae20
- Group commits by checkpoint ID instead of showing one line per commit - Show prompt once per checkpoint (quoted for actual prompts, unquoted for "(no prompt)") - Remove [committed] indicator (only show [temporary] for uncommitted checkpoints) - Include date on every commit line (MM-DD HH:MM format) - Show git SHA in parens followed by commit message - Count shows unique checkpoints, not total commits - Remove unused dateGroupFormat and timeFormat constants Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: f9df612e4bbe
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: f9df612e4bbe
Temporary checkpoints store their metadata (including prompt.txt) in the shadow branch commit tree, not in the entire/sessions branch. This fix reads the prompt from the correct location. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: f5dab3d95bc1
Add hasCodeChanges() function to filter temporary checkpoints that: - Have no parent (first commit on shadow branch = baseline copy) - Only modify .entire/ metadata files (transcript saves without code changes) This keeps the explain output focused on meaningful code changes rather than periodic transcript saves. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 326f80f02739
- Use ~sha format (11 chars) for temporary checkpoints to distinguish from committed checkpoint IDs (12 chars) - Add explainTemporaryCheckpoint() to handle `explain -c ~sha` lookups - Read prompts from shadow branch tree for temporary checkpoints Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: c642f15679d1
…y] header - Replace per-commit *sha IDs with single [temporary] group for all uncommitted checkpoints - Show git SHA in parentheses for individual commits within the group - Update -c flag to try committed checkpoints first, then fall back to temporary by git SHA prefix - Remove redundant [temporary] indicator when group ID is already "temporary" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: f0ae7ca930f0
- Replace --verbose flag with --short flag - Default checkpoint view now shows prompts, files, and commit message - Use --short (-s) to get summary-only view - Update help text to reflect new defaults Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update help text to reflect default branch view behavior - Add ambiguous prefix detection for committed checkpoints - Add ambiguous prefix detection for temporary checkpoints - Fix isTask flag not updated in groupByCheckpointID loop - Fix misleading "Log error" comment - Use repo-aware strategy.IsOnDefaultBranch instead of cli helper - Add nil check in runExplainCommit for ReadCommitted result - Replace truncateString with strategy.TruncateDescription - Make TestRunExplainCheckpoint_NotFound hermetic (create temp repo) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: f9f6f611b469
…put-checkpoint-flag
Previously, all temporary checkpoints were grouped under a single "temporary" group, losing per-session prompt information. Now they are grouped by session ID, preserving each session's prompt. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use Committer.When instead of Author.When for RewindPoint.Date to match git log traversal ordering (rebases can cause mismatch) - Log errors from getBranchCheckpoints instead of silently swallowing - Update group.prompt if first point has empty prompt but later has one - Remove stray // line in GetDefaultBranchName doc comment - Fix test message from --verbose to --full - Return informative error for ambiguous temporary checkpoint prefixes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 326f190bd6e7
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
- Capitalize [task] to [Task] for consistency with other CLI output - Consolidate isAncestorOf to strategy/common.go (fixes missing iter.Close() in auto_commit.go version) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 33b1e1e1b51d
- Return error for ambiguous temporary checkpoint prefixes (consistent with committed checkpoint behavior, exits non-zero) - Add missing IsTaskCheckpoint/ToolUseID/Agent fields from cpInfo to RewindPoint - Convert test log-only checks to real assertions for detached HEAD and filtering - Optimize branch filtering: precompute reachable-from-main set once instead of calling IsAncestorOf per commit (O(N+M) instead of O(N*M)) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: be671ddd7286
- Rename TestFormatCheckpointOutput_Default to _Short (test was actually testing verbose=false, not CLI default which is verbose=true) - Use GetDefaultBranchName() for branch filtering in getBranchCheckpoints() to handle repos with non-standard default branches (trunk, develop, etc.) - Use store.GetTranscriptFromCommit() for temp checkpoint transcript reading to handle chunked and legacy transcript layouts - Fix GetDefaultBranchName() to use resolved=false to properly read symbolic refs like origin/HEAD - Add test for origin/HEAD symbolic ref path in GetDefaultBranchName Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: fe0dc62dd084
- Make --short and --full flags mutually exclusive to prevent contradictory output - Search ALL shadow branches when looking up temporary checkpoints by SHA prefix, not just the shadow branch for current HEAD (fixes lookups when HEAD advanced) - Include temporary checkpoints from all reachable shadow branches in branch view, filtering by whether base commit is in HEAD's history - Handle unborn HEAD (no commits yet) gracefully instead of erroring Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 12215e9ee4bf
khaong
approved these changes
Jan 29, 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.
Note
Medium Risk
Changes
explain’s default behavior and adds new checkpoint lookup paths that traverse git history and shadow branches, which could affect performance and edge-case correctness on unusual repos. No auth/security-sensitive logic is touched.Overview
entire explainnow defaults to a branch checkpoints view instead of requiring an active session, listing committed and reachable temporary (shadow) checkpoints grouped by checkpoint/session and filtered against the repo’s default branch.Adds
--checkpoint/-cto explain a single checkpoint by ID or prefix, with--shortand--fullverbosity (including transcript output), and improves commit explain to recognizeEntire-Checkpointtrailers and backfill session IDs via checkpoint metadata.Refactors default-branch/ancestry detection into shared strategy helpers (
GetDefaultBranchName,IsOnDefaultBranch,IsAncestorOf) and extends the checkpoint store withListAllTemporaryCheckpoints; updates and expands unit/integration tests accordingly.Written by Cursor Bugbot for commit 387eacf. This will update automatically on new commits. Configure here.