Skip to content

Latest commit

 

History

History
85 lines (49 loc) · 36 KB

plugin.md

File metadata and controls

85 lines (49 loc) · 36 KB

Install and uninstall

plotkeeper records an agent's sessions through hooks, which run on each of its events. One command downloads plotkeeper, wires them and starts it:

npx plotkeeper

npm i -g plotkeeper and then plotkeeper does the same with a fixed version on your PATH. A start of the server (#434), whichever way it was reached, asks before it wires anything. After taking the data folder's lock and refreshing the hook copies, it prints a summary on stderr, where its question and what it then wires or rewires go too, so stdout's first line stays the page's address and plotkeeper > log still shows the question: one line per harness found, in the words install prints when it wires it; the harnesses not found, as skipped; where the hook binaries go; that events stay on this machine; and that plotkeeper uninstall undoes it. Then it asks Wire these? [Y/n], yes by default. On yes it wires those harnesses as install does, without saying each step again, and ends with one line naming the harnesses wired; on no it wires nothing. It serves the page either way.

  • The answers. Install's record (install/state.json in the data folder) keeps one answer per harness, wired or declined, under harnesses. A start asks only about the harnesses it finds with no answer: a harness installed later is asked about on its own, and when every harness found has an answer the start asks nothing. A harness an install from before #434 wired counts as wired: reading that record gives it a wired answer with no fingerprint, which the first save keeps, even while the harness is off the PATH, and which the next start that finds it rewires once. A record a later build saved says so (answers_kept), and in it a harness with no answer is unasked, so an uninstall that failed partway, which forgets the answers but keeps a step it could not undo, is never rewired by a start. A second start, one that finds a server running, never asks; while the first waits on its question it has no address yet, so a second start exits after 2 seconds saying the first may still be starting or waiting for an answer in its terminal.
  • The rewire on start (#438). With each harness it wires, install records a fingerprint of what it rendered for it: Claude Code's, agy's and Copilot's plugin folders, Codex's and Cursor's entries, Qwen Code's extension, OpenCode's plugin file, Cline's plugin folder, each with the hook binaries' path in it (a 64-bit FNV-1a hash, under harnesses in install/state.json). Each start compares it with what this build would render. When they are equal, that harness's CLI is not run, so a start where nothing changed runs none. When they differ for a wired harness found on the PATH, as after an upgrade that changed plugin/, plugin-agy/, plugin-codex/, plugin-cursor/, plugin-copilot/, plugin-qwen/, plugin-opencode/ or plugin-cline/, the start rewires that harness alone, as install does, without asking and with or without a terminal, and says so in one line: plotkeeper: rewired <harness>, as plotkeeper's hooks for it changed. A declined harness is never rewired. A harness whose rewire fails is said in one line, plotkeeper: could not rewire <harness>: <error>; run plotkeeper install to retry, and the start goes on to the other harnesses and to its question. For Codex it also says to run /hooks in Codex once and trust the changed hooks: Codex re-asks trust for a hook whose command, args, timeout or matcher change (openai/codex@a0d5b0a6), and skips it until then. A plain upgrade keeps the hooks' command path, so refreshing the hook copies alone needs no re-trust. A wired harness whose record has no fingerprint, from a build before #438 (or rewritten by one, which drops the field), is rewired once by the next start, which then stores its fingerprint, so it is never asked about again and later starts stay fast.
  • No terminal. When stdin is not a terminal, as from a script, a service or a pipe, the start never asks and never wires. It prints plotkeeper install --yes, stores no answer, so a later start in a terminal still asks, and serves.
  • The verbs. plotkeeper install wires every harness it finds, declined ones included, and records each as wired; running it is the consent, so it never asks. plotkeeper install --yes is the same, for scripts. plotkeeper uninstall also forgets every answer, so the next start asks again as on a first run.

v1 supports Claude Code, Codex, agy and Cursor. Install wires Copilot, Qwen Code, OpenCode and Cline too; they are v2. Copilot and Qwen Code were trialled end to end in #423, OpenCode not yet (#372), and Cline only by the real runs of #371 (decision, #423).

Install, whether from a start's yes or from plotkeeper install, works at user level, never in a repository, so your git trees stay clean. It prints each step, and a harness it does not find on the PATH is skipped with one line:

  • It copies plotkeeper-hook and plotkeeper-answer, from beside the plotkeeper executable, into the data folder's bin/ (~/Library/Application Support/plotkeeper/bin/). Every hook names that folder, in quotes since the path has a space, never a checkout or an npm folder, and each plotkeeper start brings the copies up to the binaries beside it (#356), so an upgrade reaches the hooks at the next start.
  • Claude Code: it renders plugin/ with that path into plugins/claude/ in the data folder, as a local marketplace of one plugin, and runs claude plugin marketplace add on it and claude plugin install plotkeeper@plotkeeper. claude writes enabledPlugins and extraKnownMarketplaces into ~/.claude/settings.json; plotkeeper never opens that file (AGENTS.md, Hard rules), and puts no hook in any settings.json. The plugin shows as plotkeeper@plotkeeper in claude plugin list.
  • agy: it renders plugin-agy/ with the path of plotkeeper-hook into plugins/agy/plotkeeper/ in the data folder, and installs it with agy plugin validate and agy plugin install, which copies it into ~/.gemini/config/plugins/plotkeeper/. A copy already there is backed up first.
  • Codex: Codex has no command for its hooks, so install adds plotkeeper's entries to its user-level hook file, ~/.codex/hooks.json, after a backup, beside any hooks of your own there, and makes the file when there is none. They are rendered from plugin-codex/hooks.json: on eight events (SessionStart, SessionEnd, UserPromptSubmit, PreToolUse, PermissionRequest, PostToolUse, Stop, Interrupt) Codex runs plotkeeper-hook --agent codex, in the background ("async": true, from Codex's hook docs), so it never waits on it; Codex runs a SessionEnd hook in the foreground all the same. Codex runs a hook only once you have trusted it, so install ends with that step: run /hooks in Codex once and trust plotkeeper's hooks. The file holds no credentials (Codex's hook docs give it no field for a key or a token); install never opens ~/.codex/config.toml, which can. While installed, the file's keys are written in sorted order.
  • Qwen Code: its hooks would otherwise go in its user-level ~/.qwen/settings.json, which can hold API keys (Qwen Code's authentication docs put them in its env block), so install never opens it (AGENTS.md, Hard rules) and wires an extension instead. It renders plugin-qwen/ with that path into plugins/qwen/plotkeeper/ in the data folder and runs qwen extensions install <folder> --consent on it, which copies it into ~/.qwen/extensions/plotkeeper/ (--consent skips the security prompt). A native extension's qwen-extension.json may carry a hooks object, which Qwen Code loads for every active extension; its extension docs do not say so, its source does (QwenLM/qwen-code at c134a03e5, packages/core/src/extension/extensionManager.ts, and packages/core/src/hooks/hookRegistry.ts: "Extension hooks are always loaded"), and its hooks docs run extensions' hooks after project, user and system ones. On nine events (SessionStart, SessionEnd, UserPromptSubmit, PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest, Notification, Stop) Qwen Code runs plotkeeper-hook --agent qwen, in the background ("async": true), except on SessionEnd, which runs in the foreground since Qwen Code stops a background hook still running when it exits. plotkeeper opens no file under ~/.qwen; qwen writes what it keeps of the install. The extension shows as plotkeeper in /extensions list. #423's trial (Qwen Code 0.28.4) recorded through it.
  • Cursor, in its IDE or its CLI (agent), found by ~/.cursor or by cursor or agent on the PATH: install adds plotkeeper's entries to the user-level hook file, ~/.cursor/hooks.json, after a backup, beside any hooks of your own there, and makes the file when there is none; never a project's .cursor/hooks.json, which would dirty the repository and runs only in trusted folders. They are rendered from plugin-cursor/hooks.json: on seven events (sessionStart, sessionEnd, beforeSubmitPrompt, postToolUse, postToolUseFailure, afterAgentResponse, stop) Cursor runs plotkeeper-hook --agent cursor. The file holds no credentials (Cursor's hook docs give it a version and a hooks object, with no field for a key or a token), and install opens no other file in ~/.cursor. While installed, the file's keys are written in sorted order.
  • Copilot (its CLI, and VS Code's agent, which shares its hooks): it renders plugin-copilot/ with that path into plugins/copilot/plotkeeper/ in the data folder and runs copilot plugin install on it, which copies it into Copilot's own plugin folder. On seven events (sessionStart, sessionEnd, userPromptSubmitted, preToolUse, postToolUse, postToolUseFailure, agentStop) Copilot runs plotkeeper-hook --agent copilot --event <name>: these camelCase payloads name no event, so each entry names its own. plotkeeper opens no file under ~/.copilot, where Copilot keeps its settings and may keep its login; copilot writes what it keeps of the install. The plugin shows as plotkeeper in copilot plugin list. VS Code's agent runs the plugin the CLI installed: #423's trial (VS Code 1.139.1) recorded each of its events once, under copilot, with no hook file of its own.
  • OpenCode (version 2): OpenCode has no command hooks and no install command for a local plugin file, and it loads every .js file in its user-level ~/.config/opencode/plugins/ (plugins docs, read at anomalyco/opencode v2.4.2). So install renders plugin-opencode/plotkeeper.js with that path into ~/.config/opencode/plugins/plotkeeper.js itself, through a temporary file, and records the folders it made for it; OpenCode reloads its plugins folder when it changes. The plugin passes each event it records to plotkeeper-hook --agent opencode. plotkeeper opens no other file of OpenCode's: opencode.json(c) and its login can hold API keys. A V1 plugin does not load in OpenCode 2, and this one does not load in OpenCode 1.
  • Cline: Cline keeps its API keys in its config folder (~/.cline by default, its provider settings in data/settings/providers.json), so install never opens a file there (AGENTS.md, Hard rules). Cline's hooks are its SDK plugins: install renders plugin-cline/ (a package.json naming its entry, and plotkeeper.js) with that path into plugins/cline/plotkeeper/ in the data folder and runs cline plugin install <folder> on it, which copies it into ~/.cline/plugins/_installed/local/. It first runs cline plugin uninstall plotkeeper (a plugin Cline does not have counts as uninstalled), as Cline CLI 3.0.76 refuses to install over an earlier install (its --force would replace it, but no code path of plotkeeper's spells a force option, as workbench/tests/tasks.rs checks). Cline's hook files (~/.cline/hooks/<Event>, run with the event on stdin) are not used: their prompt hook never sees the user's prompt (see below). Checked with Cline CLI 3.0.76.
  • The old setup: so that no event is recorded twice, it removes what the archived desktop app set up, after a backup. In ~/.zshrc, from each export CLAUDE_CODE_PLUGIN_DIRS= line, the entries that end in plotkeeper/checkout/plugin or dev.falinks.studio/checkout/plugin (the data folder's link into a checkout, by its name before #322); a line left with no entry goes, and so does the app's comment above it. With agy found, agy's old plugin studio is uninstalled.

The backups and a record of what install did are in install/ in the data folder. A second install keeps the first backups and replaces its own plugins, and in ~/.codex/hooks.json and ~/.cursor/hooks.json it first takes out every entry whose command names the data folder's bin/, so no entry of an older template stays beside the current ones (#435). After you change plugin/, plugin-agy/, plugin-codex/, plugin-cursor/, plugin-copilot/, plugin-qwen/, plugin-opencode/ or plugin-cline/, the next start of a build with the change rewires the wired harnesses it touched, or run install again: the agents run the copies install made.

Install and uninstall write ~/.zshrc, ~/.codex/hooks.json, ~/.cursor/hooks.json and the record through a temporary file beside the file, renamed into place, so a crash mid-write leaves the old file whole (#548). A file that is a symlink, as a dotfile manager makes, stays a symlink: the file it points at is the one replaced, and it keeps its permissions.

To take it all back:

plotkeeper uninstall

Uninstall puts ~/.codex/hooks.json and ~/.cursor/hooks.json back as they were (or removes one, when install made it); a file you changed after install keeps your changes and loses only plotkeeper's entries. It removes ~/.config/opencode/plugins/plotkeeper.js when it is plotkeeper's, puts back a plotkeeper.js of yours that install found there and backed up, leaves one you wrote over plotkeeper's, and removes each folder install made for it that is left empty. It runs copilot plugin uninstall plotkeeper, qwen extensions uninstall plotkeeper, cline plugin uninstall plotkeeper (a plugin Cline no longer has counts as uninstalled), agy plugin uninstall plotkeeper and claude plugin uninstall plotkeeper@plotkeeper and claude plugin marketplace remove plotkeeper for what install added, installs the agy plugins it backed up again, puts ~/.zshrc back as it was, and removes the data folder's bin/, plugins/ and install/, and nothing else: the event log and the stores stay. It ends by saying so, with the data folder's path, when that folder still holds anything, and that a package installed with npm i -g is removed with npm uninstall -g plotkeeper, since uninstall cannot remove the package it runs from. Of ~/.zshrc install keeps only the lines it removed, and where they were, never a copy of the file. A ~/.zshrc you changed around those places after install is left as it is, and uninstall prints the removed lines.

What Codex's hooks record

Codex's payloads are near Claude Code's, read by core/src/codex.rs: its prompts, tool calls (Bash as commands, apply_patch as edits, mcp__… as external tools), permission requests, turn ends and interrupts, and the model and permission mode each event names. Its transcript is not read, so a Codex session shows no context size. The hook records its turns' trees as it does Claude Code's (#426), reading turn_id as the turn and an apply_patch as an edit of the first file its patch names, so its turns list the files they changed and their summaries' facts carry them. Codex runs plotkeeper's hooks with "async": true, so a call that first touches a worktree other than the session's folder may run before its PreToolUse records that worktree's start tree, and the turn then loses that call's change. The hook gives a Codex line's trees 1.2 seconds and its wait for the log's lock 1 second, inside the 3 seconds its Interrupt and SessionEnd entries allow and the 5 of the others; past the 1.2 seconds the trees are given up, their git stopped, and the line is logged without them, so the turn's next touch of a worktree records its start tree. A file an apply_patch changes is that turn's own, with codex as its agent, though another session's call names it. Its subagents are not wired yet, and its questions and permission prompts stay in Codex's own terminal. Wave 1's trial (#369, Codex 0.171 and 0.172) recorded each event once, under codex. Codex's TUI runs its hooks from its shared app-server daemon (under ~/.codex/packages/app-server-daemon/), which outlives every session and sends no SessionEnd on Ctrl+C, so the hook records no pid for it and the session goes idle after a while with no event. codex exec runs its hooks itself: its pid is recorded, and it sends SessionEnd.

What Qwen Code's hooks record

Qwen Code's payloads are near Claude Code's, read by core/src/qwen.rs from lines its hook entries mark --agent qwen: its prompts (each turn by its prompt_id), tool calls (run_shell_command as commands, write_file and edit as edits, with how long each took, and PostToolUseFailure as a failed call), permission requests and notices, turn ends with the reply, the model SessionStart names and the permission mode each event names. Its transcript is not read, so a Qwen Code session shows no context size, and no turn trees are recorded for it, so its turns list no files. Its subagents are not mapped yet: a subagent's calls show as its parent's. The adapter is built from Qwen Code's hook docs. #423's trial checked it: each event once under qwen, with Qwen Code's own pid, a written summary, and SessionEnd on /quit; a headless qwen -p run sent no SessionEnd.

What OpenCode's plugin records

OpenCode 2 runs its plugins in one background service (opencode serve --service) that every OpenCode window and opencode run talks to, and loads a plugin once for each folder a session runs in. The plugin's hooks see only that folder's sessions, but its event stream is the whole service's, so it records the stream's events only for the sessions its own hooks saw, and each event is recorded once. core/src/opencode.rs reads its lines: each prompt (the session prompt hook) starts a turn, tool calls come from the tool hooks (shell as commands, write, edit and patch as edits, with paths made absolute from the session's folder, and a call that errs or a shell that exits non-zero as failed, with its exit code), permission.asked waits on you until its call ends (the plugin sends an ask with its call's tool and input, holding one that comes before its call starts, as OpenCode asks a write call's permission as an edit), and a turn ends with session.execution.succeeded, .failed or .interrupted, carrying the turn's last text as its reply and the model its steps named. A top-level turn's end also carries the session's context size (context_tokens, #719): the input tokens of the turn's latest session.step.ended, its input + cache.read + cache.write, the same measure as Claude Code's, so the header shows it as it does a Claude Code session's. It updates when a turn ends, not at each step. A subagent's steps never set it, and its run's end carries no count; an end without one (a turn that ended before any step did, or a log from the plugin before #719) keeps the size the session last had. A subagent is a child session of its own, which OpenCode always runs in the background (#718): it shows as a subagent of the session that spawned it, named by its subagent call's description, with its type (such as general), its calls and asks, and its reply. Its spawn's end names the child (spawned_session_id, from the call's metadata.sessionID), each of its lines names it (subagent_session_id), and each of its runs ends with its last text as its reply, a .failed or .interrupted run ending it as completed too; its prompt is its spawn's and is not recorded. When a child's run ends, OpenCode puts its result in its parent's inbox (session.inbox.enqueued, an item whose metadata names the child and its state, completed, error or cancelled) and delivers it into the turn that takes it (session.inbox.delivered): a turn it starts with no prompt, a wake-up, or one already running, and one turn can take several (#779; OpenCode's background results). The plugin holds a wake-up until its turn's first step, or its turn's next line, and sends it with the subagent results the turn took by then (reported, each a subagent_session_id and its state); a result delivered later in a turn goes on a line of its own, session.inbox.delivered, with the same reported. A shell, image, video or Code Mode job's result is not sent. A wake-up shows as worker <name> returned, or workers A and B returned for several, naming in delivery order each subagent whose result its turn took, one that joined it later included; a wake-up that took none, as a shell job's, shows as background job returned. A result delivered into a turn Daniel prompted leaves his prompt as it is, and one whose line lands after its turn ended, or a wake-up the hook took late, names no one. Each result ends its child with its status, in the studio's words: completed, failed for error and interrupted for cancelled, as a Claude subagent's are; it overrides the end of the child's run, which carries no status and ends it as completed, whichever line lands first. A child that reports again after later work, whose first call after its end runs it again, ends again with its new result's status. A log from the plugin before #779 has no reported: its wake-up names the subagent with the latest event, so with two subagents running a wake-up that lands before its child's end can name the other one, and its children end completed. A log from the plugin before #718 has no spawned_session_id and no child's end, so its children show unattached, named by the first characters of their id, and stay running; an ask of a child's call in such a log, which names no subagent, waits until its turn ends.

OpenCode reports no session start or end, and its plugin runs in the shared service, not in the session's terminal. So an OpenCode line records no pid (studio_pid): the process check cannot end an OpenCode session, which takes the idle path, as Codex's do (#369). Its transcript is not read; its context size comes from its turns' ends, above.

An OpenCode turn lists the files it changed (#717). The hook records each turn's trees as it does Codex's and Cursor's: it maps a prompt or a wake-up to a turn's start, a call's start and end to its steps (a write, edit or patch editing its path, relative to the session's folder, and a shell running its command), and a run's end to the turn's end, or with subagent_session_id to that subagent's, whose touches are a worker's. The plugin spawns one hook an event and never waits for it, so a session's lines reach the hook in any order: each line carries when the plugin sent it (sent_ms; a log from the plugin before #717 has none, and the hook takes when it got the line), and the hook leaves out of the turns a line sent before the turn it is in began, or a start sent before the last end it took. A turn whose end reached the hook before its start then records no trees, and lists no files, rather than another turn's. The hook keeps the session's record locked until the line is in the log, so the log holds a session's lines in the order the hook took them, and marks a line it left out of the turns as late (studio_late, #744). The core reads a late line as one of a turn already past: its end ends no turn and its reply is dropped, as the next start already ended its turn, its start has no prompt id, so it neither ends the running turn nor starts one of its own while that turn runs, and a call it starts or ends is the previous turn's. A wake-up's prompt id is when it was sent, as in the hook, so a wake-up that lands before the last turn's end still ends that turn and starts its own. As with Codex's async hooks, a call's start may record the start tree of a worktree other than the session folder's after the call changed it.

The adapter's fixtures are real runs of OpenCode 2.4.1 (core/tests/fixtures/opencode/run.jsonl and asks.jsonl, from the plugin before #718, and subagent.jsonl, a background subagent) and of OpenCode 2.4.2 (context.jsonl, the plugin since #719, with a background subagent); #372's trial by hand (OpenCode 2.4.2) recorded each event once under opencode, with a written summary, and a run with two subagents at once, whose two wake-ups each named the subagent that had just ended, as each child's end reached the log before its wake-up on that run, from the plugin before #779. No real run has shown a result in state error or cancelled yet: those come from OpenCode's code and tests.

What Cline's plugin records

Cline (CLI 3.0.76, its SDK at @cline/core 0.2.2) loads plotkeeper's plugin for each session, and in the CLI runs it inside cline's own process, so the hook records cline's pid and the process check ends the session when cline exits. The plugin's runtime hooks pass each event to plotkeeper-hook --agent cline, one at a time, so the lines keep Cline's order, without making Cline wait: Cline gives a plugin's hook 3 seconds and stops calling a plugin whose hooks fail 5 times in a row. Only a run's end waits for the lines sent so far, up to 2.5 seconds, so a one-shot cline writes its last line before it exits. core/src/cline.rs reads them: a run is a turn, keyed by its run id, whose prompt is the run's last message (beforeRun), without the <user_input mode="…"> tag Cline wraps a typed prompt in; tool calls come from beforeTool and afterTool (editor and apply_patch as edits, run_commands as commands, one a line, and ask_question as an ordinary call, since its input is not the questions list the page's question cards read and Cline reports no answer), and a call fails when Cline says it erred or when one of its commands or files did not succeed, which Cline tells only in that part's entry, with a command's exit code; afterRun ends the turn, its reply the longer, by words, of the run's final text and the text of the run's last message that has any: a headless cline ends its run with submit_and_exit, which makes its final text Cline's Submission recorded (…) line, 87 words against the 396 of the answer it showed in #372's trial, while a short message before the submission keeps that line. The plugin sends each part's outcome without its result, which can be a whole file. Cline names no model to its plugins and reports no session start or end and no permission ask, and its transcript is not read, so a Cline session shows no model, no context size and no turn trees. A subagent's run (one with a parent agent, which spawn_agent starts and waits for) neither starts nor ends the session's turn: its calls go under the session with the subagent's id, and its run's end ends the subagent; no real run of Cline's subagents has checked that.

Cline's hook files were tried first: Cline 3.0.76 runs a file named for each event (TaskStart, PreToolUse, PostToolUse, UserPromptSubmit, TaskComplete, …) found in ~/.cline/hooks/, ~/Documents/Cline/Hooks/ or a project's .clinerules/hooks/, with the event as JSON on stdin. But its prompt_submit fires only for user messages added after a run starts, and Cline adds the user's prompt before that (executeRunInternal appends it to the conversation directly), so a hook file saw only Cline's own completion reminder, never the prompt. The adapter's fixture is a real headless run of Cline CLI 3.0.76 (core/tests/fixtures/cline/run.jsonl). A headless cline --json run is one turn: --id makes the CLI interactive, so a second turn of one session has not been recorded. The fixture's plugin was installed into the project's .cline/plugins/ (cline plugin install --cwd); a plugin installed the way install does, into ~/.cline/plugins/, was checked to load with a run that had no key. Which pid an interactive session's lines carry (if its sessions run in Cline's hub daemon, the daemon's) is not checked.

What Cursor's hooks record

Cursor's payloads have their own names, read by core/src/cursor.rs: a session is its conversation_id, and a turn its generation_id. It records prompts, each tool call whole at its end (Shell as commands, Write and Delete as edits, Task as a subagent's spawn, MCP:… as external tools; a failed call as failed), the agent's reply, turn ends (an aborted stop as an interrupt) and the model each event names. preToolUse and Cursor's other permission hooks are not wired: Cursor blocks the action when such a hook replies with nothing, so a running call shows only once it ends, and Cursor's questions and permission prompts stay in Cursor. Its transcript is not read, so a Cursor session shows no context size. The hook records its turns' trees as it does Claude Code's (#426), reading generation_id as the turn, the first workspace root as the folder of an event with none, a Write or Delete as an edit and a Shell call as a command run in the folder its tool_input.cwd names (the first root when that is empty, as in every call of wave 1's trial), so its turns list the files they changed and their summaries' facts carry them. Cursor sends nothing before a call, only postToolUse after it, so the hook takes the start trees of every workspace root at the turn's prompt; the prompt touches only its folder's, so a root the turn never works in is not counted as touched, though its end tree is still taken at the turn's end. When a prompt's trees are given up, the next touch is a call's postToolUse, so that call's own change is lost as for a worktree outside every root. A worktree outside every root still records its start after its first call, so a file that call changes is lost: Cursor's events before a call (preToolUse, beforeShellExecution) are permission hooks, not wired. The hook gives a Cursor line's trees 1.2 seconds and its wait for the log's lock 1 second, of the 5 seconds its entry allows; past the 1.2 seconds the line is logged without its trees, as Codex's is. A file a Write or Delete changes is that turn's own, with cursor as its agent, though another session's call names it.

Cursor also runs Claude Code's hooks, so one Cursor event could reach plotkeeper's Claude Code entry too. plotkeeper-hook --agent claude drops an event whose payload carries cursor_version, with one line on its stderr, and Cursor's own entry records it once, as Cursor's. In Cursor's IDE the hook's parent is the window's extension host, which renames itself (Cursor Helper (Plugin): extension-host <folder>), so its pid is recorded: the session ends, by the process check, when its window closes, since Cursor sends no sessionEnd on quit. A finished chat in an open window stays at your turn. The CLI's pid is recorded and checked as Claude Code's is. Wave 1's trial (#369, Cursor 3.31 and CLI 2026.11.22) recorded each event once, under cursor, in both; neither ran Claude Code's plugin hooks. Cursor sends afterAgentResponse and stop a few milliseconds apart in either order; the reply is its turn's either way. The headless CLI (agent -p) sends no prompt, reply or stop, so it records no turn. Cursor.app sends a sessionStart with no workspace root from its empty window at launch; such a session is recorded but shows no row until its first prompt (#427).

What Copilot's hooks record

Copilot's payloads come in two casings, by the casing of the event name an entry is wired to: camelCase (sessionId, toolName, toolArgs as a JSON string), which install wires, and snake_case (hook_event_name, session_id, tool_input, with Claude Code's tool names), for PascalCase names. core/src/copilot.rs reads both: prompts, tool calls (Copilot CLI's bash and VS Code's run_in_terminal as commands; edit, create and apply_patch and VS Code's insert_edit_into_file as edits, by path, filePath or the file the patch names) and failed calls, and turn ends. Copilot's payloads have no call id, so a call's start and end are paired by its tool and arguments; no turn id, model, reply text or permission mode, so a Copilot session shows none of those; its permission requests are not wired, since their payload is not documented, and stay in Copilot. No turn trees are recorded for it. Its transcript is read only for a turn's reply: the last assistant.message before the stop, which Copilot CLI's transcript marks with a hook.start record carrying the stop's numeric timestamp, and VS Code's, which has no hook records, by the records' own ISO timestamp. The adapter is built from Copilot's hooks reference and checked in #423's trial: Copilot CLI 1.0.114 sent sessionEnd on both /exit and Ctrl+C. VS Code's agent runs the same camelCase entries but sends snake_case payloads with a PascalCase hook_event_name, an ISO timestamp, a tool_use_id and its own tool names (run_in_terminal, insert_edit_into_file, read_file), and sends no sessionEnd when its window closes.

In VS Code, the agent's hooks run under VS Code's own processes, which outlive any session. When the process the hook would record is inside a macOS app bundle (.app/Contents/ in its path, as ps names it, which VS Code's are), the hook records none, so the session is never ended by the process check and is marked "idle?" after the quiet period. On Linux the same holds for a VS Code or Cursor install path, which the hook reads from /proc/<pid>/exe (system packages, /opt, snaps, AppImage mounts; the list is in sessions). Copilot's CLI in a terminal, VS Code's included, is its own process and is checked like any agent.

Copilot reads .claude/settings.json too; plotkeeper puts no hook there, so Claude Code's entry never records a Copilot event. The agent guard drops a Copilot CLI payload sent to another entry by its camelCase sessionId, as it does Cursor's (copilot_payload in hook/src/lib.rs). VS Code's payload has no such marker (its keys are Qwen Code's too), and needs none: in #423's trial no Copilot event reached Claude Code's entry.

What the Claude Code plugin does

On thirteen hook events it runs plotkeeper-hook --agent claude, which appends the event to the event log. Answering from the page is Claude Code only: plotkeeper-answer holds a question, a plan's approval or a permission until you answer on the page. It runs as plotkeeper-answer --agent claude: Copilot's CLI loads a plugin laid out as Claude Code's, its hooks included (its plugin reference), and Codex runs a plugin's hooks/hooks.json (its hook docs), so a payload with another harness's marker (Cursor's cursor_version) is let through at once, with no card, as plotkeeper-hook drops it.

A blocked command (PermissionDenied) is only logged by plotkeeper-hook, like every other event: no hook waits on it, so the agent's own UI handles the denial, and the session reads as waiting on Daniel until it moves on (#572).

plotkeeper map check

plotkeeper map check [--json] [--root <dir>] [--commit <rev>] checks the repository's system-map.json as system-map check does, in CI or at the prompt, with npx -y plotkeeper map check: the same problems or the same pass line on standard output (--json prints the report instead), its notes on standard error, and the same exit codes, 0 on a pass, 1 on a fail and 2 on an error such as an unknown argument. It runs the code of the system-map crate's cli module, which the system-map binary also runs, so the two print the same. --root defaults to the repository the command is run in, and --commit checks one commit without checking it out. touched and imports stay system-map's own: any other plotkeeper map argument is refused as an unknown command.