Skip to main content
aislop hooks plug into your AI coding agent’s edit loop. After every change the agent makes, the hook runs a scan and feeds the score and findings straight back into the agent’s context—so instead of discovering slop at CI time, the agent sees it immediately and can correct its own output. For agents that support stop hooks, you can also block commits if the score regresses below a baseline.

Install a hook

Install hooks for the agents you use. The command accepts agent names as positional arguments, as a --agent comma-separated list, or as individual shortcut flags:
# Install for a single agent
aislop hook install --claude
aislop hook install --cursor
aislop hook install --gemini
aislop hook install --pi

# Install for multiple agents at once
aislop hook install claude cursor
aislop hook install --agent claude,cursor

# Pick agents interactively (no arguments)
aislop hook install
Natural aliases also work if you prefer them:
aislop install claude cursor          # alias for hook install
aislop install hooks --claude         # alternate natural alias

Agent types

Not all agents have the same hook capabilities. aislop distinguishes between two types:

Runtime adapters

These agents support a full scan + feedback loop. After every edit, aislop runs, and the score and diagnostics flow back into the agent’s context in real time.Supported agents: claude, cursor, gemini, pi

Rules-only

These agents read the aislop rules at session start and use them to guide their output. There is no live scan loop, but the agent is aware of the patterns it should avoid.Supported agents: codex, windsurf, cline, kilocode, antigravity, copilot

Hook install flags

--agent
string
Comma-separated list of agent names to install hooks for. Equivalent to passing agent names as positional arguments.
aislop hook install --agent claude,cursor,gemini
-g, --global
boolean
Install the hook to your user-scope config so it applies to every project, not just the current one.
aislop hook install --claude --global
--project
boolean
Install the hook to the project-scope config (the default for most agents). Use this to make the hook explicit in your config file.
--dry-run
boolean
Print the planned config changes without writing anything. Use this to preview what the install will do before committing to it.
aislop hook install --claude --dry-run
--yes
boolean
Skip the confirmation prompt and apply the install immediately. Useful in scripted environments.
--quality-gate
boolean
Add a Claude Stop hook that blocks the agent from completing an edit if the score regresses below the baseline. Requires setting a baseline first with aislop hook baseline.
aislop hook install --claude --quality-gate

Quality-gate mode

Quality-gate mode turns the hook into an active blocker: if the agent’s edit causes the score to drop below the baseline, the Stop hook fires and the edit is rejected. The agent sees the regression and must fix it before continuing.
1

Install with --quality-gate

aislop hook install --claude --quality-gate
2

Capture the current score as the baseline

Run this after your codebase is in the state you want to protect. The baseline is stored locally and used by the Stop hook on every subsequent edit.
aislop hook baseline
3

Work normally — regressions are blocked automatically

From this point on, any agent edit that drops the score below the baseline triggers the Stop hook. The agent sees the finding list and must resolve the regression before the edit is accepted.
Re-run aislop hook baseline after a significant cleanup session to raise the floor and prevent future regressions from the improved score.

Managing hooks

# See which hooks are installed and their current status
aislop hook status

# Re-capture the current score as the quality-gate baseline
aislop hook baseline

# Uninstall a hook for a specific agent
aislop hook uninstall --claude

# Uninstall for multiple agents
aislop hook uninstall --agent claude,cursor

# Natural aliases for uninstall
aislop uninstall claude              # alias for hook uninstall
aislop uninstall hooks --claude      # alternate natural alias

Hook uninstall flags

--agent
string
Comma-separated list of agent names to remove hooks for.
-g, --global
boolean
Remove the hook from your user-scope config.
--project
boolean
Remove the hook from the project-scope config.
--dry-run
boolean
Print the planned removal without writing anything.

All agent shortcut flags

Both hook install and hook uninstall accept these per-agent shortcut flags in addition to --agent:
FlagAgent
--claudeClaude Code
--cursorCursor
--geminiGemini CLI
--pipi
FlagAgent
--codexCodex
--windsurfWindsurf
--clineCline
--kilocodeKilocode
--antigravityAntigravity
--copilotGitHub Copilot

Complete examples

# Install for Claude Code with quality-gate mode
aislop hook install --claude --quality-gate

# Install globally for Claude and Cursor
aislop hook install --agent claude,cursor --global

# Preview what installing for Gemini would do
aislop hook install --gemini --dry-run

# Capture the current score as baseline
aislop hook baseline

# Check what's installed
aislop hook status

# Remove the Claude hook
aislop hook uninstall --claude