hex522 downloadsAdd inline annotations in the note source, with a Word-style sidebar for replies, resolving and timestamps.
English | 简体中文
Word-style comments for Obsidian, stored right in the Markdown source, so an AI agent can read and act on them.
Select text, write a comment in the sidebar, reply to it, resolve it. Every annotation and reply carries an author and a timestamp. Because each annotation is just a pair of <span> markers in the note, agents such as Claude Code or Codex see exactly which text you meant and what you want changed. No export, no copy and paste, no API.

About the interface language: the plugin's own UI (sidebar, menus, commands, settings) is currently in Chinese. This README gives the English meaning of each label, and UI labels at the end lists them all.
A 3-minute tour: the idea, a real annotate-and-hand-over round with Claude Code, and installation (Chinese narration).
An AI can write a draft in a minute, but getting it right can mean ten separate fixes, and each one is copy, paste, explain, repeat. A teacher marking an essay does not call you over sentence by sentence: they circle the problem, write a note in the margin, and hand back the whole thing at once.
Margin Annotations brings that to your notes:
Select text and run 添加批注 (Add annotation), from the command palette, a hotkey, or the right-click menu. A card opens in the sidebar: write the comment, pick a color, press Cmd/Ctrl + Enter (or just click elsewhere, a draft with text is saved automatically).
Click a card to reply to it. The ⋯ menu on a card has reply, resolve, edit, change color and delete. Resolved annotations are dimmed and get a 已解决 (Resolved) badge.
![]() |
![]() |
| Writing a new annotation | Reply thread and the ⋯ menu |
You do not have to select text first. With nothing selected, Add annotation annotates the table cell, code block or line under the cursor.

Reading view shows the highlights and a small 💬 button at the end of each annotation. Click it to see the comment, with 编辑 (Edit) and 删除 (Delete) buttons. Right-clicking a highlight opens the same menu as the sidebar. The sidebar works in reading view too.

The annotations live in the note, so any agent that can read and edit files can handle them. In Claude Code, for example, referencing the file is enough:
@draft.md address the annotations in this note
The plugin writes a hidden guide at the end of every note that has annotations (see the guide), so the agent already knows the rules:
data-resolved="1" to the annotation, which turns the card to 已解决 (Resolved) in the sidebar. The markers stay;A more explicit prompt, if your agent does not pick the guide up:
Read every <span class="ann-e" ... data-note="..."> annotation in draft.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 add data-resolved="1" to that annotation's ann-e marker. Keep the markers.
If a note is unclear, do not edit: append a reply to data-replies instead.
Do not touch text without annotations.
Resolved annotations are skipped in the next round, so text that is already fixed does not get rewritten again. To redo one, choose 取消解决 (Unresolve) on the card and add a reply.
From the Community Plugins browser
Manual installation
main.js, manifest.json and styles.css from the latest release.<your vault>/.obsidian/plugins/margin-annotations/.Requires Obsidian 1.7.2 or later.
Open the plugin's settings (Settings → Margin Annotations).

| Setting | What it does | Default |
|---|---|---|
| 默认批注颜色 (Default color) | Color preselected for new annotations. | Yellow |
| 批注人名称 (Author name) | Shown on your annotations and replies. Empty shows「我」("me"). | Empty |
| 批注跟随正文 (Cards follow the note) | On: cards sit next to their text and scroll with the note. Off: a plain list in note order, and clicking a card jumps to its text. | On |
| 实时预览中隐藏批注标记 (Hide markup in live preview) | Hides the <span> markers and the agent guide in live preview. Source mode always shows the raw text. |
On |
| 添加批注快捷键 (Add-annotation hotkey) | Shows the current binding. The button jumps to Obsidian's Hotkeys settings. | Not set |
Bind a hotkey for Add annotation, since the command has none by default: select 设置快捷键 (Set hotkey), or go to Settings → Hotkeys and search for "批注" or "Margin Annotations". Without a hotkey the right-click menu still works, only slower.
| Action | How |
|---|---|
| Add | Select text, run 添加批注, type in the sidebar card, Cmd/Ctrl + Enter |
| Reply | Click a card, type in the reply box, press Enter (Shift + Enter for a new line) |
| Resolve / unresolve | ⋯ menu on the card, or the right-click menu on the highlight |
| Edit, change color | ⋯ menu on the card |
| Delete | ⋯ menu, or Delete / Backspace with a card selected, or the command 删除选中的批注. Only the markers are removed, your text is untouched |
| Cancel a draft | Esc, or the 取消 button |
| Deselect | Click empty space in the sidebar |
| Open / close the sidebar | Ribbon icon, or the command 打开/关闭批注栏 (the sidebar also opens when you add an annotation) |
Moving the cursor into annotated text selects its card, and clicking a highlight in reading view does the same. With 批注跟随正文 on, scrolling the sidebar scrolls the note.
Commands:
| Command | Meaning |
|---|---|
| 添加批注 | Add annotation |
| 编辑光标处批注 | Edit the annotation at the cursor |
| 删除选中的批注 | Delete the selected annotation |
| 打开/关闭批注栏 | Open / close the annotation sidebar |
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. In source mode it looks like this (the markers are faded):

<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="Alex" data-time="2026-10-09 13:36" data-resolved="1" data-replies="[{"a":"Alex","t":"2026-10-09 13:37","c":"Done"}]"></span>
| Attribute | Meaning |
|---|---|
data-id |
Pairs the start and end markers. |
data-color |
yellow, green, blue, pink, purple or orange. |
data-note |
The comment, on the end marker only. HTML-entity escaped, for example is a newline. |
data-author, data-time |
Author and creation time, YYYY-MM-DD HH:mm (optional). |
data-resolved="1" |
Marks a resolved annotation. Absent means unresolved. |
data-replies |
Optional JSON array of replies: a author, t time, c content. |
For a code block the two markers sit on their own lines just outside the fences. Inside a table they wrap the text within one cell.
At the end of every note that has annotations the plugin keeps an HTML comment (<!-- ann-guide:start ... ann-guide:end -->) that explains the rules above to an AI agent. It is written in Chinese, marked "do not delete or edit", invisible in reading view, hidden in live preview (switchable in the settings), refreshed when the plugin updates it, and removed again when the last annotation is deleted.
<span> elements: your text is intact, but no highlights are shown.**bold**, rendering may be off.| Label | Meaning |
|---|---|
| 添加批注 | Add annotation |
| 批注栏 / 批注 | Annotation sidebar |
| 答复 | Reply |
| 发送 | Send |
| 解决 / 取消解决 | Resolve / Unresolve |
| 已解决 | Resolved |
| 编辑 | Edit |
| 更改颜色 | Change color |
| 删除 | Delete |
| 保存 / 取消 | Save / Cancel |
| 黄色 / 绿色 / 蓝色 / 粉色 / 紫色 / 橙色 | Yellow / green / blue / pink / purple / orange |
npm install
npm run dev # rebuild main.js on change
npm run build # type-check and bundle main.js
npm test # unit tests for the marker logic (src/core.ts)
Copy or symlink main.js, manifest.json and styles.css into a vault's .obsidian/plugins/margin-annotations/ folder to try a build. Pushing a tag creates a GitHub release with those three files.