# Hooks

A small plugin per client that refuses what a skill can only advise against, and in Amp brings the working rules and your USER.

A skill advises, and advice can slip in a long session. A hook runs on your machine, on the tool call itself, so it can refuse: `git add -A`, `--no-verify`, an edit to your linter's config. An MCP server serves text and can't start a process on your machine, so the hooks need a plugin per client. Skills reach you over MCP, so the plugin holds hooks and nothing else.

## Install

The plugins are on the public marketplace [mischasigtermans/altitude-marketplace](https://github.com/mischasigtermans/altitude-marketplace).

```bash
# Claude Code
claude plugin marketplace add mischasigtermans/altitude-marketplace
claude plugin install altitude@altitude

# Amp, on this machine
mkdir -p ~/.config/amp/plugins
curl -fsSL https://raw.githubusercontent.com/mischasigtermans/altitude-marketplace/main/plugins/amp/altitude.ts -o ~/.config/amp/plugins/altitude.ts
```

In Amp, commit `altitude.ts` to your personal or workspace plugins repository instead to get it in every thread, orbs included.

## The hooks

| Hook | When | What it does |
| --- | --- | --- |
| `guard` | Before a shell command | Refuses `git add -A`, `git commit -a`, `--no-verify`, `pkill` by name and formatting the whole tree. Asks before a tag is created, moved or deleted. With delivery `pr`, refuses a push to the default branch |
| `config-protect` | Before an edit | Refuses edits to linter and formatter config, so the agent fixes the code instead |
| `ui` | Before the first UI edit | Refuses it once, with your UI bar as the reason. The repeat passes |
| `format` | After edits, and when a turn ends | Formats the files the agent touched and holds the turn while the analyser reports errors in them |
| `context` | When a session starts | Adds the working rules, then your USER, where your line wins |

## Per client

| Client | Plugin | Status |
| --- | --- | --- |
| Amp | `plugins/amp/altitude.ts`, one file | Published. In Amp it is the only way the working rules and your USER arrive, because Amp doesn't show a server's instructions. Its `context` hook reads them from your account through your Altitude connection |
| Claude Code | `altitude@altitude`, with three review agents | Published. Its `context` hook reads `USER.md` from your Claude config folder |
| OpenCode, Codex, Grok Build | Not started | Later |

## Coming

- The Claude Code `context` hook fetches your USER from your account, as Amp's does.
- Each hook can be switched off in `altitude.json`. See [Your account and its settings](https://altitudemcp.com/docs/account).
