Stop

A stop hook configuration that runs several memo commands when an agent finishes. The commands save a session record, refresh its summary and synchronise the saved memory across Macs when supported.

In plain words
What is it for?
Use it to automate end-of-session capture, checkpoints, summary refreshes and cross-device memory synchronisation.
Why use it?
It preserves the agent's session information and keeps memory updates from being lost when work ends.

Hook

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add hooks/jagoff/memo/stop
Clone the repo
git clone --depth 1 https://github.com/jagoff/memo
Per session not measured What this adds to a session before it is invoked.
When invoked not measured Not applicable: nothing here is loaded into a session.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Security

Grade A, and why

Stop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the commands this hook runs, not an audit. A hook is shell that executes on your machine at the event it names, which is why every command in it is printed with what was found.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

hooks/hooks.json · 49 lines

How it starts

The opening of the file, as written. The whole thing — 49 lines — stays where its author put it; the contents beside it link to each section on GitHub.

{
  "Stop": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "MEMO_NONINTERACTIVE=1 memo capture-stop",
          "timeout": 30,
          "async": true
        },
        {
          "type": "command",
          "command": "MEMO_NONINTERACTIVE=1 memo session checkpoint",
          "timeout": 5,
          "async": true
        },
        {
          "type": "command",
          "command": "MEMO_NONINTERACTIVE=1 memo session refresh-summary",
          "timeout": 20,
          "async": true,
          "statusMessage": "memo: updating session summary…"
        },
        {
          "type": "command",
          "command": "MEMO_NONINTERACTIVE=1 memo sync once --quiet",
          "timeout": 90,
          "async": true,
          "statusMessage": "memo: pushing memories cross-Mac…",
          "comment": "Final flush via the single lock-guarded machine coordinator (pull-rebase-before-push). Listed last so this session's capture-stop write is on disk first. Lock-guarded so it never races the per-prompt `sync auto` or a sibling session. --quiet soft no-ops on local-tier (no remote) installs."
        },
        {
          "type": "command",
          "command": "MEMO_NONINTERACTIVE=1 MEMO_AGENT_TTY=${MEMO_AGENT_TTY:-$(tty 2>/dev/null | grep -E '^/dev/' | head -1)} memo session idle-maintenance --mode reflect",
          "timeout": 360,
          "async": true,
          "comment": "Longer idle consolidation: waits for a longer quiet window (MEMO_SESSION_IDLE_REFLECT_SECS, default 5m) after the turn finishes and then synthesizes the active session into a durable arc note. MEMO_AGENT_TTY for terminal notifications. Stale workers self-cancel if a newer prompt updated the session snapshot. Async + soft-fail. Disable with MEMO_CAPTURE_DISABLE=1."
        },
        {
          "type": "command",
          "command": "MEMO_NONINTERACTIVE=1 memo dream if-due",
          "timeout": 300,
          "async": true,
          "comment": "Daily body 

Read the full file on GitHub · 49 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 49 lines scan A 6f89e4a0e20b

Subscribe to this mod's changes

Stop is a hook published in the GitHub repository jagoff/memo (16 stars, last pushed 2d ago), licensed MIT. Its token cost is not measured: a hook is shell that never enters the context. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.