Create a Stop Hook Script
Create a project-local hook script and read Claude’s stop-hook input from standard input. Track the session, current directory, changed files, and retry count without writing secrets to logs.
Use an agent stop hook to run project-specific checks when files change, feed actionable failures back into the same session, and finish only when the bounded validation loop passes.
Download the skill for this workflow. Version 1.0.1.

John configures a Claude Code stop hook that detects changed files, runs a Bun type check, sends structured error output back to Claude, and commits only after the checks pass.
A bounded post-task loop that catches relevant defects, returns clean diagnostics to the agent, and records a validated change without touching unrelated work.
Claude for coding tasks
Follow the sequence once, then adapt the prompts, checks, and handoffs to your own setup.
5 steps
Create a project-local hook script and read Claude’s stop-hook input from standard input. Track the session, current directory, changed files, and retry count without writing secrets to logs.
If no relevant files changed, exit cleanly. Otherwise map the changed paths to focused commands such as typecheck, lint, tests, formatting, dependency checks, or document validation.
When a check fails, emit one valid JSON response that names the command, exit status, affected files, and concise diagnostic output. Reserve standard output for that response.
Fix the reported validation failures without changing unrelated files. Rerun the failing command, explain any remaining error, and stop after [maximum attempts] rather than repeating the same edit.
When checks pass, inspect the exact task diff and sensitive-file rules. If automatic commits are allowed, stage only the task-owned files and generate a conventional commit message; otherwise leave the validated diff uncommitted with a summary.
Role: You are an expert programmer who writes git commit messages in the conventional commit format. Task: Generate a git commit message for the following code changes. Diff: [paste git diff] Output only the commit message.
Register the script as a project stop hook in Claude settings, test no-change, failing, repaired, retry-limit, and success paths, and keep the full CI suite as an independent gate.
{"hooks":{"Stop":[{"hooks":[{"type":"command","command":"bun run claude-hooks/index.ts"}]}]}}Turn an idea into a PRD, user stories, and a plan.
How to recover when the loop fails and where human judgment helps.

Generate a draft sales presentation in Google Docs directly from your phone using Claude Duet. This workflow is ideal for business users who need to create serviceable first drafts on the go without being at a computer.

Use Claude Duet on your phone to quickly synthesize your sales pipeline by leveraging its connections to your existing business apps like your CRM, email, and Slack, saving you from manual data assembly.

Use Reddit's internal prototyping tool, Reddit Proto, to build a working prototype of a new feature, like search, and test it with your own signed-in Reddit data for more realistic feedback.
Join 250,000+ product managers who use ChatPRD to write better docs, align teams faster, and build products users love.