Skip to content

Hook System

Ranger integrates with Claude Code through hooks: automatic triggers that fire at key moments in the coding session. Hooks guide Claude through the Feature Review workflow without requiring you to remember commands or prompt for it repeatedly.

The Claude Code plugin should be automatically installed when you run ranger setup. If you need to re-install them at any point, you can run:

/plugin marketplace add ranger-testing/trailhead
/plugin install ranger@trailhead

from inside Claude or:

claude plugin marketplace add ranger-testing/trailhead
claude plugin install ranger@trailhead

from the terminal. After installing, you may need to restart Claude Code before you can use the plugin.

We started with just the skills and discovered that Claude kept forgetting to use ranger and would return to us with errors that would have been caught with verification.

We temporarily solved that with careful and repeated prompting, but wanted to automate it. Claude Code plugins offer “hooks” that can be used to remind Claude–if relevant–to use Ranger and check its work before returning to the user.

We’ve found that enabling hooks whenever we’re working on UI-related work has dramatically improved Claude’s reliability with Feature Review.

Installing the plugin makes Ranger available — it does not interrupt you. On the first prompt of a session, Claude decides for itself whether the task involves frontend, UI, or browser work. If it does, Claude enables Ranger Feature Review and tells you in one line; if not, it stays out of the way. It never blocks waiting on a “do you want to enable Ranger?” question, so this is safe for interactive sessions, autonomous agents, and one-shot/CI runs alike.

Once enabled on a branch, Ranger stays enabled across sessions. You can also toggle it yourself at any time:

  • /ranger:enable — enable for this session (and the branch, unless you’re on main/master)
  • /ranger:disable — disable for this session and branch

On main/master, hooks only enable at the session level (not branch-persisted), since these branches are shared.

For environments that shouldn’t rely on Claude’s per-task judgment, set the RANGER_HOOKS environment variable:

RANGER_HOOKS Behavior
(unset) or auto Default. Claude decides per task and enables Ranger itself for UI work; never asks a blocking question.
on Ranger is enabled from session start — no decision, no prompt. Good for teams/repos that always want Feature Review.
off Ranger never activates on its own — the auto-prompt is suppressed and nothing self-enables, so it can’t interrupt. A user in the loop can still turn it on for a session with /ranger:enable. Good for autonomous agents, Slack bots, and CI.

Set it where you launch the agent (shell env), or persist it in Claude Code’s settings.json env block so it applies per-user, per-project, or per-machine (whichever settings.json you put it in):

{
"env": { "RANGER_HOOKS": "off" }
}

A Slack bot or CI runner that should never be interrupted can set RANGER_HOOKS=off — it won’t auto-activate, but a user in the loop can still opt in with /ranger:enable. If it should sometimes use Ranger automatically, just leave the default; it no longer blocks either way.

Hook When It Fires What It Does
session-start Session created Enables Ranger if the branch is already enabled, or unconditionally when RANGER_HOOKS=on.
auto-prompt First user prompt (Default auto mode only) Asks Claude to judge whether the task is UI/browser work and enable Ranger itself if so — without ever asking you a blocking question.
session-end Session ended If reason is /clear and session was enabled, auto-enables on next session.
enable /ranger:enable Runs ranger update, enables session + branch, outputs the full skill content to Claude’s context.
disable /ranger:disable Disables session + branch, tells Claude to stop using Ranger commands.
stop Session stopping If the active feature review still has unfinished items, adds a non-blocking reminder to verify before replying, unless verification is already running. If items are terminal, it tries to conclude the session. Fails open on conclude errors.
post-edit After file write/edit If Ranger is enabled but no feature review is registered, suggests using /ranger. If a feature review exists, hints about adding scenarios if scope expanded.
pre-compact Before context compaction Reminds Claude to preserve the Ranger Feature Review Specification in the compacted summary.
plan-start Entering plan mode Instructs Claude to include a Ranger Feature Review Specification in the plan.
exit-plan-mode Leaving plan mode Reminds Claude to create the feature review with ranger create before starting implementation.