Skip to content

feat(session): move a finding to where its code went - #18

Merged
fiddur merged 1 commit into
developfrom
reanchor
Aug 21, 2026
Merged

feat(session): move a finding to where its code went#18
fiddur merged 1 commit into
developfrom
reanchor

Conversation

@fiddur

@fiddur fiddur commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

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_content records the source lines a comment was attached to. Two gaps:

  • nothing ever read it
  • the agent CLI never wrote it, so only comments made in the browser had one at all

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, 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

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
@fiddur
fiddur changed the base branch from session-continuity to develop August 21, 2026 13:35
@fiddur
fiddur marked this pull request as ready for review August 21, 2026 13:35
@fiddur
fiddur merged commit a99ba99 into develop Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant