PostToolUse

PostToolUse is a hook for Claude Code from MSApps-Mobile/claude-plugins. Its token cost is not measured, scanned B, original, MIT.

An automatic action that runs after selected coding tools finish, including file edits, shell commands, tasks, and notebook changes.

In plain words
What is it for?
Use it to record activity after editing files, running Bash commands, assigning tasks, updating to-do items, or editing notebooks.
Why use it?
It captures information about completed tool actions automatically, so that record does not have to be created manually.

Hook for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: names the TodoWrite tool; positional $N argument.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the cowork-mem plugin — 7 skills, 1 hook shipped together

Good fit Use it to record activity after editing files, running Bash commands, assigning tasks, updating to-do items, or editing notebooks.

Compare 6 hooks from other repositories ↓
Install

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.

Claude Code
/plugin marketplace add MSApps-Mobile/claude-plugins
Claude Code
/plugin install cowork-mem

Made for: Claude Code.

Or install cowork-mem, the plugin that ships this one along with the rest of its 7 skills, 1 hook.

Wrote 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.

agentmods badge for PostToolUse

README.md
[![agentmods](https://agentmods.dev/badge/hooks/msapps-mobile/claude-plugins/post-tool-use/github.svg)](https://agentmods.dev/hooks/msapps-mobile/claude-plugins/post-tool-use)
Your own site
<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.

agentmods 80×15 button for PostToolUse

Your own site · 80×15
<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>
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 B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Security

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
plugins/cowork-mem/hooks/hooks.json · 13 lines

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}\""
        }
      ]
    }
  ]
}
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. yesterday Changed scan A → B 0b88f385add2
  2. 1mo ago First seen · 13 lines scan A df017f777565

Subscribe to this mod's changes

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.