Getting it into your agent
This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.
/plugin marketplace add MSApps-Mobile/claude-plugins/plugin install cowork-memWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/hooks/msapps-mobile/claude-plugins/post-tool-use)<a href="https://agentmods.dev/hooks/msapps-mobile/claude-plugins/post-tool-use"><img src="https://agentmods.dev/badge/hooks/msapps-mobile/claude-plugins/post-tool-use/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/hooks/msapps-mobile/claude-plugins/post-tool-use"><img src="https://agentmods.dev/badge/hooks/msapps-mobile/claude-plugins/post-tool-use.svg" alt="Reviewed on agentmods" width="80" height="20"></a>Grade B, and why
PostToolUse scanned grade B with 1 finding 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 yesterday.
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.
Asks for rootmediumPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
"command": "sh -c 'umask 077; R=\"$1\"; D=\"$HOME/.claude/.cowork-mem\"; L=\"$D/capture-errors.log\"; mkdir -p \"$D\" 2>/dev/null; chmod 700 \"$D\" 2>/dev/null; chmod 600 \"$D\"/memory.db* \"$L\"* 2>/dev/null; COWORK_MEM What it actually says
{
"PostToolUse": [
{
"matcher": "Edit|Write|Bash|Task|TodoWrite|NotebookEdit",
"hooks": [
{
"type": "command",
"command": "sh -c 'umask 077; R=\"$1\"; D=\"$HOME/.claude/.cowork-mem\"; L=\"$D/capture-errors.log\"; mkdir -p \"$D\" 2>/dev/null; chmod 700 \"$D\" 2>/dev/null; chmod 600 \"$D\"/memory.db* \"$L\"* 2>/dev/null; COWORK_MEM_DB=\"$D/memory.db\" python3 \"$R/skills/cowork-mem/scripts/post_tool_capture.py\" 2>/dev/null || { rc=$?; echo \"$(date -u +%Y-%m-%dT%H:%M:%SZ) [cowork-mem] HOOK FAILED exit=$rc script=$R/skills/cowork-mem/scripts/post_tool_capture.py\" >>\"$L\" 2>/dev/null; [ -n \"$(find \"$L\" -size +256k 2>/dev/null)\" ] && mv -f \"$L\" \"$L.1\" 2>/dev/null; }; exit 0' _ \"${CLAUDE_PLUGIN_ROOT}\""
}
]
}
]
}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.
- yesterday Changed scan A → B 0b88f385add2
- 1mo ago First seen · 13 lines scan A df017f777565
PostToolUse is a hook published in the GitHub repository MSApps-Mobile/claude-plugins (10 stars, last pushed today), licensed MIT. Its token cost is not measured: a hook is shell that never enters the context. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other hooks, from other repositories
PreToolUse
Runs before the agent uses a tool for Bash, shell_command, exec_command, unified_exec, apply_patch, Write, Edit, spawn_agent, collaborationspawn_agent, multi_agent_v1send_input, multi_agent_v1resume_agent, multi_agent_v1close_agent, collaborationsend_message, collaborationfollowup_task, collaborationinterrupt_agent…
SessionEnd
Runs when a session ends for clear, prompt_input_exit, logout, resume, bypass_permissions_disabled and other tool calls, running an inline shell check. From QORIS-AI/knox.
PostToolUse
Runs after a tool call finishes for Write and Edit tool calls, executing format_and_lint.sh. From supabase/supabase.
SessionStart
Runs when a session starts on startup, executing install_pkgs.sh. From supabase/supabase.
SessionStart
Runs when a session starts, executing on-start.js via node. From google-gemini/gemini-cli.
PreToolUse
Runs before the agent uses a tool for Bash tool calls, running an inline shell check. From apache/superset.