hex30 downloadsAdd inline annotations in the note source, with a Word-style sidebar for replies, resolving and timestamps.
English | 简体中文
Word-style annotations for Obsidian. Select text, write a comment in the sidebar, reply to it, resolve it or delete it. Each annotation and reply carries a timestamp.
Annotations are stored as a pair of <span> markers directly in the Markdown source, so AI agents (Claude Code and similar) can read and act on them straight from the file. No export or API is needed.
Note: adding, editing or deleting an annotation modifies the note's source text (it inserts or removes the
<span>markers). The plugin's interface is currently in Chinese; this README is in English first, with a Chinese version below.
Delete / Backspace to delete the selected annotation.From the Community Plugins browser (once the plugin is published)
Manual installation
main.js, manifest.json and styles.css from the latest release.<your vault>/.obsidian/plugins/margin-annotations/.Cmd/Ctrl + Enter, or just click elsewhere. The card is saved.| Action | How |
|---|---|
| Add | Select text, run Add annotation, type in the sidebar |
| Reply | Click a card, type in the reply box, press Enter |
| Resolve / unresolve | ⋯ menu on the card, or the right-click menu |
| Delete | ⋯ menu, Delete key on a selected card, or the command Delete selected annotation |
| Toggle follow mode | Settings → Margin Annotations → follow note (off = plain list) |
| Author name | Settings → Margin Annotations |
Annotations cannot be created in reading view, because reading view cannot be reliably mapped back to the source. Switch to editing mode to add them.
One annotation is a start marker, the annotated text and an end marker. The comment lives on the end marker's data-note attribute:
<span class="ann-s" data-id="k3f9" data-color="yellow"></span>Annotated text, possibly spanning several paragraphs.
Last line.<span class="ann-e" data-id="k3f9" data-color="yellow" data-note="Too formal, make it conversational" data-author="sky" data-time="2026-10-09 13:36" data-resolved="1" data-replies="[{"a":"sky","t":"2026-10-09 13:37","c":"Done"}]"></span>
data-id pairs the start and end markers.data-color is one of yellow, green, blue, pink, purple, orange.data-author / data-time (optional) are the author and creation time.data-resolved="1" marks a resolved annotation.data-replies (optional) is a JSON array: a author, t time, c content.data-note is the comment, HTML-entity escaped (for example is a newline).The plugin also keeps a hidden HTML comment (<!-- ann-guide:start ... ann-guide:end -->) at the end of every note that has annotations. It tells an AI agent how to work with them: handle only unresolved annotations, mark each one resolved by adding data-resolved="1" once the change is done (remove it to reopen), and ask questions by appending an entry to data-replies instead of editing blindly. The comment is marked as "do not delete or edit" for agents, is invisible in reading view, is hidden in live preview (switchable in the settings), is refreshed when the plugin updates it, and is removed again when the last annotation is deleted.
Example prompt for an agent:
Read every <span class="ann-e" ... data-note="..."> annotation in xxx.md.
The text an annotation refers to lies between the ann-s and ann-e markers with the same data-id.
Skip annotations with data-resolved="1". Revise the text according to each note (and its data-replies discussion),
then remove both markers of the annotation. Do not touch text without annotations.
<span> elements: your text is intact, but no highlights are shown.**bold**, rendering may be off.MIT