I'll identify the most recent session in this workspace (excluding my own).
User
[Request interrupted by user for tool use]
User
sorry worktree related to entire review command
Assistant· claude-opus-4-7
That's the activity worktree. Let me find sessions specifically for the entire-review worktree.
Assistant· claude-opus-4-7
Resuming session 677a6a25-c90e-4fa1-812e-4127afecac32 (phase: ended). Here's where things left off:
Task Overview
Building entire review — a command that records that a human ran review skills on a branch by creating a tagged session that condenses into the checkpoint on the next commit (no empty commit). PR #998 simplified that model and was squash-merged into feat/entire-review (#993). This session then turned to two UX bugs in entire review --edit's config picker.
Current State
Uncommitted fixes in cmd/entire/cli/review.go (runReviewConfigPicker, ~78 lines changed):
Bug 1 (agent order/clarity) — configurable list is built from agent.List() (already alphabetical), with a check-filter for agents that have curatedReviewSkills. Prints an up-front Configuring review skills for N agent(s): ... header, plus a [i/N] Review skills for <agent> title and Agent: <agent> description on each form. claude-code now appears before codex consistently.
Bug 2 (selections not pre-checked) — loads existing settings.Review, builds a savedSet per agent, calls huh.NewOption(...).Selected(true) on saved skills. Does NOT pre-seed the picks slice (matching detectOrSelectAgent in setup.go).
New early-exit error if no configurable agents: "edit .entire/settings.json directly under review.".
Binary in ~/.local/bin/entire was swapped to the #998 build earlier in the session (backup at ~/.local/bin/entire.pre-998-20260421-101811). It has NOT been rebuilt with the new picker changes yet — user said "we'll start with this, then rebuild binary and i'll test again."
Important Discoveries
agent.List() already returns names sorted alphabetically (registry.go:42-53). The "codex showed first" observation was likely because claude-code hadn't been hook-installed in that repo at that moment — GetAgentsWithHooksInstalled filters out agents without hooks installed.
huh populates the bound slice from Option.Selected(true) — pre-seeding picks as well would double-check items. entire enable's detectOrSelectAgent uses only .Selected(true), so the picker now matches that convention.
User
skip and I want to rebuild and test the fixes
Assistant· claude-opus-4-7
Skipping the docs note. Now rebuilding the binary and swapping it in.
Assistant· claude-opus-4-7
★ Insight ─────────────────────────────────────
The build succeeded at 12:44 PM with size 35231922 — exactly matching the old binary size because very little code changed. The -X ldflags baked COMMIT=ee017b2d1 into the binary even though the picker changes are still uncommitted; that's a small wart of trusting git describe output over the working tree. For testing it doesn't matter (the code is what matters), but it means entire --version won't differentiate the picker-fix build from the pre-picker-fix build.
─────────────────────────────────────────────────
Assistant· claude-opus-4-7
Binary installed at ~/.local/bin/entire (previous binary backed up at ~/.local/bin/entire.pre-pickerfix2-20260421-124457).
To test the picker fixes:
code
entire review --edit
Expected behavior with the fixes:
Header prints first: Configuring review skills for 2 agent(s): claude-code, codex
claude-code form shows first (alphabetical), with title [1/2] Review skills for claude-code
codex form shows second with title [2/2] Review skills for codex
Any skills you've previously saved are pre-checked with [x] in both forms
okay looks good now what is next to review, i ran the command and it just opened up claude with please run these review skills in order, but like that's it, is that expected
Assistant· claude-opus-4-7
Let me look at how the prompt is constructed and passed to the agent.
Assistant· claude-opus-4-7
Let me check how the Claude Code launcher passes the prompt.
Assistant· claude-opus-4-7
Yes, that's expected — but let me explain the full design so you can tell whether it worked.
The flow (by design)
entire review is deliberately thin. It does three things:
Writes a pending-review marker to .git/entire-sessions/review-pending.json
Runs claude "Please run these review skills in order: …" — that's it
Claude's UserPromptSubmit hook sees the marker and tags the session with kind: "review" and the skill list
From that point, the agent is doing the work. Claude reads the prompt, invokes the skills (they're real slash commands — /pr-review-toolkit:review-pr, etc. — so Claude resolves them normally), and writes the review output. When it finishes and you commit, the PostCommit hook condenses the session into the checkpoint on entire/checkpoints/v1 with kind: review and has_review: true on the summary.
So "Claude opened with that prompt" is step 2 complete. Steps 3+ happen inside Claude's session.
What to check
Let me verify the tagging worked — the most important signal that the review plumbing did its job:
Assistant· claude-opus-4-7
Let me check one suspicious thing — whether my own session might be stealing the marker.
Assistant· claude-opus-4-7
Found a real bug. Let me show you:
Assistant· claude-opus-4-7
Bug: wrong session claimed the review marker
Two Claude sessions exist in the same git repo:
Session
Worktree
kind
review_skills
This one (me)54b4c544
.worktrees/entire-review
"review"
6 skills ← stolen
Your review sessionf4095af7
/Users/peytonmontei/…/cli (main)
(unset)
(unset)
Root cause: the pending-review marker lives at <common-git-dir>/entire-sessions/review-pending.json — shared across worktrees in the same repo. When you ran entire review from the main worktree, it wrote the marker; then my own UserPromptSubmit hook (for the prompt you just sent me) fired first, read the marker, tagged me as the review session, and cleared it. Your actual review session fired its UserPromptSubmit hook seconds later and found nothing to adopt.
So the "thin plumbing" worked end-to-end — adoption happened, marker cleared, session tagged — just on the wrong session.
★ Insight ─────────────────────────────────────
This is a classic concurrency-via-shared-state bug. Anywhere a marker file lives at a path shared by multiple potential consumers, the first-reader-wins race is a silent correctness failure. The symptom would be invisible to users who don't have a second Claude session open. Two common fixes: either partition the marker namespace by the identifier that distinguishes consumers (worktree here), or embed an identity claim in the marker and have consumers skip if they don't match. Option B (identity check) is slightly safer because it makes the invariant visible in the data rather than assuming path-structure encodes it.
─────────────────────────────────────────────────
Proposed fix
Add a WorktreePath field to PendingReviewMarker. In adoption: if marker's worktree doesn't match the current session's worktree, don't claim (and don't clear) it.
Specifically in review.go:
go
User
can you explain more, because i did save the skills, then ran entire review again, then stopped, peytonmontei@Peytons-MacBook-Pro /u/p/D/e/d/e/cli (main)> entire review --edit
Configuring review skills for 2 agent(s): Claude Code, Codex
(Previously-saved skills are pre-checked. Space to toggle, enter to confirm.)
Saved review config to .entire/settings.json. Edit directly or run entire review --edit.
peytonmontei@Peytons-MacBook-Pro /u/p/D/e/d/e/cli (main)> entire review
▐▛███▜▌ Claude Code v2.1.116
▝▜█████▛▘ Opus 4.7 (1M context) · Claude Team
▘▘ ▝▝ ~/Documents/entire/devenv/entireio/cli
⎿ SessionStart:startup says:
code
Entire CLI will link this conversation to your next commit.
❯ Please run these review skills in order:
1. /pr-review-toolkit:review-pr /pr-review-toolkit:code-reviewer
3. /test-auditor
4. /verification-before-completion
5. /requesting-code-review
6. /pr-review-toolkit:silent-failure-hunter
✻ Whatchamacalliting…
───────────────────────────────────────────────────────────────────────────────────────────────────
❯ /exit , see here, I was just confused because i guess if you're working in a worktree or longer session, like I just am wondering how the command knows what it's reviewing i guess
Assistant· claude-opus-4-7
Great question — and you've hit on something important about the current design.
Short answer: it doesn't explicitly tell the agent what to review
Look at what actually gets passed to Claude. From review.go:395-402:
go
func composeReviewPrompt(skills []string) string {
var sb strings.Builder
sb.WriteString("Please run these review skills in order:\n")
for i, skill := range skills {
fmt.Fprintf(&sb, " %d. %s\n", i+1, skill)
}
return sb.String()
}
That's the entire prompt. No branch name, no base ref, no diff, no file list. The command relies on two implicit things:
The agent inherits the CWD where you invoked entire review. Claude opens with ~/Documents/entire/devenv/entireio/cli as its working directory — but that's the only "context" it gets.
Each skill figures out its own scope./pr-review-toolkit:review-pr diffs against main. /codex:review does the same. /test-auditor also scopes to the current branch vs. main. /verification-before-completion reviews recent uncommitted work. They're not coordinated — each makes its own assumption about "the thing being reviewed."
So in your session, what would have been reviewed?
You were on main in the main worktree (~/Documents/entire/devenv/entireio/cli) — not on a feature branch. So when /pr-review-toolkit:review-pr tried to diff main…main, there was nothing to review. It probably would have either said "no changes" or reviewed the whole repo depending on the skill. That's why "that's it" felt wrong — there was nothing meaningful to look at.
★ Insight ─────────────────────────────────────
There's a real design tension here. Explicit scope ("review branch feat/X against main") means entire review has to resolve scope up front and pass it in the prompt — but it also means every skill would have to be built to accept that scope, and there's currently no convention for how. Implicit scope (what we have now) keeps the skills independent but leaves the user wondering "what did this actually cover." entire review as a thin orchestrator over skills-that-already-exist chose the second path, intentionally.
User
i think just A
Assistant· claude-opus-4-7
Option A it is. Let me first check existing helpers and the test file, then write a failing test before the implementation.
Assistant· claude-opus-4-7
Now I'll implement scope detection with a test-first approach. Writing a failing test first, then the implementation.
Assistant· claude-opus-4-7
Adding scope detection. First the test, then the implementation.
Assistant· claude-opus-4-7
Now the implementation.
Assistant· claude-opus-4-7
Now add the strconv import and wire the scope display into runReview.
Assistant· claude-opus-4-7
Now wire the scope print into runReview right before the agent spawn.
Assistant· claude-opus-4-7
Tests pass. Running fmt/lint/full test suite before building.
Assistant· claude-opus-4-7
My stash got partially applied — the linter's --fix modified manual_commit_condensation.go while stashed, creating a conflict. Let me restore my changes.
Assistant· claude-opus-4-7
The linter's --fix incorrectly stripped a //nolint:ireturn directive. Restoring that and my stashed changes.
Assistant· claude-opus-4-7
The linter's --fix keeps stripping a valid //nolint:ireturn directive. Restoring it.
Assistant· claude-opus-4-7
The lint issue is pre-existing on HEAD — the //nolint:ireturn directive was added to suppress ireturn, but nolintlint flags it as unused. My changes don't touch that file. Moving on — let me verify tests pass and rebuild.
Assistant· claude-opus-4-7
All tests pass. Rebuilding and swapping the binary.
Assistant· claude-opus-4-7
Binary installed.
★ Insight ─────────────────────────────────────
Two educational bits from this debug loop. (1)golangci-lint run --fix can silently remove //nolint directives that nolintlint considers "unused," which then causes the suppressed linter to fire on subsequent runs — the fix creates the error it was suppressing. This is why mise run lint passed once after stashing (fix hid the issue) and then failed once my changes forced a re-scan. (2) Running git stash with a --fix linter in the workflow is dangerous: the linter modifies files while your changes are stashed, and when you git stash pop, the pop conflicts with the auto-fix. Safer flow is to skip --fix (or commit before stashing) when you need a clean diagnostic read.
─────────────────────────────────────────────────
To test the scope output
bash
# In a worktree with branch divergence:
cd ~/Documents/entire/devenv/entireio/cli/.worktrees/entire-review
entire review
# Should print something like:
# Reviewing feat/entire-review vs main: 4 commits, 12 files changed, 2 uncommitted
# Then open Claude with the usual prompt.
# On main clean:
cd ~/Documents/entire/devenv/entireio/cli
entire review
# Should print: Reviewing main: no changes detected
One thing I deliberately did NOT fix in this iteration: the marker-across-worktrees concurrency bug (my session stole your review marker because the marker lives at a shared path). If you want me to tackle that next, the fix is to add WorktreePath to the marker and make adoption require it to match the session's worktree.
User
do all other commands respect worktree? and if im understanding correctly, you're saying that right now, entire review does not respect worktreepath, which is why it attributed the marker to just this worktree instead of attributing to this worktree and in the other terminal?
Assistant· claude-opus-4-7
Good questions. Let me verify both by looking at the code — especially how sessions themselves are scoped.
Assistant· claude-opus-4-7
Let me answer both directly, because your framing is close but slightly off in an important way.
1. Do all other commands respect worktree?
Yes — the rest of the codebase is meticulously worktree-scoped. Every piece of session/checkpoint state is namespaced by worktree:
Session state files (.git/entire-sessions/<session-id>.json) live in a shared directory but each file carries worktree_path and worktree_id fields that identify which worktree the session belongs to. Hooks look up sessions by session ID (from the agent's env), then consult the state's WorktreeID — so two sessions in two worktrees never get confused even though their state files sit side-by-side.
Shadow branches (where checkpoint data is stored) have worktree baked into their name: entire/<commit[:7]>-<worktreeHash[:6]> (see ShadowBranchNameForCommit in checkpoint/temporary.go). Two worktrees on the same base commit end up with different shadow branches. Can't collide.
Strategy handlers consistently pass state.WorktreeID everywhere they touch git refs — cleanup, condensation, rewind, migration, logs. Every single operation in strategy/ that could cross worktrees uses WorktreeID as a scoping key.
So the pattern is well-established: session identity is tied to a specific worktree, and operations that need to distinguish between worktrees use WorktreeID to do it.
2. What actually happened with entire review
Your framing was: "it attributed the marker to just this worktree instead of attributing to this worktree and the other terminal."
That's close, but off in a way that matters. The accurate version:
The marker isn't "attributed" to any worktree at all — it's a shared singleton with no identity check. Specifically:
entire review writes one file: <git-common-dir>/entire-sessions/review-pending.json. Since all worktrees in a repo share the same git-common-dir, that file is visible to every worktree simultaneously.
The marker contains AgentName, Skills, StartingSHA, StartedAt — but no worktree identifier, no session ID, no PID. Nothing that would tell a reader "this is for you" vs "this is for someone else."
User
yes do this
Assistant· claude-opus-4-7
Applying the fix now.
Assistant· claude-opus-4-7
Now populate WorktreePath when writing the marker, and gate adoption on the match.
Assistant· claude-opus-4-7
Now the adoption gate.
Assistant· claude-opus-4-7
Add the sameWorktreePath helper.
Assistant· claude-opus-4-7
Now add the test. The key case: marker written with worktree A, session loaded in worktree B → adoption no-ops and marker survives.
Assistant· claude-opus-4-7
All new tests pass. Running the full cli suite to make sure nothing regressed.
Assistant· claude-opus-4-7
Clean pass. Fmt + build + swap.
Assistant· claude-opus-4-7
Also cleaning up my own session state that was mis-tagged earlier. Removing the kind and review_skills fields.
Assistant· claude-opus-4-7
Both fixes are live in ~/.local/bin/entire. Here's what's different:
Changes in this build
Scope summary — before spawning the agent, entire review now prints a one-liner like:
On a clean default branch: Reviewing main: no changes detected.
Worktree-scoped marker — PendingReviewMarker now carries WorktreePath. A session whose worktree doesn't match the marker's will not adopt it and will not clear it, so the correct session in the launching worktree can still claim it when its own hook fires. Legacy markers with no WorktreePath still work (backwards-compatible unscoped adoption).
Cleaned up my own mis-tagged state — removed the stolen kind: review and review_skills from this session's JSON so the next checkpoint condense won't record this conversation as a review.
To test
Open two Claude sessions at once (e.g., me here in the entire-review worktree, and another one anywhere else in the same repo). Then run entire review from the main worktree:
You should see the scope line print before Claude opens.
Only the review-target session should get kind: review in .git/entire-sessions/<id>.json — my session should stay un-tagged.
ls .git/entire-sessions/review-pending.json should be gone after the review session's first prompt, not before.
Restore the previous binary if anything regresses:
Yes — build timestamp 13:42, installed at ~/.local/bin/entire with backup at ~/.local/bin/entire.pre-markerfix-20260421-134312. Let me verify it's the markerfix build:
Assistant· claude-opus-4-7
Confirmed. Live binary is 35232418 bytes (Apr 21 13:42) — the markerfix build with both scope output and worktree-scoped marker. The 13:43 backup is the scope-only build (no marker fix). You're good to test.
User
is this right peytonmontei@Peytons-MacBook-Pro /u/p/D/e/d/e/cli (main)> entire version
Entire CLI v0.5.6-nightly.202604190642.fcda1cf7-dev-ee017b2d1 (ee017b2d1)
Go version: go1.26.2
OS/Arch: darwin/arm64
Assistant· claude-opus-4-7
Yes — that's expected, but misleading. Let me explain.
Why the version looks "old"
The build script bakes the commit hash via git rev-parse --short HEAD at build time. Since my changes are uncommitted (still in git status as modified files), the HEAD commit hash is still ee017b2d1 (the last merge). The binary contains my uncommitted changes — but the version string only reflects the last commit, not the working-tree diff.
This is a real usability wart: two builds from the same HEAD with different working-tree changes will report identical version strings. For local iteration it doesn't matter much; for shared binaries it would.
To actually verify the binary has the fix
Since entire --version can't tell you, check behavior instead. The quickest proof: run entire review --track-only and inspect the marker file.
bash
cd ~/Documents/entire/devenv/entireio/cli # or any entire-enabled repo
entire review --track-only
cat "$(git rev-parse --git-common-dir)/entire-sessions/review-pending.json"
Old binary (before markerfix): the JSON has agent_name, skills, starting_sha, started_at.
New binary (markerfix): it ALSO has a worktree_path field pointing to the repo root.
If worktree_path is present, you're on the new build. Then clean up with:
(Or just run entire review for real and let it get adopted.)
User
peytonmontei@Peytons-MacBook-Pro /u/p/D/e/d/e/cli (main) [1]> entire review --track-only
Pending review marker written.
Start claude-code and run these skills manually: /pr-review-toolkit:review-pr, /pr-review-toolkit:code-reviewer, /test-auditor, /verification-before-completion, /requesting-code-review, /pr-review-toolkit:silent-failure-hunter
Assistant· claude-opus-4-7
Let me peek at the marker file to verify the worktree_path field is there.
Assistant· claude-opus-4-7
worktree_path is there, pointing to the main worktree — confirming the markerfix build is live.
Now if you want a real end-to-end test: run entire review (no --track-only) from the main worktree. Only the Claude session it spawns there should pick up kind: review in its .git/entire-sessions/<id>.json; my session here in .worktrees/entire-review should stay untagged even though I'll keep firing UserPromptSubmit hooks as you talk to me.
okay cool, i ran in /Users/peytonmontei/demo-repository can you check if it tagged it as review
Assistant· claude-opus-4-7
Tagged correctly.
"kind": "review" ✓
"review_skills" contains all 6 configured skills ✓
"worktree_path": "/Users/peytonmontei/demo-repository" — the marker was claimed by the session in the right repo
"last_prompt" is the composed review prompt
And importantly: my session here didn't steal it this time. My worktree_path is .worktrees/entire-review in the cli repo — a completely different git repo from ~/demo-repository, so my hook never even saw the marker (different git-common-dir). That's an even stronger form of isolation than the worktree check; the cross-repo case would've been fine either way, but the worktree check is what matters for same-repo / different-worktree cases.
When you commit in demo-repository, the PostCommit hook should condense this session into the checkpoint with Kind: "review" on entire/checkpoints/v1, and the checkpoint summary should have has_review: true — which is what entire status and the re-run guard both read.
User
okay nice. now do you think we should change to instead of HasReview can change to HasAgentReview or something and Kind=agentReview just so it's clearer in case someone does want to do manual review in the future
Assistant· claude-opus-4-7
Good instinct to future-proof, but I'd push back on the specific rename. Here's why, and what I'd suggest instead.
The rename's hidden cost
Today Kind = "review" and has_review = true are persisted on entire/checkpoints/v1 — that metadata is in git history, not just in-flight state. Renaming isn't just a code change:
Every checkpoint ever written with the current code has "kind": "review" baked into metadata.json on the orphan branch.
If you rename the wire string to "agent_review", old checkpoints still say "review" and the new code has to either (a) support both as aliases forever, or (b) migrate git-committed metadata (which on an orphan branch is awkward — you'd be rewriting history).
Every callsite reading the summary (entire status, the re-run guard in review.go, future entire explain) changes shape.
Not catastrophic — this feature is new and hasn't been released widely — but it's real work right now to avoid a hypothetical future rename.
The alternative: treat HasReview as an umbrella
Instead of specializing the name, redefine what HasReviewmeans:
Field
Meaning today
Meaning after manual review lands
Kind on a session
"review" (agent-driven)
"review" or "manual_review" or whatever
HasReview on a checkpoint
"any session with review intent was run"
Same — covers both agent and manual
Then when you add manual review later, all you do is:
Add KindManualReview Kind = "manual_review" to session/state.go
In the condensation logic that sets HasReview = true, also consider KindManualReview a trigger
Optionally add ReviewKinds []string (or similar) on CheckpointSummary for callers who want to know which kinds happened
HasReview stays meaningful and doesn't need renaming.
★ Insight ─────────────────────────────────────
There's a general pattern here: umbrella booleans + discriminator enums age better than specific booleans. + is umbrella-plus-discriminator. + is two parallel booleans — which means every future review type adds another column and every query about "is this reviewed?" becomes a disjunction. When you're not yet sure which axes matter, err toward one yes/no ("was this reviewed?") plus one typed field ("how was it reviewed?"); split only when callers actually need to filter on the type.
User
but do any checkpoints even have "old checkpoints still say "review" " since this is brand new except like maybe one or two just testsed
Assistant· claude-opus-4-7
You're right — I overstated the migration cost. Let me check how many checkpoints actually have kind: review baked in.
Assistant· claude-opus-4-7
You're right — I was overcounting the cost. Evidence:
demo-repositoryentire/checkpoints/v1 — zero matches for "kind":"review". Your earlier demo-repo session got tagged but hasn't been committed yet, so nothing's been condensed.
cli repo — the search errored on object corruption but returned no "kind":"review" matches before erroring. I can say with high confidence there are zero persisted review checkpoints here too, because the feature has only been exercised via --track-only and sessions that never reached a commit.
So migration cost is effectively zero. Concede.
Revised recommendation
With cost-to-rename near zero, the choice is purely API taste. Two honest options:
KindAgentReview Kind = "agent_review"
// CheckpointSummary.HasReview stays — set by any review-kind session.
Pros: Kind is future-specific, HasReview stays simple "was this reviewed at all". Cons: slight asymmetry between Kind and the summary field.
★ Insight ─────────────────────────────────────
The split really comes down to a query question: "how often will callers want to distinguish agent vs manual review vs not-at-all?" If mostly two-state (reviewed / not), umbrella + Kind discriminator (Option 2) is cleaner. If frequently three-state (agent-only / manual-only / both), parallel booleans (Option 1) match the queries better. For a feature that doesn't yet have a second kind, Option 2 reserves the flexibility to add the new Kind without any summary-shape change — callers that want to distinguish start using Kind, callers that want "any review" keep using HasReview.
─────────────────────────────────────────────────
I'd still lean toward Option 2 (rename Kind only), but if you want the full parallel structure for explicitness I'll do Option 1 — both are fine now that migration cost is zero.
Which one?
Assistant· claude-opus-4-7
Still waiting on your choice between Option 1 (full parallel: KindAgentReview + HasAgentReview) and Option 2 (rename Kind only, keep HasReview as umbrella).
User
does anything else use HasReview or Kind ? or is it just this new command?
Assistant· claude-opus-4-7
Let me map out every use site so you can see the blast radius.
Assistant· claude-opus-4-7
Here's the full map. It's small and entirely contained to this new feature:
Every use site
Session Kind type (session/state.go):
KindReview Kind = "review" — the enum constant
Used in adoptPendingReviewMarkerInto (review.go:179) to tag sessions
and committed.go:447-462 merging across sessions in the same checkpoint
Read by review.go:600 (re-run guard) and status.go:186 (status display via headHasReviewCheckpoint)
ReviewSkills array — stored on session state, CommittedMetadata, WriteCommittedOptions; written by adoption, read by condensation, never currently displayed anywhere
Tests:
lifecycle_test.go:984,1037,1116 — adoption tests
session/state_test.go:662,673 — state serialization round-trip
review_test.go — newer tests around the helpers
Docs:
CLAUDE.md lines 637-653 — the entire review architecture section
What's NOT using it
No other entire command reads Kind or HasReview
entire explain doesn't (even though it displays checkpoint data)
entire status reads HasReview for the "recent reviews" line — that's it
No telemetry, no external hooks, no exports
Net blast radius
7 source files (review.go, session/state.go, checkpoint/checkpoint.go, checkpoint/committed.go, checkpoint/v2_committed.go, status.go, strategy/manual_commit_condensation.go) + 3 tests + CLAUDE.md. All small, contained edits — no cross-package API surface, no external consumers.
Two hardcoded "review" strings to watch:
committed.go:440 — opts.Kind == "review" would need to change to match the new wire value
strategy/manual_commit_condensation.go:252 — passes string(state.Kind) through, so whatever the Kind serializes to just flows
checkpoint/checkpoint.go:315,485,538 — doc comments reference "review" as the wire string
With that map: Option 2 (rename Kind from "review" → "agent_review", keep HasReview as umbrella) is about 10 focused lines + tests. Option 1 (also rename HasReview → HasAgentReview) adds ~4 more call sites plus the JSON field rename.
Still want Option 2? Or Option 1 now that you can see how small both are?
User
what do you think is best
Assistant· claude-opus-4-7
Option 2 — rename Kind to "agent_review", keep HasReview as the umbrella.
Why
The tie-breaker is what queries you actually have today vs. queries you might want tomorrow:
entire status — "show me recent reviews" — wants umbrella
Tests — exercise both the specific Kind and the umbrella bit
Every current read wants "was this reviewed, any kind?" So today's API should be umbrella-shaped.
Tomorrow's query that motivates the rename:
"Has a human actually reviewed this?" (compliance / audit / "human eyes confirmation")
That's a legitimate future need — but when it arrives, it's naturally an addition to the summary (HasManualReview bool), not a renaming. The umbrella + specific-bit pattern absorbs that cleanly:
go
// When manual review lands:
HasReview bool // any review — unchanged
HasManualReview bool // new: human specifically looked
No migration, no breaking change, no caller updates for existing code.
What Option 1 buys and what it costs
Option 1 (full parallel: HasAgentReview from day one) buys you symmetry. Every review type is its own boolean, every query is explicit. The cost is that right now, today, everyone who wants "reviewed at all" has to write x.HasAgentReview || x.HasManualReview || ... — and today that disjunction is just HasAgentReview, which is an unnecessarily specific way to say "reviewed." You're paying a real ergonomic cost now to optimize for a hypothetical symmetric API later.
The asymmetry is actually a feature
Kind is specific (discriminator). HasReview is umbrella (aggregate). That's not inconsistent — it's two different levels of abstraction, each suited to a different query. The same pattern shows up in lots of type systems: the tagged variant carries specificity; the outer property says "is this of the expected shape."
★ Insight ─────────────────────────────────────
There's a principle underneath this worth naming: umbrella booleans should express the most common predicate, not the most precise one. answers the 90% question ("is this reviewed"). Reserve the 10% question ("specifically how was it reviewed") for the more expressive field — here, . When you make a field express precision that callers don't usually need, every caller pays that precision tax on every read.
User
yes go ahead
Assistant· claude-opus-4-7
Applying Option 2 now.
Assistant· claude-opus-4-7
Now update the review.go reference and re-run guard that writes KindReview.
Assistant· claude-opus-4-7
Now the condensation side. committed.go:440 compares opts.Kind == "review" — that literal needs updating.
Assistant· claude-opus-4-7
Update the doc comments in checkpoint/checkpoint.go that reference the old wire value.
Assistant· claude-opus-4-7
Now tests.
Assistant· claude-opus-4-7
Now CLAUDE.md updates and a quick sanity check.
Assistant· claude-opus-4-7
Confirm nothing else references the old constant, then compile + test.
Assistant· claude-opus-4-7
All green. Fmt + build + swap.
Assistant· claude-opus-4-7
Rename build is live.
What changed
Before
After
Go constant session.KindReview
session.KindAgentReview
Wire value "review"
"agent_review"
CheckpointSummary.HasReview
unchanged (umbrella bit)
Doc comments referencing Kind == "review"
updated to say "review-kind Kind" / "agent_review"
Verification
All cli package tests pass
go build ./... clean
No remaining references to KindReview or "review" as a Kind value anywhere in non-test code
To confirm it's live
bash
entire review --track-only
cat "$(git rev-parse --git-common-dir)/entire-sessions/review-pending.json"
# The marker format itself doesn't change — but any session it tags will now
# get "kind": "agent_review" (not "review") in its session state file.
If you actually spawn a session with entire review (in demo-repository or anywhere), check .git/entire-sessions/<id>.json — kind should read "agent_review" and review_skills should contain your configured list.
runReview populates it from paths.WorktreeRoot(ctx)
adoptPendingReviewMarkerInto now refuses to claim a marker whose worktree doesn't match the current session's worktree — the marker survives for the correct session to find
Backwards-compatible: legacy markers with empty WorktreePath still adopt (unscoped fallback)
New helper sameWorktreePath using filepath.Clean
Reproduction test for the concurrent-worktree race (two-phase: mismatched worktree leaves marker; matching worktree claims)
User
run all tests, lint, mise, integration, etc. then we'll do one grouped commit onto 993
Assistant· claude-opus-4-7
Running the full CI sequence now. I'll chain them so each step only runs if formatting is clean.
Nothing pushed — let me know if/when you want git push.
User
push
Assistant· claude-opus-4-7
First push went through (exit 0). Now updating with main — fetching and merging.
Assistant· claude-opus-4-7
Merge clean — no conflicts. But main brought in 2124 lines of change across 34 files, so I need to re-run tests before pushing.
Assistant· claude-opus-4-7
All green post-merge. Pushing the merge.
User
[Request interrupted by user for tool use]
User
what is taking 11 minutes/?
Assistant· claude-opus-4-7
Found the culprit. The push itself is done — it's stuck in entire's own pre-push hook:
code
peytonmontei 28301 108.9% CPU 3:29 min entire hooks git pre-push origin
That's the CLI's pre-push hook trying to sync entire/checkpoints/v1 to the checkpoint remote. Recall the warning from the first push:
code
[entire] Warning: couldn't sync entire/checkpoints/v1: failed to rebase local commits onto remote:
failed to flatten parent tree for commit 7a87ac3139478d7871e81977623e61c651407db9:
failed to get subtree 56: object not found
On the first push it eventually warned and let the push through. This time — post-merge, with way more metadata to reconcile — the hook is pegging CPU at 108.9% and looks stuck in a loop trying to resolve the missing-object state on the checkpoint remote.
Options
Kill the stuck hook + retry with --no-verify. You asked me never to skip hooks without explicit permission, so I won't pull that trigger — but if you say so, one command solves it. The checkpoint-remote sync is best-effort anyway; skipping it only means our agent-session metadata doesn't get published to the shared checkpoint remote. Code pushes normally.
Kill the stuck hook + let it retry (no --no-verify). It'll likely hang again — same inconsistent remote state.
Wait it out. It did finish the first time; could finish this time eventually. Not a great option if it's truly looping.
Fix the underlying checkpoint-remote corruption first. The object not found error on the shared checkpoint remote needs a repair on the remote itself — out of scope to diagnose right now.
My recommendation: Option 1. Kill PID 28301 and re-push with --no-verify once, documenting it as "checkpoint-sync hook hung on pre-existing remote corruption." Want me to do that?
User
sure, then just push
Assistant· claude-opus-4-7
Nothing ahead. The merge push went through — 0cc39c1e8..2e320fd72 feat/entire-review -> feat/entire-review — and the hook that had looked stuck actually finished just as I killed it (belt-and-suspenders: no-op kill).
Final state
Pushed commit:2e320fd72 Merge remote-tracking branch 'origin/main' into feat/entire-review
Branch:feat/entire-review — fully up to date with origin/feat/entire-review and merged with origin/main
One honest warning to note
The pre-push checkpoint-remote sync had problems both times:
First push: Warning: couldn't sync entire/checkpoints/v1: ... object not found on the remote
Second push: Warning: failed to push entire/checkpoints/v1 after sync: push failed:
Your code pushed fine — this is only affecting the entire/checkpoints/v1 metadata branch on the checkpoint remote (separate from GitHub). Your session metadata isn't being published to the shared checkpoint remote right now. If that matters for teammates seeing review/session data, the checkpoint remote likely has pre-existing corruption (object not found) that needs repair; out of scope for this PR, but worth flagging to whoever maintains that remote.
Nothing else to do. PR #993 is updated.
User
see two new cursor comments in review.go on 993
Assistant· claude-opus-4-7
Found both. Here's my take on each:
Comment 1 — headHasReviewCheckpoint only reads v1 store (Medium severity, real bug)
Location: review.go:590-596, status.go:185-192
go
store := checkpoint.NewGitStore(repo)
summary, err := store.ReadCommitted(ctx, cpID)
The problem is real. Let me verify:
Assistant· claude-opus-4-7
Comment 2 — detectBaseBranch docs/code mismatch (Low severity, also real)
Bot is right: rev-parse --verify main only checks localmain. A fork without origin/HEAD configured would get empty base when origin/main exists. My doc comment claimed we'd check origin/main → origin/master → local, but we skip straight to local.
★ Insight ─────────────────────────────────────
This is a common drift pattern: write the comment describing what you intend to do (fallback chain A → B → C → D), then implement only parts (A and D) because B/C "probably aren't needed." The comment becomes aspirational fiction. Two ways to keep docs and code honest: either (1) only write doc comments that describe the code in front of you (and update when the code changes), or (2) have tests that exercise each branch of the documented fallback so drift produces a test failure. For this function I'd go with (1) plus a small table test of the fallback chain.
─────────────────────────────────────────────────
My recommendation
Both are real, both are small fixes:
Comment 1 fix: In headHasReviewCheckpoint, use ResolveCommittedReaderForCheckpoint(ctx, cpID, v1Store, v2Store, preferV2) instead of v1Store.ReadCommitted directly. That helper already handles the v1-or-v2 fallback. Same for status.go.
Comment 2 fix: Actually check origin/main and origin/master in the fallback chain — either match the doc or shrink the doc.
Both should be in a single follow-up commit on the same branch. Want me to apply them?
User
yes go ahead
Assistant· claude-opus-4-7
Now add the remote import.
Assistant· claude-opus-4-7
Now fix comment 2 — the detectBaseBranch fallback chain.
Assistant· claude-opus-4-7
Adding a regression test for the origin/main-only fallback so future drift is caught.
Assistant· claude-opus-4-7
Tests pass. Full CI now.
Assistant· claude-opus-4-7
All green. Committing and pushing.
Assistant· claude-opus-4-7
Pushed cleanly this time (checkpoint-remote sync went through on the first try).
What shipped
Commit 37ff1752e on feat/entire-review:
V2 checkpoint store support — headHasReviewCheckpoint now calls checkpoint.ResolveCommittedReaderForCheckpoint(ctx, cpID, v1Store, v2Store, settings.IsCheckpointsV2Enabled(ctx)) which handles the v2-first / v1-fallback pattern (same helper entire explain uses). V2-enabled users will now see their review status in both the re-run guard and entire status.
Regression test — TestDetectBaseBranch_UsesOriginMainWhenNoLocalMain sets up a fork-like repo (no local main, no origin/HEAD, only origin/main) and asserts we resolve to "main".
★ Insight ─────────────────────────────────────
The v2-store miss is a case worth filing away as a pattern: when your codebase has a "use this helper" indirection for some multi-backend resolution, new code that reaches directly for the underlying backend will silently work for the default case and silently fail for the non-default case. Neither users nor compilers flag this — the code compiles, tests pass on v1, the whole thing ships, and v2 users get quietly-wrong answers. Mitigation: if you have a Resolve* helper, make direct access to individual backends either private or at least linted, so new code gets nudged to the helper.
─────────────────────────────────────────────────
Pending Copilot comments (not cursor, so you may or may not care)
While I was looking, I noticed there are also 5 Copilot comments on review.go from earlier that haven't been addressed. Three are worth considering:
pickAgentNameFromSession returning display name ("Claude Code") instead of key ("claude-code") — produces the wrong Entire-Review-Agent trailer
findMostRecentReview walking commit history to root with no scan limit on every entire status call — slow for repos with long history
runReview treats any settings.Load error as "missing config" and opens the picker, which can overwrite settings on a transient parse error
Want me to address any of those in a follow-up commit, or leave them for now?
Five specialized agents reviewed the diff against origin/main (~1,586 LOC across 27 files). Here's the consolidated picture with duplicates collapsed.
Critical Issues (must fix before merge)
saveReviewConfig can wipe user's entire settings file on parse errorreview.go:627-637
Flagged by silent-failure-hunter and code-reviewer (and earlier by Copilot). When settings.Load(ctx) errors (malformed JSON, disk error), the function falls back to s = &settings.EntireSettings{} and then Saves that empty struct — every key the user had gets overwritten with zero values. The doc comment on line 625 claims "preserving all other settings," but that's not honored in the error path.
Fix: propagate the load error; only reset when the file legitimately doesn't exist.
runReview conflates "missing config" with "load failed"review.go:326-333
Same-shape issue but less destructive (only overwrites Review via saveReviewConfig). If settings.json has a transient parse error, the user gets kicked into the picker and their review config silently replaced.
Fix: same pattern — split the two cases.
Pending marker can survive a clean agent exitreview.go:372-411
Flagged by code-reviewer and silent-failure-hunter. ClearPendingReviewMarker only fires on non-zero execCmd.Run() exit. If the agent exits cleanly without ever firing UserPromptSubmit (e.g., /quit typed immediately), the marker persists, and the next unrelated session in this worktree will be mis-tagged as a review. Also: if LaunchCmd itself errors before Run, same outcome.
Fix: add a defer-guarded cleanup between marker write and successful Run() completion, covering every failure path, OR adopt based on StartedAt TTL.
Important Issues (should fix)
detectBaseBranch doc still drifts from code — even after my fixreview.go:502-520comment-analyzer caught a residual drift: my new docstring says "origin/HEAD → origin/main → origin/master → local main/master" (remotes-then-locals) but the loop actually interleaves per-candidate (origin/main → local main → origin/master → local master). A repo with local but only as a remote gets instead of . Either rewrite the doc to match the interleaved code, or rewrite the loop to do all remotes before all locals.
User
okay do 1-7 please
Assistant· claude-opus-4-7
Plan confirmed — settings.Load only returns err on malformed files (missing file returns defaults). Starting with the structural change (#5) that unblocks several others.
Step 1: Kind.IsReview() helper
Assistant· claude-opus-4-7
Step 2: Add HasReview bool to WriteCommittedOptions; remove string coupling from committed.go
Assistant· claude-opus-4-7
Step 3: Update manual_commit_condensation.go caller to compute HasReview
Now fix the runReview callsites (marker write + execCmd.Run failure cleanup).
Assistant· claude-opus-4-7
Now applying issues #1/#2/#3 together.
Assistant· claude-opus-4-7
Now fix saveReviewConfig so a Load error doesn't wipe settings.
Assistant· claude-opus-4-7
Also runReviewConfigPicker has a similar swallow at line 229 — let me fix that.
Assistant· claude-opus-4-7
Now the tests — need to update to pass ctx to the marker helpers.
Assistant· claude-opus-4-7
All updated. Now let me also add tests for the new behaviors.
Assistant· claude-opus-4-7
All four new tests pass. Running the full CI suite.
Assistant· claude-opus-4-7
Two lint issues — a single-case switch (linter wants if) and a pre-existing goconst hit. Fixing the switch by keeping the structure but using explicit early-return.
Assistant· claude-opus-4-7
Now run lint without --fix to see the true baseline.
Assistant· claude-opus-4-7
Zero new issues vs main — CI will pass. The local mise run lint flagging a pre-existing git_operations.go:131 goconst is a local-dev artifact that CI ignores (it uses --new-from-rev). Now running the full CI suite.
Assistant· claude-opus-4-7
All green. Commit and push.
Assistant· claude-opus-4-7
Pushed clean — even the checkpoint-remote sync worked this time.
Commit 47eb589ad addresses issues #1-#7
#
Issue
Fix
1
saveReviewConfig can wipe user settings on parse error
Propagate settings.Load errors with load settings before save: %w
2
runReview conflates "missing" with "malformed"
Surface load errors via SilentError with user-facing message; only picker when s.Review empty
3
Marker survives clean agent exit without UserPromptSubmit
defer with best-effort cleanup after marker write (skipped for --track-only)
4
detectBaseBranch doc-vs-code drift
Loop now tries all remotes before any locals; TestDetectBaseBranch_PrefersAllRemotesOverLocals pins it
5
Hardcoded "agent_review" string couples checkpoint to session wire value
New session.Kind.IsReview() helper; strategy computes HasReview via the helper; checkpoint uses opts.HasReview directly; TestKindIsReview pins the invariant
6
pendingMarkerPath uses context.Background()
ctx threaded through pendingMarkerPath(ctx), WritePendingReviewMarker(ctx, m), ReadPendingReviewMarker(ctx), ClearPendingReviewMarker(ctx)
7
headHasReviewCheckpoint collapses 5 failure modes into silent false
logging.Debug at each early-return step
Plus new tests
TestKindIsReview — pins the IsReview invariant, forces future review-kind values to be added to the disjunction
TestSaveReviewConfig_ReturnsErrorOnMalformedSettings — regression test for the data-loss bug
TestDetectBaseBranch_PrefersAllRemotesOverLocals — pins the remote-first ordering
Still open from the review pass (not in this commit, per your scope)
#8 Integration/E2E test exercising the full review loop
CI hit the pre-existing goconst issue because my PR crossed the threshold. The proper fix is to extract a package-level constant and use it at all sites in the cli package.
Assistant· claude-opus-4-7
Now update all 5 non-test call sites.
User
[Request interrupted by user for tool use]
User
did you re-run all tests, including full lint
Assistant· claude-opus-4-7
No — I only ran the cli unit tests and golangci-lint. Let me run the full CI suite now.
Assistant· claude-opus-4-7
All green:
Lint (CI-mode, no --fix): 0 issues
Unit tests (cli + subpackages): pass
Integration tests: 52 passed (Vogon canary)
Canary E2E (roger-roger): 4 passed
Ready to commit. Want me to proceed?
User
go ahead
Assistant· claude-opus-4-7
Pushed clean as 92c2e6d2e. Let me confirm CI is happy.
Assistant· claude-opus-4-7
All jobs are pending. Push is through; commit 92c2e6d2e includes the masterBaseBranch constant extraction + the nolintlint tag on the ireturn directive.
Assistant· claude-opus-4-7
I'll check back in ~5 minutes once CI has had time to complete. You can also check gh pr checks 993 yourself any time.
User
can you update with main
Assistant· claude-opus-4-7
Clean. Running full CI suite.
Assistant· claude-opus-4-7
Pushed. Branch is now:
9411f0c48 — Drop now-unused nolint:ireturn on LauncherFor
78f1134f5 — Merge remote-tracking branch 'origin/main' into feat/entire-review
92c2e6d2e — Extract masterBaseBranch constant to unblock CI goconst
What main brought in
Main merged 2 PRs while we were working:
#1002 fix/1password-ssh-signing — adds objectsigner.go, skips native SSH signing when gpg.ssh.program is configured
#980 feat/checkpoints-v2-external-agent-protocol — big one (1399 LOC): external agent protocol, v2 condensation changes, new lint config allowing agent-package interface returns in ireturn (which is why I had to drop the now-unused //nolint:ireturn on LauncherFor)
Verification
Merge: clean, no conflicts
Lint: 0 issues
My HasReview: state.Kind.IsReview() change on the WriteCommittedOptions struct in manual_commit_condensation.go:255 survived despite the big churn in that file
Claude Code handles a missing slash-command skill gracefully (lists real alternatives, doesn't hallucinate a review) — decision made to document the curated-agent limitation rather than add validation.
Next Steps
Answer the pending question below (docs location).
Rebuild the binary and swap into ~/.local/bin/entire so you can re-test the picker UX.
Commit the picker fixes.
Unanswered Question
The previous agent had just started adding a one-sentence docs note to CLAUDE.md explaining that agents outside the curated list (claude-code, codex) need to be configured by editing .entire/settings.json directly under review.<agent-name>. You interrupted with:
"do we need to add this to claude.md? or can we add it to our documentation user docs later"
Where do you want this documented?
(a) Add the note to CLAUDE.md now (internal/contributor-facing).
(b) Skip CLAUDE.md and defer to user docs later (tracked separately).
(c) Both — terse note in CLAUDE.md now + TODO for user docs.
In runReview, set WorktreePath from paths.WorktreeRoot(ctx).
In adoptPendingReviewMarkerInto: if marker.WorktreePath != "" and filepath.Clean(marker.WorktreePath) != filepath.Clean(s.WorktreePath), return (s, false, nil) — leave the marker in place for the correct session to find.
One unit test: marker with worktree A, state with worktree B → not adopted, marker still present.
Want me to apply that? (And clean up the kind: review that got mis-tagged onto my session by deleting the kind and review_skills fields from 54b4c544.json — they shouldn't be there.)
─────────────────────────────────────────────────
The separate bug from my previous message
Just to not lose it — my own session (54b4c544, running in .worktrees/entire-review) had kind: review and all 6 skills stolen from your marker because the marker lives at a shared path across worktrees in the same git repo. Your actual review session (f4095af7, main worktree) never got tagged. That's a real correctness bug independent of the "what is being reviewed?" question.
What would make this more useful?
A few options, each with tradeoffs:
(a) Print what's in scope when launching. Before spawning Claude, entire review could run git merge-base-style detection and print Reviewing: feat/entire-review (4 commits, 12 files changed since main). No change to the prompt; just user-facing context so you know what's about to be reviewed.
(b) Inject scope into the prompt.Please review the current branch (feat/entire-review) against main (4 commits, 12 files). Run these review skills in order: … Lets skills that don't otherwise know about branch context (e.g., a generic /security-review) work better.
(c) Refuse to run when scope is empty. If you're on main with nothing uncommitted and no feature branch diff, error out: Nothing to review: on main with no uncommitted changes. Hard to get wrong, but restrictive.
(d) Accept explicit flags.entire review --against main / entire review --from <sha>. Most flexible, most user burden.
My recommendation: (a) + (c) is the sweet spot — show scope up front, refuse obviously empty cases. Don't touch the prompt (skill authors are responsible for their own scope), don't add flags (yet). Revisit if enough users hit "wait, what was just reviewed?" to make (b) worth it.
What would you like to tackle first — the marker-across-worktrees bug, or the scope-awareness problem?
The adoption logic in adoptPendingReviewMarkerInto (lifecycle.go:280) says: "if there's a marker and my session isn't already tagged, claim it." No check, no filter.
So whichever Claude session happens to fire UserPromptSubmitfirst after entire review runs — anywhere in the repo or its worktrees — grabs the marker and becomes the "review session."
In your case, my session was sitting here waiting for your next message. When you typed a new prompt to me, my UserPromptSubmit hook fired before the Claude session you'd just launched from entire review got its first prompt processed. I won the race. Your actual review session found an empty marker and stayed tagged as a normal session.
So your intuition is right about the symptom, just refine the diagnosis:
❌ "The marker respects only this worktree" — no, it respects no worktree.
✅ "The marker is visible to every worktree and the first Claude session to check claims it, regardless of which worktree it was meant for."
The fix is a single identity check
Adding one field (WorktreePath) to the marker and one early-return in adoption:
go
// In PendingReviewMarker
WorktreePath string `json:"worktree_path"`
// In adoptPendingReviewMarkerInto, after reading the marker:
if m.WorktreePath != "" && filepath.Clean(m.WorktreePath) != filepath.Clean(s.WorktreePath) {
return s, false, nil // Not my marker — leave it for the right session.
}
That single check brings entire review in line with the rest of the codebase's worktree-scoping convention — now it's an actual member of the same family as sessions, shadow branches, and hook state.
Want me to apply that fix now, or test the scope-output change first?
HasReview
Kind
HasAgentReview
HasManualReview
─────────────────────────────────────────────────
Where I'd actually edit
One small thing worth doing right now without the rename: tighten the doc comment on KindReview and HasReview to make the umbrella semantics explicit. Like:
go
// KindReview tags a session created by `entire review` (agent-driven review).
// Future review kinds (e.g., manual review) should be added as distinct Kind
// values; all review kinds should set CheckpointSummary.HasReview.
KindReview Kind = "review"
And:
go
// HasReview is true when any session in this checkpoint has a review-kind
// Kind set (agent or, in the future, other review types). Use Kind on the
// per-session CommittedMetadata to distinguish.
HasReview bool `json:"has_review,omitempty"`
That costs nothing, documents intent, and makes the future extension obvious.
TL;DR
Skip the rename; instead commit to "any review intent" as the meaning of HasReview and update the doc comments to say so. When manual review actually lands, add a new Kind value and have it also set HasReview. No migration, no breaking wire format.
Want me to apply just the doc-comment tightening?
HasReview
Kind
─────────────────────────────────────────────────
My recommendation
Go with Option 2:
Rename KindReview → KindAgentReview (Go constant)
Change wire value from "review" → "agent_review" (JSON string + the opts.Kind == "review" check in committed.go:440)
Keep HasReview and has_review as-is
Update the three doc comments (checkpoint.go:315, 485, 538) and CLAUDE.md
Wire-string comparison in checkpoint/committed.go:440 updated with a comment noting why it can't import session (import cycle)
Doc comments on WriteCommittedOptions.Kind, CommittedMetadata.Kind, and CheckpointSummary.HasReview tightened to make the umbrella semantics explicit
HasReview kept unchanged as the umbrella — future Kind = "manual_review" can be added without renaming anything
5. Small ancillaries
Used defaultBaseBranch and detachedHEADDisplay constants instead of string literals (goconst lint)
Added testMainBranch constant in review_test.go to avoid bumping goconst occurrence count
Cleaned up the incorrectly-tagged kind: review + review_skills from my own session state JSON earlier (fallout from the marker-race bug we then fixed)
Updated CLAUDE.md to reflect worktree scoping, new wire value, and umbrella semantics
What's left
Lint: one pre-existing nolintlint warning in strategy/manual_commit_condensation.go that appears after golangci-lint --fix strips its //nolint:ireturn directive. Not introduced by this work; a separate issue to sort out.
Docs for non-curated agents: you said skip adding that to CLAUDE.md now and defer to user docs later — still deferred.
All changes are uncommitted on feat/entire-review. Want me to commit this as one grouped commit, or split into themed commits (picker fixes / scope / worktree marker / rename)?
main
origin/master
main
master
committed.go:440 hardcoded "agent_review" is a ticking time bomb
Flagged by code-reviewer, silent-failure-hunter, and type-design-analyzer. When a second review kind is introduced (KindManualReview), checkpoint.committed will silently stop setting HasReview for it — defeating the "umbrella flag" design explicitly advertised in the doc comments.
Fix options: (a) move Kind constants to a leaf package both session and checkpoint can import, (b) add Kind.IsReview() + a test that asserts string(session.KindAgentReview) == "agent_review", or (c) compute HasReview at the caller and pass it via WriteCommittedOptions.
Missing context propagationreview.go:54-55,64,84,104pendingMarkerPath unconditionally calls session.GetGitCommonDir(context.Background()), dropping cancellation from callers that have a real ctx. Every consumer (adoptPendingReviewMarkerInto, runReview, handleLifecycleTurnStart) has a ctx available.
Fix: thread ctx through pendingMarkerPath(ctx) and the three Read/Write/Clear helpers.
headHasReviewCheckpoint collapses 5 distinct failures into silent falsereview.go:586-622
The re-run guard and entire status review badge both go silent for ANY error (git log failure, PlainOpen failure, resolve failure, summary nil, HasReview false). A user debugging "why isn't the review badge showing?" has no breadcrumbs.
Fix: add logging.Debug at each failure step, keeping the (bool, string) return shape.
Zero test coverage for headHasReviewCheckpoint and the Kind → HasReview condensation path
Flagged by pr-test-analyzer as the two biggest behavioral gaps. Both are the user-facing integrations (re-run guard + badge). A typo of the "agent_review" string, a regression to v1-only resolution, or a broken HasReview merge in multi-session checkpoints would all ship silently.
Fix: add two focused integration-y tests that seed a checkpoint and assert HasReview reads correctly.
runReview error branches untested
Only TestRunReview_TrackOnlyWritesMarker exists — the no-git-repo, empty-config picker trigger, launcher-missing fallback, and marker-cleanup-on-launch-failure branches are all untested.
Suggestions (nice to have)
Comment/code drift on PendingReviewMarker docreview.go:36-45 — Says hook "reads it, tags, then clears the marker," but the worktree-mismatch path reads-and-returns without clearing. Clarify.
PendingReviewMarker.StartingSHA is write-only — Captured at write but read nowhere. Either use it (e.g., warn if HEAD moved between entire review and first prompt) or drop it.
runReviewConfigPicker swallows settings.Load and agent.Get errors silentlyreview.go:214-217,229 — Log at Warn/Debug so users debugging "why isn't claude-code offered?" or "why are my saved skills gone?" have breadcrumbs.
Type tightening (from type-design-analyzer) — PendingReviewMarker.AgentName → types.AgentName; CommittedMetadata.Kind → session.Kind; consider map[types.AgentName][]string alias for settings.Review. All one-line changes that propagate real type safety.
composeReviewPrompt doesn't guard against empty skillsreview.go:438-445 — selectReviewAgent currently prevents the zero case, but a future caller could break the invariant and produce an empty prompt block. Small defensive check or assertion.
CLAUDE.md drift — The entire review section doesn't mention that headHasReviewCheckpoint prompts the user "already reviewed, proceed anyway?" — future maintainers reading only the doc won't know about the confirm-UX.
Weak redundant comments — composeReviewPrompt, currentHeadSHA, gitString/gitOK/gitCount doc lines just restate their signatures. Either drop or add the WHY.
Strengths
Worktree-scoping fix is clean and well-tested.TestAdoptPendingReviewMarker_OtherWorktreeLeavesMarker locks in both the primary race and the matching-worktree happy path.
Launcher interface is minimal and discoverable.TestLauncher_AtLeastOneImplementor documents the invariant as a test — nice touch.
Kind enum naming and umbrella-bool design anticipate future review kinds well — the discriminator/umbrella split is right even though the wire-string coupling (issue #5) needs tightening to fully deliver on it.
Re-run guard is O(1) — no commit-history walking, matching the stated design.
TestDetectBaseBranch_UsesOriginMainWhenNoLocalMain documents the fork bug that was just fixed and prevents regression.
TestFormatReviewScope is a solid table test across all reasonable shapes.
Recommended Action Plan
Before merging, in priority order:
Ship the destructive-settings fix first (issues #1, #2) — these can data-loss users today. One focused commit, maybe 20-30 LOC + a test.
Fix marker cleanup (issue #3) — one defer + test.
Fix the docstring or the loop in detectBaseBranch (issue #4) — one-liner, but pick a direction.
Add the two missing integration tests (issue #8) — the ones covering headHasReviewCheckpoint and the Kind → HasReview condensation. Also guards against issue #5 regressions.
Address issues #5-7 in the same commit or a small follow-up. Issues #9-16 can land later; none block merge.
Notes:
Task description mentioned a new Entire-Checkpoint-kind trailer — two agents independently confirmed that does not exist in the diff. trailers.go change is a pure refactor (extracting appendTrailerLine). Update the PR description.
Of all 16 findings, only issue #1 is user-data-loss risky. Everything else is quality/polish/coverage.
Want me to ship issues #1-4 in a focused commit now?