PostToolUse

PostToolUse is a hook for coding agents from VersoXBT/claude-initial-setup. Its token cost is not measured, scanned A, original, MIT.

A set of automatic checks that run after editing or creating JavaScript and TypeScript files. A hook is an action that runs automatically when a specified development event occurs.

In plain words
What is it for?
Use it in projects where JavaScript or TypeScript changes should trigger formatting reminders, TypeScript checks, or warnings about debug logging.
Why use it?
It reminds developers to format edited files and check TypeScript, while warning about `console.log` statements that may be left in code.

Hook

Part of the claude-initial-setup plugin — 24 skills, 15 commands, 14 agents, 2 hooks shipped together

One of 2 entries in hooks.json — they are configured in one file and arrive together.

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/versoxbt/claude-initial-setup/post-tool-use
Clone the repo
git clone --depth 1 https://github.com/VersoXBT/claude-initial-setup

Or install claude-initial-setup, the plugin that ships this one along with the rest of its 24 skills, 15 commands, 14 agents, 2 hooks.

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/versoxbt/claude-initial-setup/post-tool-use.svg)](https://agentmods.dev/hooks/versoxbt/claude-initial-setup/post-tool-use)
Your own site
<a href="https://agentmods.dev/hooks/versoxbt/claude-initial-setup/post-tool-use"><img src="https://agentmods.dev/badge/hooks/versoxbt/claude-initial-setup/post-tool-use.svg" alt="Measured on agentmods" 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 A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Security

Grade A, and why

PostToolUse 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 3d 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 · 24 lines

What it actually says

{
  "PostToolUse": [
    {
      "matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\\\.(ts|tsx|js|jsx)$\"",
      "hooks": [
        {
          "type": "command",
          "command": "node -e \"const fs=require('fs');let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const i=JSON.parse(d);const p=i.tool_input?.file_path;if(p&&fs.existsSync(p)){console.error('[Hook] Consider running prettier on the edited file');const c=fs.readFileSync(p,'utf8');const lines=c.split('\\n');const matches=[];lines.forEach((l,idx)=>{if(/console\\.log/.test(l))matches.push((idx+1)+': '+l.trim())});if(matches.length){console.error('[Hook] WARNING: console.log found in '+p);matches.slice(0,5).forEach(m=>console.error(m));console.error('[Hook] Remove console.log before committing')}}console.log(d)})\""
        }
      ],
      "description": "Prettier reminder and console.log warning after JS/TS edits"
    },
    {
      "matcher": "tool == \"Write\" && tool_input.file_path matches \"\\\\.(ts|tsx)$\"",
      "hooks": [
        {
          "type": "command",
          "command": "echo '[Hook] Consider running tsc --noEmit to check for type errors' >&2"
        }
      ],
      "description": "TypeScript check reminder after writing TS files"
    }
  ]
}
Same file

What else hooks.json configures

This page is one entry in a file that holds 2. Installing the file brings all of them; each is measured and scanned on its own page.

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. 3d ago First seen · 24 lines scan A d40673aa37c6

Subscribe to this mod's changes

PostToolUse is a hook published in the GitHub repository VersoXBT/claude-initial-setup (4 stars, last pushed 3mo 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-31.