Stats
Actions
Tags
From agent-mem
Automatically summarizes conversation context on session stop, checks plugin version on setup, and manages memory state via PreToolUse hooks. Runs Node scripts through bash.
6 events · 7 hooks
Safety signals detected in this hook configuration
Where this hook configuration is defined
Defined in hooks/hooks.json
Event handlers and matchers — expand Raw Configuration for the full JSON
_HP=$(printenv PATH 2>/dev/null || true); if [ -z "$_HP" ] && [ -n "${SHELL:-}" ]; then case "$SHELL" in */bash|*/zsh|*/sh) _HP=$("$SHELL" -lc 'printf %s "$PATH"' 2>/dev/null || true);; esac; fi; _HP=$(printf '%s' "$_HP" | tr ' ' ':'); export PATH="${_HP:+$_HP:}$PATH"; _C="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"; _E="${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}"; if [ -n "$_E" ]; then _V="$_E"; [ -d "$_E/plugin/scripts" ] && _V="$_E/plugin"; [ -f "$_V/scripts/bun-runner.js" ] && [ -f "$_V/scripts/worker-service.cjs" ] || _E=; fi; _F=; _P=$({ [ -n "$_E" ] && printf '%s\n' "$_E"; ls -dt "$_C/plugins/cache/zaheerops/agent-mem"/[0-9]*/ 2>/dev/null; ls -dt "$_C/plugins/cache/thedotmack/claude-mem"/[0-9]*/ 2>/dev/null; printf '%s\n' "$_C/plugins/marketplaces/thedotmack/plugin"; } | while IFS= read -r _R; do _R="${_R%/}"; [ -d "$_R/plugin/scripts" ] && _Q="$_R/plugin" || _Q="$_R"; [ -f "$_Q/scripts/bun-runner.js" ] && [ -f "$_Q/scripts/worker-service.cjs" ] && [ -z "$_F" ] && { _F=1; printf '%s\n' "$_Q"; }; done); [ -n "$_P" ] || { echo "agent-mem: plugin scripts not found" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w "$_P" 2>/dev/null); [ -n "$_W" ] && _P="$_W"; }; node "$_P/scripts/bun-runner.js" "$_P/scripts/worker-service.cjs" hook claude-code summarize120ms*_HP=$(printenv PATH 2>/dev/null || true); if [ -z "$_HP" ] && [ -n "${SHELL:-}" ]; then case "$SHELL" in */bash|*/zsh|*/sh) _HP=$("$SHELL" -lc 'printf %s "$PATH"' 2>/dev/null || true);; esac; fi; _HP=$(printf '%s' "$_HP" | tr ' ' ':'); export PATH="${_HP:+$_HP:}$HOME/.local/bin:/usr/local/bin:/opt/homebrew/bin:$PATH"; _C="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"; _E="${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}"; if [ -n "$_E" ]; then _V="$_E"; [ -d "$_E/plugin/scripts" ] && _V="$_E/plugin"; [ -f "$_V/scripts/version-check.js" ] || _E=; fi; _F=; _P=$({ [ -n "$_E" ] && printf '%s\n' "$_E"; ls -dt "$_C/plugins/cache/zaheerops/agent-mem"/[0-9]*/ 2>/dev/null; ls -dt "$_C/plugins/cache/thedotmack/claude-mem"/[0-9]*/ 2>/dev/null; printf '%s\n' "$_C/plugins/marketplaces/thedotmack/plugin"; } | while IFS= read -r _R; do _R="${_R%/}"; [ -d "$_R/plugin/scripts" ] && _Q="$_R/plugin" || _Q="$_R"; [ -f "$_Q/scripts/version-check.js" ] && [ -z "$_F" ] && { _F=1; printf '%s\n' "$_Q"; }; done); [ -n "$_P" ] || { echo "agent-mem: version-check.js not found" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w "$_P" 2>/dev/null); [ -n "$_W" ] && _P="$_W"; }; node "$_P/scripts/version-check.js"300msRead_HP=$(printenv PATH 2>/dev/null || true); if [ -z "$_HP" ] && [ -n "${SHELL:-}" ]; then case "$SHELL" in */bash|*/zsh|*/sh) _HP=$("$SHELL" -lc 'printf %s "$PATH"' 2>/dev/null || true);; esac; fi; _HP=$(printf '%s' "$_HP" | tr ' ' ':'); export PATH="${_HP:+$_HP:}$PATH"; _C="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"; _E="${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}"; if [ -n "$_E" ]; then _V="$_E"; [ -d "$_E/plugin/scripts" ] && _V="$_E/plugin"; [ -f "$_V/scripts/bun-runner.js" ] && [ -f "$_V/scripts/worker-service.cjs" ] || _E=; fi; _F=; _P=$({ [ -n "$_E" ] && printf '%s\n' "$_E"; ls -dt "$_C/plugins/cache/zaheerops/agent-mem"/[0-9]*/ 2>/dev/null; ls -dt "$_C/plugins/cache/thedotmack/claude-mem"/[0-9]*/ 2>/dev/null; printf '%s\n' "$_C/plugins/marketplaces/thedotmack/plugin"; } | while IFS= read -r _R; do _R="${_R%/}"; [ -d "$_R/plugin/scripts" ] && _Q="$_R/plugin" || _Q="$_R"; [ -f "$_Q/scripts/bun-runner.js" ] && [ -f "$_Q/scripts/worker-service.cjs" ] && [ -z "$_F" ] && { _F=1; printf '%s\n' "$_Q"; }; done); [ -n "$_P" ] || { echo "agent-mem: plugin scripts not found" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w "$_P" 2>/dev/null); [ -n "$_W" ] && _P="$_W"; }; node "$_P/scripts/bun-runner.js" "$_P/scripts/worker-service.cjs" hook claude-code file-context60ms*_HP=$(printenv PATH 2>/dev/null || true); if [ -z "$_HP" ] && [ -n "${SHELL:-}" ]; then case "$SHELL" in */bash|*/zsh|*/sh) _HP=$("$SHELL" -lc 'printf %s "$PATH"' 2>/dev/null || true);; esac; fi; _HP=$(printf '%s' "$_HP" | tr ' ' ':'); export PATH="${_HP:+$_HP:}$PATH"; _C="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"; _E="${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}"; if [ -n "$_E" ]; then _V="$_E"; [ -d "$_E/plugin/scripts" ] && _V="$_E/plugin"; [ -f "$_V/scripts/bun-runner.js" ] && [ -f "$_V/scripts/worker-service.cjs" ] || _E=; fi; _F=; _P=$({ [ -n "$_E" ] && printf '%s\n' "$_E"; ls -dt "$_C/plugins/cache/zaheerops/agent-mem"/[0-9]*/ 2>/dev/null; ls -dt "$_C/plugins/cache/thedotmack/claude-mem"/[0-9]*/ 2>/dev/null; printf '%s\n' "$_C/plugins/marketplaces/thedotmack/plugin"; } | while IFS= read -r _R; do _R="${_R%/}"; [ -d "$_R/plugin/scripts" ] && _Q="$_R/plugin" || _Q="$_R"; [ -f "$_Q/scripts/bun-runner.js" ] && [ -f "$_Q/scripts/worker-service.cjs" ] && [ -z "$_F" ] && { _F=1; printf '%s\n' "$_Q"; }; done); [ -n "$_P" ] || { echo "agent-mem: plugin scripts not found" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w "$_P" 2>/dev/null); [ -n "$_W" ] && _P="$_W"; }; node "$_P/scripts/bun-runner.js" "$_P/scripts/worker-service.cjs" hook claude-code observation120msstartup|clear|compact_HP=$(printenv PATH 2>/dev/null || true); if [ -z "$_HP" ] && [ -n "${SHELL:-}" ]; then case "$SHELL" in */bash|*/zsh|*/sh) _HP=$("$SHELL" -lc 'printf %s "$PATH"' 2>/dev/null || true);; esac; fi; _HP=$(printf '%s' "$_HP" | tr ' ' ':'); export PATH="${_HP:+$_HP:}$PATH"; _C="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"; _E="${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}"; if [ -n "$_E" ]; then _V="$_E"; [ -d "$_E/plugin/scripts" ] && _V="$_E/plugin"; [ -f "$_V/scripts/bun-runner.js" ] && [ -f "$_V/scripts/worker-service.cjs" ] || _E=; fi; _F=; _P=$({ [ -n "$_E" ] && printf '%s\n' "$_E"; ls -dt "$_C/plugins/cache/zaheerops/agent-mem"/[0-9]*/ 2>/dev/null; ls -dt "$_C/plugins/cache/thedotmack/claude-mem"/[0-9]*/ 2>/dev/null; printf '%s\n' "$_C/plugins/marketplaces/thedotmack/plugin"; } | while IFS= read -r _R; do _R="${_R%/}"; [ -d "$_R/plugin/scripts" ] && _Q="$_R/plugin" || _Q="$_R"; [ -f "$_Q/scripts/bun-runner.js" ] && [ -f "$_Q/scripts/worker-service.cjs" ] && [ -z "$_F" ] && { _F=1; printf '%s\n' "$_Q"; }; done); [ -n "$_P" ] || { echo "agent-mem: plugin scripts not found" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w "$_P" 2>/dev/null); [ -n "$_W" ] && _P="$_W"; }; node "$_P/scripts/bun-runner.js" "$_P/scripts/worker-service.cjs" start && echo '{"continue":true,"suppressOutput":true}'60ms_HP=$(printenv PATH 2>/dev/null || true); if [ -z "$_HP" ] && [ -n "${SHELL:-}" ]; then case "$SHELL" in */bash|*/zsh|*/sh) _HP=$("$SHELL" -lc 'printf %s "$PATH"' 2>/dev/null || true);; esac; fi; _HP=$(printf '%s' "$_HP" | tr ' ' ':'); export PATH="${_HP:+$_HP:}$PATH"; _C="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"; _E="${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}"; if [ -n "$_E" ]; then _V="$_E"; [ -d "$_E/plugin/scripts" ] && _V="$_E/plugin"; [ -f "$_V/scripts/bun-runner.js" ] && [ -f "$_V/scripts/worker-service.cjs" ] || _E=; fi; _F=; _P=$({ [ -n "$_E" ] && printf '%s\n' "$_E"; ls -dt "$_C/plugins/cache/zaheerops/agent-mem"/[0-9]*/ 2>/dev/null; ls -dt "$_C/plugins/cache/thedotmack/claude-mem"/[0-9]*/ 2>/dev/null; printf '%s\n' "$_C/plugins/marketplaces/thedotmack/plugin"; } | while IFS= read -r _R; do _R="${_R%/}"; [ -d "$_R/plugin/scripts" ] && _Q="$_R/plugin" || _Q="$_R"; [ -f "$_Q/scripts/bun-runner.js" ] && [ -f "$_Q/scripts/worker-service.cjs" ] && [ -z "$_F" ] && { _F=1; printf '%s\n' "$_Q"; }; done); [ -n "$_P" ] || { echo "agent-mem: plugin scripts not found" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w "$_P" 2>/dev/null); [ -n "$_W" ] && _P="$_W"; }; node "$_P/scripts/bun-runner.js" "$_P/scripts/worker-service.cjs" hook claude-code context60ms_HP=$(printenv PATH 2>/dev/null || true); if [ -z "$_HP" ] && [ -n "${SHELL:-}" ]; then case "$SHELL" in */bash|*/zsh|*/sh) _HP=$("$SHELL" -lc 'printf %s "$PATH"' 2>/dev/null || true);; esac; fi; _HP=$(printf '%s' "$_HP" | tr ' ' ':'); export PATH="${_HP:+$_HP:}$PATH"; _C="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"; _E="${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}"; if [ -n "$_E" ]; then _V="$_E"; [ -d "$_E/plugin/scripts" ] && _V="$_E/plugin"; [ -f "$_V/scripts/bun-runner.js" ] && [ -f "$_V/scripts/worker-service.cjs" ] || _E=; fi; _F=; _P=$({ [ -n "$_E" ] && printf '%s\n' "$_E"; ls -dt "$_C/plugins/cache/zaheerops/agent-mem"/[0-9]*/ 2>/dev/null; ls -dt "$_C/plugins/cache/thedotmack/claude-mem"/[0-9]*/ 2>/dev/null; printf '%s\n' "$_C/plugins/marketplaces/thedotmack/plugin"; } | while IFS= read -r _R; do _R="${_R%/}"; [ -d "$_R/plugin/scripts" ] && _Q="$_R/plugin" || _Q="$_R"; [ -f "$_Q/scripts/bun-runner.js" ] && [ -f "$_Q/scripts/worker-service.cjs" ] && [ -z "$_F" ] && { _F=1; printf '%s\n' "$_Q"; }; done); [ -n "$_P" ] || { echo "agent-mem: plugin scripts not found" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w "$_P" 2>/dev/null); [ -n "$_W" ] && _P="$_W"; }; node "$_P/scripts/bun-runner.js" "$_P/scripts/worker-service.cjs" hook claude-code session-init60msnpx claudepluginhub zaheerops/agent-mem