|
| 1 | +# htmlnote |
| 2 | + |
| 3 | +Visual review for AI-generated HTML. When Claude Code writes or edits an HTML file, htmlnote opens a browser tab that lets you click any element, leave notes, and copy them back into chat so Claude can apply your changes. |
| 4 | + |
| 5 | +No interruption mid-turn. No "Send to agent" hidden in a button somewhere. You see the final result, you mark it up, you paste back. Honest about how Claude Code plugins actually work. |
| 6 | + |
| 7 | +## How it works |
| 8 | + |
| 9 | +``` |
| 10 | +You: "make me a landing page" |
| 11 | + ↓ |
| 12 | +Claude writes/edits HTML (no popups during the turn) |
| 13 | + ↓ |
| 14 | +Claude finishes responding |
| 15 | + ↓ |
| 16 | +↳ htmlnote tab opens in your browser ← only if HTML was touched |
| 17 | + ↓ |
| 18 | +You click elements / drag-select text / leave notes |
| 19 | + ↓ |
| 20 | +Click "Copy for chat" → your notes are on the clipboard |
| 21 | + ↓ |
| 22 | +Paste into Claude Code chat → submit |
| 23 | + ↓ |
| 24 | +Claude applies your notes → loop until you're happy |
| 25 | +``` |
| 26 | + |
| 27 | +If your prompt isn't about HTML (asking a question, editing Python, etc.) — no tab. htmlnote only fires when Claude actually wrote/edited a `.html` or `.htm` file in the turn that just ended. |
| 28 | + |
| 29 | +## Install |
| 30 | + |
| 31 | +Two pieces — the Claude Code plugin and the binary. |
| 32 | + |
| 33 | +**1. Register the plugin** — inside Claude Code, run each line as a **separate** prompt (don't paste both at once): |
| 34 | + |
| 35 | +``` |
| 36 | +/plugin marketplace add https://github.com/DavelRad/htmlnote.git |
| 37 | +``` |
| 38 | + |
| 39 | +``` |
| 40 | +/plugin install htmlnote |
| 41 | +``` |
| 42 | + |
| 43 | +**2. Install the binary** — in your terminal: |
| 44 | + |
| 45 | +``` |
| 46 | +curl -fsSL https://raw.githubusercontent.com/DavelRad/htmlnote/main/install.sh | bash |
| 47 | +``` |
| 48 | + |
| 49 | +Downloads a precompiled binary for your platform (macOS arm64/x64, Linux x64/arm64), verifies the SHA256, and installs to `~/.local/bin/htmlnote`. Make sure that directory is in your `PATH`. |
| 50 | + |
| 51 | +After both steps, **restart Claude Code** (quit and relaunch — not just a new conversation) so it loads the new hook configuration. |
| 52 | + |
| 53 | +## Using it |
| 54 | + |
| 55 | +You don't run any command. After Claude writes or edits HTML during a turn, a tab opens automatically when the turn ends. Click any element to annotate it; drag-select text to highlight a specific phrase; press `N` for a general note not tied to anything. |
| 56 | + |
| 57 | +When you're done annotating, click **Copy for chat**. Your notes are formatted as markdown and put on your clipboard. Paste into Claude Code chat and submit — Claude reads them like normal input and applies the changes. If the file gets touched again during the new turn, a fresh tab opens with the updated state. Loop until you're satisfied. |
| 58 | + |
| 59 | +### Keyboard shortcuts |
| 60 | + |
| 61 | +| Key | What | |
| 62 | +|---|---| |
| 63 | +| `E` | Toggle annotate mode (click elements vs. just look) | |
| 64 | +| `Click` | Drop a pin on an element | |
| 65 | +| `Drag` | Highlight text and annotate it | |
| 66 | +| `N` | Add a general note (no element target) | |
| 67 | +| `J` / `K` | Walk through annotations | |
| 68 | +| `Del` / `Backspace` | Delete the selected annotation | |
| 69 | +| `⌘+↵` | Copy notes for chat | |
| 70 | +| `⌘+K` | Command palette | |
| 71 | +| `?` | Show this list | |
| 72 | +| `Esc` | Cancel composer / exit annotate mode | |
| 73 | + |
| 74 | +### Manual review |
| 75 | + |
| 76 | +Want to review an HTML file outside of Claude Code's flow? |
| 77 | + |
| 78 | +``` |
| 79 | +htmlnote path/to/file.html |
| 80 | +``` |
| 81 | + |
| 82 | +Opens the same review UI in your browser. Same hotkeys, same Copy button. |
| 83 | + |
| 84 | +## Updating |
| 85 | + |
| 86 | +``` |
| 87 | +htmlnote --update |
| 88 | +``` |
| 89 | + |
| 90 | +Self-updates the binary to the latest release. Verifies SHA256 before replacing itself. Won't downgrade. |
| 91 | + |
| 92 | +For the plugin side (if a release changes hook configuration), refresh inside Claude Code: |
| 93 | + |
| 94 | +``` |
| 95 | +/plugin marketplace update DavelRad/htmlnote |
| 96 | +/plugin update htmlnote |
| 97 | +``` |
| 98 | + |
| 99 | +Then restart Claude Code so the new hooks load. |
| 100 | + |
| 101 | +## Troubleshooting |
| 102 | + |
| 103 | +**The tab doesn't pop up after Claude finishes editing HTML.** |
| 104 | +Claude Code caches the plugin's hook config at app startup. After installing or updating, fully **quit and relaunch Claude Code** (not just a new conversation). Then try again. |
| 105 | + |
| 106 | +**Daemon isn't responding.** |
| 107 | +htmlnote runs a small background process (the "daemon") that serves the review UI. Restart it: |
| 108 | + |
| 109 | +``` |
| 110 | +htmlnote --stop |
| 111 | +htmlnote --daemon |
| 112 | +``` |
| 113 | + |
| 114 | +Your saved annotations live on disk and survive the restart. |
| 115 | + |
| 116 | +**Reset everything.** |
| 117 | + |
| 118 | +``` |
| 119 | +htmlnote --stop |
| 120 | +rm -rf ~/.htmlnote |
| 121 | +``` |
| 122 | + |
| 123 | +Wipes all session history and the daemon's discovery file. Next HTML edit will start fresh. |
| 124 | + |
| 125 | +**Dev install (different platform, or contributing).** |
| 126 | +If your platform doesn't have a prebuilt binary, clone and install from source: |
| 127 | + |
| 128 | +``` |
| 129 | +git clone https://github.com/DavelRad/htmlnote |
| 130 | +cd htmlnote |
| 131 | +bash install.sh --local . |
| 132 | +``` |
| 133 | + |
| 134 | +Requires Node 18+ and npm. Builds and symlinks `~/.local/bin/htmlnote` to your checkout. |
| 135 | + |
| 136 | +## What it does NOT do |
| 137 | + |
| 138 | +- Doesn't intercept non-HTML edits. Only `.html` and `.htm` files trigger the popup. |
| 139 | +- Doesn't send anything to the network. The daemon binds to `127.0.0.1` only; no telemetry; no cloud. |
| 140 | +- Doesn't auto-submit feedback. You explicitly hit Copy and paste — htmlnote never types into Claude on your behalf. |
| 141 | +- Doesn't loosen the iframe sandbox. AI-generated HTML runs `sandbox="allow-scripts"` with no `allow-same-origin`. Your host page, cookies, and DOM are safe from whatever Claude wrote. |
| 142 | + |
| 143 | +## License |
| 144 | + |
| 145 | +[MIT](./LICENSE) |
0 commit comments