#!/bin/bash
# AutoMem PostToolUse tracker for mcp__memory__store_memory.
# Writes a session sentinel so the Stop-hook storage nudge
# (automem-stop-nudge.sh) knows a store already happened and stays quiet.
# Side-effect only: no output, always exits 0.
# Generated by scripts/sync-memory-policy.ts. Do not edit by hand.

SESSION_ID=""
if [ ! -t 0 ]; then
  HOOK_INPUT=$(cat 2>/dev/null || true)
  SESSION_ID=$(printf '%s' "$HOOK_INPUT" | sed -n 's/.*"session_id"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' | head -n 1 | tr -cd 'A-Za-z0-9_-')
fi
if [ -n "$SESSION_ID" ]; then
  : > "${TMPDIR:-/tmp}/automem-stored-${SESSION_ID}" 2>/dev/null || true
fi
exit 0
