Conversation
Findings now survive commits, so their line numbers go stale as soon as the code under them shifts. anchor_content already recorded the lines a comment was attached to, but nothing used it, and the agent CLI never filled it in - only comments written in the browser had one. `agent comment` now records the anchor, and carrying a session forward re-anchors every open thread on the new side: the exact lines are located in the working tree and the thread moves to them. The match is exact. A line that was edited is a different line, and guessing at similarity would move a comment onto code it was not written about - such a thread keeps its old position instead. When the same lines appear more than once, the occurrence nearest to where the comment used to be wins. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs
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.
The follow-up #17 made necessary. Now that findings survive commits, their line numbers go stale the
moment the code under them shifts — and the data needed to fix that was already there but unused:
anchor_contentrecords the source lines a comment was attached to. Two gaps:agent commentnow records the anchor, and carrying a session forward re-anchors every open threadon the new side: the exact lines are located in the working tree and the thread moves to them.
The match is exact, deliberately. A line that was edited is a different line, and guessing at
similarity would move a comment onto code it was not written about — the finding keeps its old
position instead, which is visible and correctable rather than silently wrong. When the same lines
occur more than once, the one nearest to where the comment used to be wins.
Tested through real commits: a finding whose code is pushed down two lines follows it; a finding
whose code was edited stays put; nearest-occurrence wins among duplicates; an empty anchor is
refused rather than matching everywhere.
Stacked on #17.
🤖 Generated with Claude Code
https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs