garage44.eu/jeroen/midas

logclone: git clone https://garage44.eu/jeroen/midas.git

.. /hooks/post-tool-use

raw

#!/usr/bin/env bash
#
# Claude Code PostToolUse hook: hand the session any notes the workspace has for it
# — from another session (`midas say`) or the hub (somebody waits for your
# idle node; another session changes the files you change) — and the first
# time the session edits a file, tell the hub. It runs after every tool call
# and the agent waits for it, so the work is `midas hook post-tool-use`
# (src/hook.rs), in one process: reading the input with jq cost ~200 ms a call.
# FAILS OPEN: a midas too old to know `hook` says nothing (exit 2 would hand
# its usage error to the agent as feedback).
[ -f "$HOME/.config/midas/hub.env" ] || exit 0
M=$HOME/.local/bin/midas; [ -x "$M" ] || M=$(command -v midas) || exit 0
"$M" hook post-tool-use 2>/dev/null
exit 0