Skip to content

Commit afdc6f2

Browse files
authored
docs: add /plannotator-last to docs and install scripts (#327)
* docs: add /plannotator-last to READMEs and marketing docs * feat: add /plannotator-last to install scripts * fix: sync review command wording in install scripts with plugin The plugin's plannotator-review.md was updated in #293 to handle LGTM approvals but the install scripts still had the old wording.
1 parent 6b775ea commit afdc6f2

13 files changed

Lines changed: 211 additions & 11 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Interactive Plan & Code Review for AI Coding Agents. Mark up and refine your pla
3636
<tr><td><strong>Plan Diff</strong></td><td>Automatic</td><td>See what changed when the agent revises a plan</td></tr>
3737
<tr><td><strong>Code Review</strong></td><td><code>/plannotator-review</code></td><td>Review git diffs with line-level annotations</td></tr>
3838
<tr><td><strong>Annotate Any File</strong></td><td><code>/plannotator-annotate</code></td><td>Annotate any markdown file and send feedback to your agent</td></tr>
39+
<tr><td><strong>Annotate Last Message</strong></td><td><code>/plannotator-last</code></td><td>Annotate the agent's last response and send structured feedback</td></tr>
3940
</table>
4041

4142
#### Sharing Plans
@@ -143,6 +144,7 @@ irm https://plannotator.ai/install.ps1 | iex
143144
```
144145
!plannotator review # Code review for current changes
145146
!plannotator annotate file.md # Annotate a markdown file
147+
!plannotator last # Annotate the last agent message
146148
```
147149

148150
Plan mode is not yet supported.

apps/codex/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ Run `!plannotator annotate` to annotate any markdown file:
3636
!plannotator annotate path/to/file.md
3737
```
3838

39+
### Annotate Last Message
40+
41+
Run `!plannotator last` to annotate the agent's most recent response:
42+
43+
```
44+
!plannotator last
45+
```
46+
47+
The message opens in the annotation UI where you can highlight text, add comments, and send structured feedback back to the agent.
48+
3949
## Environment Variables
4050

4151
| Variable | Description |

apps/hook/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ Host your-server
102102
LocalForward 9999 localhost:9999
103103
```
104104

105+
## Slash Commands
106+
107+
The plugin registers three slash commands:
108+
109+
| Command | Description |
110+
|---------|-------------|
111+
| `/plannotator-review` | Open code review UI for uncommitted changes |
112+
| `/plannotator-annotate <file.md>` | Annotate any markdown file |
113+
| `/plannotator-last` | Annotate the agent's last message |
114+
105115
## Obsidian Integration
106116

107117
Approved plans can be automatically saved to your Obsidian vault.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: "Annotate Last"
3+
description: "The /plannotator-last slash command for annotating the agent's most recent message."
4+
sidebar:
5+
order: 13
6+
section: "Commands"
7+
---
8+
9+
The `/plannotator-last` command opens the agent's most recent response in the annotation UI, letting you highlight text, add comments, and send structured feedback back.
10+
11+
## Usage
12+
13+
### Claude Code
14+
15+
```
16+
/plannotator-last
17+
```
18+
19+
### OpenCode
20+
21+
```
22+
/plannotator-last
23+
```
24+
25+
### Pi
26+
27+
```
28+
/plannotator-last
29+
```
30+
31+
### Codex
32+
33+
```
34+
!plannotator last
35+
```
36+
37+
## How it works
38+
39+
```
40+
User runs /plannotator-last
41+
42+
Last assistant message extracted from session
43+
44+
Annotate server starts (random port)
45+
46+
Browser opens, loads annotation UI
47+
48+
/api/plan returns { plan: message, mode: "annotate-last" }
49+
50+
User annotates → Send Annotations
51+
52+
Feedback sent to agent
53+
```
54+
55+
## Session log parsing
56+
57+
Each harness reads the last assistant message differently:
58+
59+
| Harness | Source | Method |
60+
|---------|--------|--------|
61+
| **Claude Code** | `~/.claude/projects/{slug}/*.jsonl` | Parses JSONL session logs, finds last assistant text blocks |
62+
| **OpenCode** | SDK | `client.session.messages()` API |
63+
| **Pi** | SDK | `ctx.sessionManager.getEntries()` API |
64+
| **Codex** | `~/.codex/sessions/` rollout files | Parses JSONL by `CODEX_THREAD_ID` env var |
65+
66+
For Claude Code, the parser handles streamed chunks (multiple JSONL lines sharing the same `message.id`), filters out system-generated user messages, and skips noise entries. If the most recent session log has no assistant messages, it tries earlier logs sorted by modification time.
67+
68+
## Annotate-last mode differences
69+
70+
The annotation UI in `annotate-last` mode works the same as `/plannotator-annotate`, with minor copy changes:
71+
72+
- Copy button shows "Copy message" instead of "Copy plan"
73+
- Completion screen says "annotations on the message"
74+
- Feedback export is titled "Message Feedback" instead of "Plan Feedback"
75+
76+
## Server API
77+
78+
The annotate-last mode reuses the same annotate server endpoints. See the [annotate docs](/docs/commands/annotate/#server-api).
79+
80+
## Environment variables
81+
82+
Same as plan review. See the [environment variables reference](/docs/reference/environment-variables/).

apps/marketing/src/content/docs/getting-started/quickstart.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,11 @@ Your annotations are exported as structured feedback that Claude can act on dire
5555
## 5. Claude continues
5656

5757
After approval, Claude implements the plan. After feedback, Claude revises the plan and presents it again for review. When the revised plan arrives, a diff badge shows what changed — click it to toggle between normal and diff view. The cycle continues until you approve.
58+
59+
## Other commands
60+
61+
Beyond plan review, Plannotator provides slash commands you can use anytime during a session:
62+
63+
- **`/plannotator-review`** — Review uncommitted code changes. See [Code Review](/docs/commands/code-review/).
64+
- **`/plannotator-annotate <file.md>`** — Annotate any markdown file. See [Annotate](/docs/commands/annotate/).
65+
- **`/plannotator-last`** — Annotate the agent's last message. See [Annotate Last](/docs/commands/annotate-last/).

apps/marketing/src/content/docs/guides/claude-code.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ If you want to approve with minor notes, use "Send Feedback" — Claude will see
6969

7070
## Slash commands
7171

72-
The plugin registers two slash commands that work inside your Claude Code session:
72+
The plugin registers three slash commands that work inside your Claude Code session:
7373

7474
### `/plannotator-review`
7575

@@ -79,6 +79,10 @@ Opens a code review UI for your uncommitted `git diff`. See the [code review doc
7979

8080
Opens any markdown file in the annotation UI. See the [annotate docs](/docs/commands/annotate/) for details.
8181

82+
### `/plannotator-last`
83+
84+
Annotates the agent's most recent message. See the [annotate last docs](/docs/commands/annotate-last/) for details.
85+
8286
## Plugin installation
8387

8488
The plugin is installed from the marketplace:

apps/marketing/src/content/docs/guides/opencode.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ If the configured agent isn't found in the current OpenCode session, Plannotator
4040

4141
## Slash commands
4242

43-
The plugin registers two slash commands:
43+
The plugin registers three slash commands:
4444

4545
### `/plannotator-review`
4646

@@ -50,6 +50,10 @@ Opens a code review UI for uncommitted changes. Requires the CLI to be installed
5050

5151
Opens a markdown file in the annotation UI. Also requires the CLI.
5252

53+
### `/plannotator-last`
54+
55+
Annotates the agent's most recent message. See the [annotate last docs](/docs/commands/annotate-last/) for details.
56+
5357
Install the CLI for slash command support:
5458

5559
```bash

apps/opencode-plugin/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Add to your `opencode.json`:
3030

3131
Restart OpenCode. The `submit_plan` tool is now available.
3232

33-
> **Slash commands:** Run the install script to get `/plannotator-review`:
33+
> **Slash commands:** Run the install script to get `/plannotator-review`, `/plannotator-annotate`, and `/plannotator-last`:
3434
> ```bash
3535
> curl -fsSL https://plannotator.ai/install.sh | bash
3636
> ```
@@ -49,6 +49,7 @@ Restart OpenCode. The `submit_plan` tool is now available.
4949
- **Runs locally**: No network requests. Plans never leave your machine.
5050
- **Private sharing**: Plans and annotations compress into the URL itself—share a link, no accounts or backend required
5151
- **Plan Diff**: See what changed when the agent revises a plan after feedback
52+
- **Annotate last message**: Run `/plannotator-last` to annotate the agent's most recent response
5253
- **Obsidian integration**: Auto-save approved plans to your vault with frontmatter and tags
5354
5455
## Environment Variables

apps/pi-extension/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ Run `/plannotator-review` to open your current git changes in the code review UI
7171

7272
Run `/plannotator-annotate <file.md>` to open any markdown file in the annotation UI. Useful for reviewing documentation or design specs with the agent.
7373

74+
### Annotate last message
75+
76+
Run `/plannotator-last` to annotate the agent's most recent response. The message opens in the annotation UI where you can highlight text, add comments, and send structured feedback back to the agent.
77+
7478
### Progress tracking
7579

7680
During execution, the agent marks completed steps with `[DONE:n]` markers. Progress is shown in the status line and as a checklist widget in the terminal.
@@ -84,6 +88,7 @@ During execution, the agent marks completed steps with `[DONE:n]` markers. Progr
8488
| `/plannotator-status` | Show current phase, plan file, and progress |
8589
| `/plannotator-review` | Open code review UI for current changes |
8690
| `/plannotator-annotate <file>` | Open markdown file in annotation UI |
91+
| `/plannotator-last` | Annotate the last assistant message |
8792

8893
## Flags
8994

scripts/install.cmd

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ echo !`plannotator review`
185185
echo.
186186
echo ## Your task
187187
echo.
188-
echo Address the code review feedback above. The user has reviewed your changes in the Plannotator UI and provided specific annotations and comments.
188+
echo If the review above contains feedback or annotations, address them. If no changes were requested, acknowledge and continue.
189189
) > "!CLAUDE_COMMANDS_DIR!\plannotator-review.md"
190190

191191
echo Installed /plannotator-review command to !CLAUDE_COMMANDS_DIR!\plannotator-review.md
@@ -207,6 +207,23 @@ echo Address the annotation feedback above. The user has reviewed the markdown f
207207

208208
echo Installed /plannotator-annotate command to !CLAUDE_COMMANDS_DIR!\plannotator-annotate.md
209209

210+
(
211+
echo ---
212+
echo description: Annotate the last rendered assistant message
213+
echo allowed-tools: Bash^(plannotator:*^)
214+
echo ---
215+
echo.
216+
echo ## Message Annotations
217+
echo.
218+
echo !`plannotator annotate-last`
219+
echo.
220+
echo ## Your task
221+
echo.
222+
echo Address the annotation feedback above. The user has reviewed your last message and provided specific annotations and comments.
223+
) > "!CLAUDE_COMMANDS_DIR!\plannotator-last.md"
224+
225+
echo Installed /plannotator-last command to !CLAUDE_COMMANDS_DIR!\plannotator-last.md
226+
210227
echo.
211228
echo Test the install:
212229
echo echo {"tool_input":{"plan":"# Test Plan\\n\\nHello world"}} ^| plannotator
@@ -215,7 +232,7 @@ echo Then install the Claude Code plugin:
215232
echo /plugin marketplace add backnotprop/plannotator
216233
echo /plugin install plannotator@plannotator
217234
echo.
218-
echo The /plannotator-review and /plannotator-annotate commands are ready to use!
235+
echo The /plannotator-review, /plannotator-annotate, and /plannotator-last commands are ready to use!
219236

220237
REM Warn if plannotator is configured in both settings.json hooks AND the plugin (causes double execution)
221238
REM Only warn when the plugin is installed — manual-only users won't have overlap

0 commit comments

Comments
 (0)