disinto/lib/hooks/on-idle-stop.sh
openhands 0be64bdf31 fix: Hook scripts don't follow #!/usr/bin/env bash convention from AGENTS.md (#330)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 08:59:56 +00:00

14 lines
495 B
Bash
Executable file

#!/usr/bin/env bash
# on-idle-stop.sh — Stop hook for dark-factory agent sessions.
#
# Called by Claude Code when it finishes a response. Writes a timestamp
# to a marker file so monitor_phase_loop can detect idle sessions
# without fragile tmux pane scraping.
#
# Usage (in .claude/settings.json):
# {"type": "command", "command": "this-script /tmp/claude-idle-SESSION.ts"}
#
# Args: $1 = marker file path
cat > /dev/null # consume hook JSON from stdin
[ -n "${1:-}" ] && date +%s > "$1"