xpd hook
Read one PostToolUse event from standard input. For file edits and writes from Claude Code, Grok and Antigravity and for Codex patches, check the edited Python files in the current project. Return warning and error diagnostics to the agent, as additional context or, for Antigravity, appended to the tool result.
xpd hookExample
Section titled “Example”A clean edit produces no output.
$ mkdir -p hook-example && touch hook-example/pyproject.toml && echo 'total = 1' > hook-example/clean.py$ printf '{"hook_event_name":"PostToolUse","cwd":"%s/hook-example","tool_name":"Write","tool_input":{"file_path":"clean.py"}}' "$PWD" | xpd hookExit status
Section titled “Exit status”The hook exits successfully for findings, clean files, ignored paths and malformed input. It applies safe xpd fixes to the edited files and reports how many it fixed before the remaining warnings and errors.