[FEATURE] Paragraph anchors with cross-session references
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Referring to earlier parts of a conversation means copying whole paragraphs into the prompt. This costs tokens, makes it hard to reference or connect several points in one message, and breaks down completely across sessions or after compaction, because the original context is gone.
Proposed Solution
An anchor icon on each paragraph of an assistant message; clicking it inserts a short reference into the composer instead of the full text.
- Multiple anchors can be added to one message to reference several paragraphs or link them ("anchor 2 depends on anchor 5").
- Optional importance marker per anchor, so priorities are visible at a glance.
- Anchors get a persistent index across sessions, so Claude can resolve them later, even after compaction or in a new session.
Alternative Solutions
I have built this myself and use it daily:
- Claude appends an ID like [ab.dialog.1] after every paragraph. UPPERCASE = important, lowercase = minor, so priority is visible at a glance.
- I reference paragraphs by ID instead of copying them, which saves tokens overall, and I can link several in one message ("ab.dialog.2 depends on ab.dialog.5").
- An index document is appended with every anchor and its session ID. Claude uses it to know which session an anchor belongs to and can search the local transcripts to read the original paragraph.
It works well, but it depends on instructions and a hook. A native version would make it reliable and available to everyone.
Priority
Medium - Would be very helpful
Feature Category
Other
Use Case Example
- Claude answers with six paragraphs about a refactor.
- I want to push back on the second and connect it to a point from yesterday's session.
- I write: "f.api.2 contradicts C.db.4 — check C.db.4 and adjust."
- Claude looks up C.db.4 in the registry, reads it from the old transcript and answers with both in context. No copying, no lost context.
Additional Context
Attached: anchor-system.zip, a working prototype of this workaround, cleaned up so anyone can try it. It contains the hook script (one stdlib-only Python file run by four hook events), the hook entries for settings.json, a registry template, a short CLAUDE.md rule and a README explaining the setup.
Key finding: a CLAUDE.md rule alone was not enough. Anchors only became reliable once hooks injected the rule into every turn (before that, only 11% of paragraphs were anchored). A native feature would make all of this unnecessary.
Related: #98389 (click a paragraph to quote-reply), #81308 (numbered references), #32874 (pin messages within a conversation).