Skip to content

Releases: agungprasastia/toksave

v1.2.0

Choose a tag to compare

@github-actions github-actions released this 19 Aug 04:43

Added

  • toksave doctor --fix repairs broken agent wiring: Previously --fix only reinstalled/repaired tool binaries (RTK, CodeGraph, ...); a hook or MCP entry reported as missing was never actually rewired — doctor just told you to re-run toksave. --fix now unwires and cleanly rewires every (agent, tool) pair verify_tool reports 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. Plain doctor (no --fix) makes no changes, as before.
  • toksave uninstall warns on residual wiring: after unwire_tool, uninstall now re-checks verify_tool and 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 recognized tool_name values bash|shell|run_command|execute_command|cmd|sh|pwsh, but the real tool names are agent-specific: Cursor sends Shell, Antigravity/Gemini CLI sends run_shell_command, Factory Droid sends Execute (exact case), Devin CLI sends exec. 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 own hooks/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-shaped hookSpecificOutput.updatedInput, which Cursor ignores. Antigravity/Gemini's contract is {"decision":"allow","hookSpecificOutput":{"tool_input":{...}}}; toksave emitted modifiedToolInput, which Gemini CLI doesn't read. Codex, Droid, and Devin all use Claude's hookSpecificOutput.updatedInput shape, not modifiedToolInput — 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 against docs.factory.ai/harness/hooks and rtk-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.json with matcher Execute; Devin's real hooks (per docs.devin.ai/cli/extensibility/hooks/overview) are nested under the "hooks" key of ~/.config/devin/config.json (%APPDATA%\devin\config.json on Windows), and its shell tool is named exec, not Execute (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.jsontoksave-rtk.json) and rewrote the hook to match Copilot CLI's real dual-format contract (docs.github.com/en/copilot/reference/hooks-reference): camelCase toolName/toolArgs (a JSON-encoded string) for the native CLI, snake_case tool_name/tool_input for the VS Code Copilot Chat extension, with a matcher: "bash" hook entry and a proper modifiedArgs rewrite instead of a deny-and-hope-they-retry response.
  • RTK prefix used a bare rtk that 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-managed rtk binary when present, falling back to bare rtk only when nothing is locally installed. Applied to the Rust hook and the OpenCode plugin.
  • Claude Code: ~/.claude/CLAUDE.md could carry a dangling @RTK.md reference after RTK's own RTK.md was removed; the strip logic only ran against AGENTS.md. Now strips from both.
  • Warp has no confirmed hook engine: extensive research against docs.warp.dev turned 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.json RTK entry; it relies on rtk being on PATH instead, and opportunistically cleans up any hook file a pre-1.2 toksave wrote plus dead /$bunfs/root/toksave references left behind by very old Warp CLI installs.
  • Antigravity CLI: dead ~/.antigravity fallback directory: with Gemini CLI being discontinued in favor of Antigravity CLI, toksave fell back to ~/.antigravity whenever ~/.gemini didn't exist yet (e.g. a machine with agy installed but never launched once). Antigravity CLI never creates or reads ~/.antigravity at all — confirmed by Google's own Gemini CLI migration guide and by two separate antigravity-cli CHANGELOG 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.json and ~/.gemini/config/mcp.json; Antigravity CLI's real, documented file is ~/.gemini/config/mcp_config.json (per antigravity.google/docs/cli/gcli-migration). Fixed the filename.
  • MCP verify treated key-exists as success: a leftover /$bunfs/root/toksave command, a dead binary, or wrong runmcp argv still counted as wired, so doctor --fix printed all tools wired and skipped rewrite. Verify now requires the live toksave_abs() plus the expected runmcp argv. --fix also rewires tools whose probe_agent reports binary not found / bunfs / PowerShell-hostile forward-slash hook paths, tries tool_repair before 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.exe so 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) parse C: as Set-Location and /Users/... as a switch — machines with only cmd + PowerShell never run the hook. Shell strings (hook command and RTK prefixes) now use backslashes via toksave_hook_command() / winsh; MCP command stays forward-slash toksave_abs(). Doctor no longer treats backslash as stale. Re-run toksave init or toksave doctor --fix after upgrading. Git Bash is not required.
  • Official rtk init --auto-patch stacked a second Claude hook: rtk hook claude next to toksave rtk-hook claude made both fire (rtk rtk git status). Verify is now false while the native sibling exists; wire/doctor --fix removes it. Doctor also notes that rtk init --show reports the Claude hook missing when only toksave's wrapper is present — keep rtk 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 ~/.cursor unless CURSOR_CONFIG_DIR is set, and native rtk hook cursor siblings are stripped on wire.
  • Absolute rtk prefix could rewrite twice: the hook skipped only a bare rtk prefix, so a second PreToolUse pass turned /path/to/rtk ls into /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!

v1.1.0

Choose a tag to compare

@agungprasastia agungprasastia released this 17 Aug 12:46

Added

  • Cursor CLI agent: Full support for the Cursor Agent CLI (cursor / cursor-cli). Wires user-global ~/.cursor/ config shared with the Cursor editor: native hooks.json preToolUse + cli-config.json Shell(rtk *) allow for RTK, mcp.json for CodeGraph and Context-Mode, and AGENTS.md instruction owners for Caveman, Ponytail, and Principles, with official brand icon assets/agents/cursor.png. Special thanks to @jondmarien in #26.
  • Warp Agent CLI MCP wiring: Warp / Oz now writes CodeGraph and Context-Mode to the official desktop file (~/.warp/.mcp.json) and the standalone Agent CLI MCP file, in addition to the existing ~/.warp/mcp.json. Detection also treats the oz binary and CLI config dir as installed. Doctor probe includes the new MCP paths. Special thanks to @jondmarien in #25.

Contributors

  • Huge thanks to @jondmarien for contributing support for Cursor CLI and Warp Agent CLI!

v1.0.3

Choose a tag to compare

@agungprasastia agungprasastia released this 08 Aug 09:50

Fixed

  • Windows: backslash paths break Git Bash hooks: toksave_abs() returned native Windows paths (C:\Users\...\toksave.exe) which break in Git Bash (backslashes interpreted as escape characters). Now normalizes to forward slashes (C:/Users/.../toksave.exe) on Windows — valid in cmd.exe, PowerShell, and Git Bash. Users must re-run toksave init after upgrading to rewrite configs with safe paths. (@jondmarien in #24)
  • Doctor probe false positives on non-toksave MCP entries: toksave doctor probed every "command" key in agent config files, including user-owned MCP servers (e.g. node, shell builtins [, if), reporting spurious binary not found warnings. Probe now filters to toksave-owned commands only via is_toksave_exe() check. (@jondmarien in #24)

v1.0.2

Choose a tag to compare

@github-actions github-actions released this 06 Aug 11:12

Fixed

  • Codex RTK unwire deletes user PreToolUse hooks: unwire(Rtk) removed the whole PreToolUse array, deleting user-owned hooks and potentially hooks.json. It now removes only the managed rtk-hook codex entry. Regression test added.
  • Codex Principles unwire accepts malformed hooks config: A non-object hooks value was silently left in place while ownership metadata was removed. Unwire now returns a config error without changing either file or manifest.
  • Agent selector mismeasures Unicode hints: Hint truncation counted Unicode characters instead of terminal display columns; wide CJK characters or emoji could still wrap a selector row. It now uses Unicode display width.

v1.0.1

Choose a tag to compare

@github-actions github-actions released this 04 Aug 15:30

Fixed

  • Agent selector corrupts after terminal wrapping: Long agent URLs could wrap on narrow terminals, while the interactive redraw assumed every option consumed one row. URLs are now truncated to the current terminal width so redraw height stays correct.
  • Agent selector corrupts on terminal events: The selector reused a fixed number of cursor-up operations between frames; terminal resize or focus events could leave stale frames on screen. It now renders in an alternate screen and clears each frame.
  • Agent selector columns drift in raw mode: Raw terminal mode disables automatic LF-to-CRLF conversion, so option rows began at the previous row's ending column. Selector rows now explicitly return to column zero.
  • UI progress bar splits multi-word agent names: Progress::stop split status messages on the first space, causing multi-word agent labels (Claude Code, GitHub Copilot, Devin / Cascade, Warp / Oz) to wrap after the progress bar (✔ Claude [████...] 100% Code). Added parse_label_and_tail in src/util/ui.rs which matches against known agent/tool labels (sorted longest-first) before splitting. Unit tests added. (@jondmarien in #23)
  • Doctor probe misreports managed hooks as missing: MANAGED_HOOKS in src/util/probe.rs did not list codex-perm-hook or context-mode-hook, causing toksave doctor to treat them as unmanaged external binaries and report "binary not found". Both now registered. (@jondmarien in #23)
  • Caveman version mismatch after update: installed_version() always returned the hardcoded embedded fallback 1.9.1, causing toksave doctor to perpetually report an upgrade available. Now writes the fetched release version to cache_dir()/caveman.version on install and reads it first. Bumped embedded CAVEMAN_SKILL_VERSION to 1.10.0. (@jondmarien in #23)
  • Legacy Bun binary paths persist across upgrades: Old /$bunfs/root/toksave virtual paths in ~/.claude/settings.json and ~/.codex/hooks.json persisted because rewiring logic was not stripping stale paths. Claude override_claude_rtk_hook now replaces any existing rtk-hook claude command (including legacy paths) with the active binary path. Codex RTK wiring uses merge_hook_group for deduplication. (@jondmarien in #23)
  • Codex unwire(Principles) leaves orphan PermissionRequest hook: wire(Principles) added a codex-perm-hook to PermissionRequest, but unwire(Principles) only called remove_owner without cleaning the hook. Now removes managed PermissionRequest entries and prunes empty hooks object.

Changed

  • Status coloring in doctor and update: all tools wired and up-to-date versions now print in green; not installed / not on PATH in red; outdated versions in yellow. Consistent across both commands. (@jondmarien in #23)
  • Generic merge_hook_group / remove_hook_group: Refactored merge_pretool_use and remove_pretool_use in src/util/json.rs to delegate to generic merge_hook_group / remove_hook_group that work with any hook key (PreToolUse, PermissionRequest, etc.). Backward-compatible — existing callers unchanged.
  • CI fail-fast: false: .github/workflows/ci.yml matrix strategy no longer cancels sibling OS jobs on single-job failures. (@jondmarien in #23)

Added

  • Wiring matrix heatmap: Added scripts/generate_wiring_heatmap.py (stdlib-only) that generates color-coded SVG heatmaps (assets/wiring-matrix-dark.svg, assets/wiring-matrix-light.svg) of the tool x agent wiring matrix. README updated with <picture> element for light/dark theme support. (@jondmarien in #23)

Contributors

Thanks to community contributor:

  • @jondmarien: Fix UI label splitting, doctor probe hooks, Caveman update detection, legacy path cleanup, status coloring, CI matrix, wiring heatmap (#23)

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 02 Aug 05:50

Added

  • 100% Native Rust Core: Complete rewrite from TypeScript/Bun to Rust 2024 edition — delivering zero-runtime dependency, faster execution, memory safety, and standalone cross-platform binaries.
  • Explicit init subcommand: toksave init now accepted explicitly (was default-only).
  • Preflight git/node dep warning: Before init, toksave warns when github-channel tools need git or npm-channel tools need a minimum Node version, and skips those tools with a remediation hint instead of failing mid-install.
  • Install failure diagnostics: Failed tool installation now reports which command failed, its exit code, captured stderr tail, and remediation hints (ensure Node 18+ / npm / deno are on PATH, check proxy, retry).
  • Per-tool phase progress: toksave install <agent> shows per-tool progress phases (resolve, install, wire) instead of one indeterminate spinner.
  • Runtime probe in toksave doctor: Probes each agent's installed binaries and hooks at runtime — detects missing binaries, Windows backslash paths that break Git Bash hooks, and hooks that fail to run (3s live-run check); reports hooks.json/config.toml/mcp.json MCP server entries pointing at missing binaries. No hooks are modified.
  • Codex config.toml MCP probe: Reads [mcp_servers.*] from config.toml via toml_edit (not regex) to detect broken MCP entries alongside the JSON-based walker.
  • expected_bin_dirs + PATH prepend in toksave init: The workspace PATH is prepended with agent binary dirs so freshly installed tools resolve in new shells.
  • Legacy fence cleanup: Old TokSave instruction fences (non-toksave markers) are stripped when regenerating AGENTS.md blocks.
  • Owner-consolidated AGENTS.md updates: Rewrites group existing agent/RTK owners into one TokSave block instead of appending duplicates; a full-file write_owner no longer overwrites the entire AGENTS.md.

Changed

  • init detects agents before installing tools: Agent detection and selection now run before any tool installation. When no agent is detected, toksave init prints "Nothing selected." and exits without touching the filesystem (previously tools were installed and wired first, then "Nothing selected."). Selection options (all/high/leave-all) apply to upgrade runs; a fresh machine with no agents short-circuits cleanly.
  • Rust edition 20212024: Upgraded the crate to the 2024 edition. env::set_var/remove_var became unsafe in 2024; call sites in runmcp/detect got unsafe blocks with inlined safety comments (main-thread before thread spawn), and env-mutating tests got unsafe blocks guarded by env_test_lock/ENV_LOCK.

Fixed

  • RTK hook no longer clobbers user PreToolUse hooks: Warp, Devin, and Droid wire/unwire used to replace the whole PreToolUse array or drop the key outright, destroying user-owned hooks. Wire now keeps existing entries, replacing only toksave-managed ones (matched by command marker), and unwire drops only ours — removing the key only when it becomes empty.
  • Windows: bare npm shims now spawn correctly: Tools installed by npm ship an extensionless POSIX shell shim (context-mode) next to a .cmd twin. TokSave used to prefer/resolve the bare shim and spawn it directly, failing with os error 193 (%1 is not a valid Win32 application). Command resolution now prefers PATHEXT-qualified candidates on Windows, and runmcp/process spawning picks the .cmd twin — fixing toksave runmcp <npm-tool>, toksave index, and version probes on Windows.
  • update installs missing npm tools: latest_version() read .version from the full npm registry document, which only exists on the /latest and versioned endpoints — so every npm tool resolved as "up to date" and toksave update never installed missing tools. Now fetched via registry.npmjs.org/<pkg>/latest; missing tools are reported as (not installed) and installed.
  • Uninstall drops empty config files and ghost keys: After uninstall, agents left empty {} JSON configs, empty [mcp_servers] TOML tables, and empty hooks/mcpServers objects behind (opencode config.json, codex config.toml+hooks.json, copilot/droid/devin/warp mcp.json+hooks.json, .claude.json, .claude/settings.json). Unwire now prunes empty top-level JSON containers (write_json_pruned), prunes empty TOML tables recursively (prune_empty_tables) and deletes the file when it serializes to {}/empty (write_toml_pruned / write_json_pruned), while preserving user-owned keys like opencode's $schema.
  • Invalid toksave install <tool> remediation hints: Health-check and repair hints referenced toksave install <tool>, but install is not a clap subcommand (error: unrecognized subcommand). All hints now point to the real command toksave init -t <tool>.
  • update mislabeled "up to date" when latest couldn't be resolved: A tool that resolved its installed version but failed to fetch the latest (offline / GitHub rate limit) printed → ? (up to date), silently claiming freshness. It now prints ? (latest unknown — could not check).

v0.8.5

Choose a tag to compare

@github-actions github-actions released this 31 Jul 12:31

Added

  • Warp / Oz Agent Support: Added full support for Warp / Oz AI Agent (warp / oz CLI flag) with MCP (mcp.json) and AGENTS.md instructions wiring across all 6 tools, with official brand icon assets/agents/warp.png. (@jondmarien in #22)

Fixed

  • Warp hooks.json never clobbered on wire/unwire: loadHooks() returned {} for an unparseable hooks.json, so the next write destroyed the user's hooks. It now returns null on malformed JSON and wire/unwire/verify skip the write. removeHookGroup() previously removed the entire matched hook group, deleting co-located user hooks — it now removes only the TokSave rtk-hook entry and keeps groups that still hold user hooks. Regression tests added.
  • Immutable sort without spread copy: Replaced [...owners].sort(...) with owners.toSorted(...) in agent instructions rendering (ES2023, no intermediate array allocation).

Changed

  • Dead code removal & command refactors: Removed unused exports and deprecated helpers across the codebase (~720 lines): src/util/progress.ts, src/util/separators.ts, barrel files src/agents/index.ts and src/commands/index.ts, src/content/rtk-rules.ts, plus unused functions in json, toml, colors, errors, manifest, mcpspawn, npm, paths, unified-block, version, and download utilities. Refactored command approval (copilot) to use a Set, agent detection in init to use a Map, and disable/doctor/uninstall/update to use reduce/Set for clearer, faster logic. Enabled noImplicitAny in tsconfig.json for stricter type checking.

Contributors

Thanks to community contributor:

  • @jondmarien: Add Warp / Oz agent support with MCP and AGENTS.md wiring, official brand icon (#22)

v0.8.4

Choose a tag to compare

@github-actions github-actions released this 28 Jul 03:47

Added

  • Devin / Cascade Agent: Added full support for Devin / Cascade AI agent (devin / cascade flag) with MCP (mcp.json) and AGENTS.md instructions wiring for all 6 tools. (@jondmarien in #19)

Fixed

  • runmcp CLI argument parsing: Added .argument("[args...]") and .allowExcessArguments(true) to runmcp command registration in Commander. Prevents "too many arguments for 'runmcp'" failures when agents launch MCP servers with parameters. (@jondmarien in #19)
  • Bare MCP tool binary resolution: runmcp now automatically resolves bare tool names (e.g. codegraph, context-mode) to their installed executables on PATH or user bin directories (~/.local/bin, mise shims, etc.). (@jondmarien in #19)
  • GUI agent PATH expansion: runmcp now ensures PATH includes user tool paths (~/.local/bin, mise node shims, etc.) so GUI desktop agents with minimal PATH environments can locate node, codegraph, and context-mode. (@jondmarien in #19)
  • Caveman install fallback: caveman tool installation now succeeds gracefully even if global npm installation fails or npm is absent, ensuring instruction-based skill wiring still completes. (@jondmarien in #19)
  • toksave doctor deep MCP verification: doctor now performs executable-level verification (checkAgentMcpHealth) for codegraph and context-mode, catching unresolvable or crashing MCP configurations rather than relying solely on config file presence. (@jondmarien in #19)

Contributors

Thanks to community contributor:

  • @jondmarien: Add Devin/Cascade agent support, fix runmcp CLI args & PATH expansion, doctor deep MCP checks (#19)

v0.8.3

Choose a tag to compare

@github-actions github-actions released this 17 Jul 09:24

Fixed

  • Manifest recorded before verify: init called recordWire() before verifyTool(). Failed wiring still left a manifest entry. Now records only after verify passes.
  • RTK verify required PATH: Claude Code and OpenCode verify("rtk") required isOnPath("rtk") in addition to the hook/plugin. Fresh installs with RTK not yet on PATH failed verify after a successful wire. Verify now checks hook/plugin only; PATH health stays in doctor.
  • Copilot IDE instructions stale after unwire: Unwire for codegraph/context-mode/caveman/ponytail/principles removed CLI owners but did not re-sync .github/copilot-instructions.md. Now calls syncCopilotIdeInstructions(); empty body deletes the IDE file.

v0.8.2

Choose a tag to compare

@github-actions github-actions released this 17 Jul 01:29

Added

  • Verify-after-wire regression test: 6 new tests confirm dry-run wire does not pass verify for any agent×tool combo. Exposes missing dryRun guards in wire functions.

Fixed

  • WireCaveman dryRun writes owner marker: Claude Code and Antigravity wireCaveman() called writeOwner() even with dryRun: true, causing verify to falsely report caveman as wired. writeOwner now correctly skipped on dryRun.