inkmark
A local-first Markdown viewer + commenting tool for working with an AI agent.
Open a single .md file in your browser, read it, and leave inline comments and
suggested edits — and so can your AI agent. Comments are stored inside the
Markdown file as CriticMarkup, so they stay
git-friendly, portable to other editors, and readable by an agent that just
opens the file.
Requirements
Install & build
Not published to npm yet — run it from a clone:
git clone https://github.com/yoshi47/inkmark.git
cd inkmark
pnpm install
pnpm build
Usage
./bin/inkmark open ./draft.md # start a local server and open the browser
./bin/inkmark open ./spec.md # a second document, on the next free port
./bin/inkmark open ./draft.md --detach # start it, print the URL, and return
./bin/inkmark status # list every running server (URL, pid, file)
./bin/inkmark stop ./draft.md # stop one of them (by file or by port)
./bin/inkmark stop # stop all of them
./bin/inkmark stop 4747 --force # stop one that is wedged and will not answer
./bin/inkmark forget 4747 # drop a record whose server is gone
./bin/inkmark wait ./draft.md # block until somebody leaves a comment
./bin/inkmark live off # stop waking the agent at all
open serves the file on the first free port from 4747 and opens your
browser; --port <n> starts the scan somewhere else. The server watches the
file: edits made on disk (by you, your editor, or an AI agent) show up in the
browser live. Press Ctrl-C to stop, or use inkmark stop from another
terminal.
--detach starts the server in its own session and returns as soon as it is
serving, so it keeps running after the shell (or the AI agent session) that
started it goes away. Stop it with inkmark stop. What the detached server
writes goes to ~/.inkmark/logs/.
You can keep several documents open at once — each gets its own port, and
status lists them all. Re-opening a file that is already being served reuses
the existing server: if a browser tab is already showing it, open only prints
the URL instead of opening another tab; otherwise it opens the browser again.
In the browser
- Comment: select text and click 💬 Comment in the popover to attach a note.
- Highlight: click 🖍 Highlight instead to just mark the text — no note, no
prompt. Highlights are blue, commented text is yellow.
- Sidebar: comments, highlights and suggestions are listed on the right.
Click an entry to scroll to its mark in the document; reply and resolve from
the thread. Remove deletes a mark outright — a highlight leaves its text
behind, a comment takes its note and replies with it.
- Suggestions: insertions (
{++ ++}), deletions ({-- --}), and
substitutions are rendered inline and can be accepted or rejected.
- Images:
 and  are resolved
against the document's own directory, so images stored next to it — or beside
it in the same repository — are displayed. Remote https:// images work too.
SVG is not served: a browser can open it as a page of its own, where its
scripts would run with the same access to your file as inkmark itself.
Live mode
By default the agent only reads your comments when you tell it to look. In live mode the
comment itself wakes it: the inkmark plugin registers a Stop hook that arms
inkmark wait in the background at the end of every turn, and that command returns the
moment somebody other than the agent leaves a comment. A waiting hook costs nothing — no
model turn, no blocked tool call.
- Claude Code wakes the session directly (an async hook with
asyncRewake).
- Codex runs the same script, but a background hook cannot continue a turn there, so the
comment is pushed back into the session with
codex queue. Codex skips plugin hooks until
you trust them: run /hooks once in a Codex session and approve the inkmark one.
- OpenCode has no such hook, so the OpenCode plugin does the same job itself: when a
session's turn finishes it starts
inkmark wait --project <session directory> in the
background, one per session, and sends what it prints back to that session as a queued
message the agent reads as user input. Subagent sessions are left alone, and the waiter is
stopped when the session is deleted or the plugin unloads. This works on macOS and Linux,
with inkmark on the PATH of the OpenCode server. An app started from the macOS GUI may not
have your shell's PATH. When inkmark is not found, the plugin logs one warning and leaves
live mode off.
- Any other agent (a script): run
inkmark wait <file.md> and let it block.
Exit 0 means comments were printed, exit 3 means the timeout ran out with nothing.