Hyperstruck
Work

Install the Claude Code hook

Install the Claude Code hook so your assistant recalls learnings before it acts and reports what happened when a turn ends.

Say your team at Harlow Freight uses Claude Code on the dispatch service. On Monday the assistant learns that the integration tests need the --no-cache flag. With the hook installed, Tuesday's session is offered that learning early in the turn, with nothing to type.

The hook is a small, local client. You install it once. After that, every Claude Code turn recalls learnings before the assistant acts and reports the turn when it ends. A turn that changed code, ran a command or recovered from a failure is worth reporting. A turn that only read files or chatted is skipped.

Before you start

  • Python 3.11 or later.
  • Claude Code, with its ~/.claude folder present. The installer skips Claude Code if that folder is missing.
  • A Hyperstruck API key, and one agent for the hook to learn into. If the key can see more than one agent, name the one you want with --agent-name. An organization admin or owner creates the key in the Hyperstruck dashboard under Settings, then API Keys, then Create key. The dashboard shows the key once, so copy it then.

Install

Install the package, then run the installer with your key and the agent's name.

pip install --upgrade "hyperstruck @ git+https://github.com/hyperstruck/public-integrations.git#subdirectory=hyperstruck-py"

export HYPER_API_KEY=<your API key>
python -m hyperstruck.ide.install --agent-name harlow-freight-dispatch

The installer prints one [ok] line for each step it took and a [!] line for anything that needs your attention.

Restart Claude Code afterwards. The installer can be run again at any time: it upgrades the hook in place.

What the installer changes

WhereWhat it writes
~/.hyperstruck/venvA private Python environment that holds the hook, so a project environment you recreate later cannot break it
~/.hyperstruck/.envYour API key and the agent name (and the base URL, if you set one), readable only by you
~/.claude/settings.jsonThree hook entries: UserPromptSubmit, PostToolUse and Stop. Hooks you already had are left alone
~/.claude/skillsThe hyper-* skills

The installer also sets up any other supported editor it finds on your machine, and skips the ones that are not installed.

What happens in a turn

A turn is one prompt and everything Claude Code does until it stops.

  1. UserPromptSubmit starts a lookup for learnings in the background, so your prompt is never held up.
  2. The first PostToolUse shows the assistant what the lookup found, and records each tool call as the turn goes on.
  3. Stop reports the turn to Hyperstruck, again in the background.

If nothing seems to happen

The hook fails open. A missing key, a network error or a timeout makes it do nothing, and it never blocks or slows Claude Code. To see why it was quiet, start Claude Code with HYPER_HOOK_DEBUG=1 and each hook prints a short status line when it exits. A hook that could not start at all adds a line to ~/.hyperstruck/hook-failures.log.

If the installer warns that no agent was found, create one in the dashboard and run it again.

Uninstall

python -m hyperstruck.ide.install --uninstall

This removes the Hyperstruck hook entries and skills. Your other hooks, the private environment and your key stay where they are.