Added
toksave doctor --fixrepairs broken agent wiring: Previously--fixonly reinstalled/repaired tool binaries (RTK, CodeGraph, ...); a hook or MCP entry reported as missing was never actually rewired — doctor just told you to re-runtoksave.--fixnow unwires and cleanly rewires every(agent, tool)pairverify_toolreports as not-wired, for all 9 agents × 6 tools, then re-verifies and records the manifest entry. Tools whose underlying binary was never installed are left alone rather than wiring a config that points at nothing. Plaindoctor(no--fix) makes no changes, as before.toksave uninstallwarns on residual wiring: afterunwire_tool, uninstall now re-checksverify_tooland warns if a hook/MCP entry survives instead of silently trusting the unwire succeeded.
Fixed
- RTK hook never fires for Warp, Antigravity, Codex, Droid, or Devin:
toksave rtk-hook <agent>only recognizedtool_namevaluesbash|shell|run_command|execute_command|cmd|sh|pwsh, but the real tool names are agent-specific: Cursor sendsShell, Antigravity/Gemini CLI sendsrun_shell_command, Factory Droid sendsExecute(exact case), Devin CLI sendsexec. The hook silently produced no output for all of these, so RTK never rewrote a single command on those agents. Matchers are now per-agent and exact where the agent's real tool name is confirmed (against each agent's own hook docs and RTK's ownhooks/README.md), falling back to a broad matcher for unlisted agents. - Wrong response JSON per agent: Cursor's real contract (confirmed against
rtk-ai/rtk's own hook implementation) is a top-level{"permission":"allow","updated_input":{...}}, and it requires{}— not empty stdout — on every no-rewrite path; toksave was emitting Claude-shapedhookSpecificOutput.updatedInput, which Cursor ignores. Antigravity/Gemini's contract is{"decision":"allow","hookSpecificOutput":{"tool_input":{...}}}; toksave emittedmodifiedToolInput, which Gemini CLI doesn't read. Codex, Droid, and Devin all use Claude'shookSpecificOutput.updatedInputshape, notmodifiedToolInput— Codex was previously miscategorized into the wrong bucket. - Factory Droid RTK hook wired to a directory Droid never reads: toksave wrote
~/.factory-droid/hooks.json; Droid's real hooks file (confirmed againstdocs.factory.ai/harness/hooksandrtk-ai/rtk#912) is~/.factory/hooks.json. Fixed the path and added self-healing cleanup of the old location on every wire/unwire. - Devin CLI RTK hook wired to the wrong file and tool name: toksave wrote a standalone
~/.devin/hooks.jsonwith matcherExecute; Devin's real hooks (perdocs.devin.ai/cli/extensibility/hooks/overview) are nested under the"hooks"key of~/.config/devin/config.json(%APPDATA%\devin\config.jsonon Windows), and its shell tool is namedexec, notExecute(that's Droid's tool name). Fixed both, with self-healing cleanup of the old file. - GitHub Copilot CLI RTK hook: fixed a typo'd filename (
tokless-rtk.json→toksave-rtk.json) and rewrote the hook to match Copilot CLI's real dual-format contract (docs.github.com/en/copilot/reference/hooks-reference): camelCasetoolName/toolArgs(a JSON-encoded string) for the native CLI, snake_casetool_name/tool_inputfor the VS Code Copilot Chat extension, with amatcher: "bash"hook entry and a propermodifiedArgsrewrite instead of a deny-and-hope-they-retry response. - RTK prefix used a bare
rtkthat can fail on Windows / GUI-launched agents: if RTK was just installed and the agent's shell session predates the PATH update (or has a minimal PATH), the rewritten command failed with'rtk' is not recognized. The hook now resolves the absolute path to the locally-managedrtkbinary when present, falling back to barertkonly when nothing is locally installed. Applied to the Rust hook and the OpenCode plugin. - Claude Code:
~/.claude/CLAUDE.mdcould carry a dangling@RTK.mdreference after RTK's ownRTK.mdwas removed; the strip logic only ran againstAGENTS.md. Now strips from both. - Warp has no confirmed hook engine: extensive research against
docs.warp.devturned up no PreToolUse-style hook mechanism for the Warp Agent CLI or desktop app (unlike Claude, Cursor, Gemini CLI, Droid, and Devin, which all have documented hook contracts) — RTK itself doesn't list Warp as a supported agent either. toksave no longer writes a~/.warp/hooks.jsonRTK entry; it relies onrtkbeing on PATH instead, and opportunistically cleans up any hook file a pre-1.2 toksave wrote plus dead/$bunfs/root/toksavereferences left behind by very old Warp CLI installs. - Antigravity CLI: dead
~/.antigravityfallback directory: with Gemini CLI being discontinued in favor of Antigravity CLI, toksave fell back to~/.antigravitywhenever~/.geminididn't exist yet (e.g. a machine withagyinstalled but never launched once). Antigravity CLI never creates or reads~/.antigravityat all — confirmed by Google's own Gemini CLI migration guide and by two separateantigravity-cliCHANGELOG bug-fix entries, both pointing at the shared~/.gemini/config/directory.antigravity_paths()now always targets~/.gemini, so hooks and instruction files wired before the CLI's first launch actually land where Antigravity reads from. - Antigravity CLI: wrong MCP config filename: toksave wrote CodeGraph/Context-Mode MCP servers to
~/.gemini/mcp.jsonand~/.gemini/config/mcp.json; Antigravity CLI's real, documented file is~/.gemini/config/mcp_config.json(perantigravity.google/docs/cli/gcli-migration). Fixed the filename. - MCP verify treated key-exists as success: a leftover
/$bunfs/root/toksavecommand, a dead binary, or wrongrunmcpargv still counted as wired, sodoctor --fixprintedall tools wiredand skipped rewrite. Verify now requires the livetoksave_abs()plus the expectedrunmcpargv.--fixalso rewires tools whoseprobe_agentreportsbinary not found/ bunfs / PowerShell-hostile forward-slash hook paths, triestool_repairbefore rewire for missing npm tools, and prints a Windows PATH hint (%APPDATA%\npm,%LOCALAPPDATA%\Programs\toksave) when CodeGraph/Context-Mode still cannot be installed. - Windows hook/RTK paths assumed Git Bash: 1.0.3 wrote
C:/Users/.../toksave.exeso Git Bash would not treat backslashes as escapes. That form is valid in cmd.exe and as MCP CreateProcess argv, but Windows PowerShell 5.1 (and typically pwsh 7) parseC:as Set-Location and/Users/...as a switch — machines with only cmd + PowerShell never run the hook. Shell strings (hookcommandand RTK prefixes) now use backslashes viatoksave_hook_command()/winsh; MCPcommandstays forward-slashtoksave_abs(). Doctor no longer treats backslash as stale. Re-runtoksave initortoksave doctor --fixafter upgrading. Git Bash is not required. - Official
rtk init --auto-patchstacked a second Claude hook:rtk hook claudenext totoksave rtk-hook claudemade both fire (rtk rtk git status). Verify is now false while the native sibling exists; wire/doctor --fixremoves it. Doctor also notes thatrtk init --showreports the Claude hook missing when only toksave's wrapper is present — keeprtk init -g --no-patch. - Cursor CLI hooks went to
$XDG_CONFIG_HOME/cursor: Cursor reads~/.cursor/hooks.json(confirmed against Cursor's own hooks docs). Official RTK already writes that file; the XDG path left two competing configs.cursor_paths()now always uses~/.cursorunlessCURSOR_CONFIG_DIRis set, and nativertk hook cursorsiblings are stripped on wire. - Absolute
rtkprefix could rewrite twice: the hook skipped only a barertkprefix, so a second PreToolUse pass turned/path/to/rtk lsinto/path/to/rtk /path/to/rtk ls. It now treats the resolved prefix (quoted when the path has spaces) as already rewritten.
Minimum RTK version for the binary hook engine used by all of the above: 0.37+.
Contributors
- Huge thanks to @jondmarien for contributing exact per-agent RTK hook contracts, self-healing doctor/uninstall repairs, and Windows cmd/PowerShell compatibility in #28!