Install it
You do this once per machine. The plugin cannot ship the hook for you, because the plugin directory refuses a command hook declared by a plugin. Pick one way. Both write the same entry.
Ask Claude (0.8.1 and later)
/pr-brief hookClaude checks whether the hook is already on, asks if it should cover every repository or only this one, runs the install, and tells you to restart. After a run that creates or updates a PR, it offers the hook once if it is not installed.
Run the command yourself (any version since 0.7.0)
# inside a Claude Code session, where the plugin is installed ! pr-brief hook install --scope user # then restart the session
The ! runs the command in your session. --scope user writes ~/.claude/settings.json and covers every repository. --scope repo, run inside a repository, writes .claude/settings.json there. The command keeps a copy of the file as it was (settings.json.pr-brief.bak) and changes nothing else. Claude Code reads the file when a session starts, so restart the session.
On Codex, run pr-brief hook install --harness codex --scope user, restart, open /hooks and trust the pr-brief entry.
Where to run it
Inside a Claude Code session. The plugin puts its bin/ folder on the shell path of the session, so pr-brief resolves there. In a plain terminal it does not. Use the full path of the launcher, ~/.claude/plugins/cache/<marketplace>/pr-brief/<version>/bin/pr-brief, or put a binary from the releases page on your PATH. Run pr-brief hook show to see the entry and the file before you write it, and pr-brief hook status to see whether it is already on.
Windows
The hook runs the real pr-brief-windows-amd64.exe, not the shell launcher, and the install writes its path with forward slashes. Version 0.6.0 was different: the plugin itself declared the hook and pointed it at the extensionless launcher script, and Windows answered with the “How do you want to open this file?” dialog on every Bash call. If you see that dialog, update the plugin past 0.6.0. The plugin then declares no hook, so the dialog stops. Run the install command above if you want the gate back.
After an update
On Claude Code, the install writes a command that finds the newest installed pr-brief each time the hook runs, so a plugin update needs no change. pr-brief hook check says whether an entry from an older install is out of date and exits 1 when it is. If it is, run the install command again. It says updated and does not add a second entry. With --bin, on Windows and on Codex the entry names one binary, so run the install command again after a plugin update.
Remove it
! pr-brief hook remove --scope user
This takes out only the pr-brief entry. Everything else in the file stays. Disabling the plugin does not remove the entry, because it is in your own settings.json.
If it does not run
- Restart the session. Claude Code reads
settings.jsonat the start. - Check the entry.
pr-brief hook statusprintsuser=trueorrepo=truewhen it is installed. If it is, runpr-brief hook install --scope useragain to refresh the path. - A denial says it cannot read the description. Write the description to a file and pass
--body-file <path>with a literal path. The hook cannot read a shell variable or standard input. See what the hook sees.