Before you start

Make sure you have Autohand Code installed and a project-level .autohand/config.json file. Hooks defined in the project directory override user-level hooks, which makes them safe to commit and share.

Step 1: lint changed files

Add an on_file_change hook that runs ESLint and Prettier on TypeScript files.

Step 2: run related tests

Run tests that are related to the changed file. This keeps feedback fast.

Step 3: notify on session end

Send a Slack message when the session finishes. Store the webhook URL in an environment variable.

Step 4: block dangerous commands

Use before_command as a guardrail. Exit with a non-zero status to stop the command.

Step 5: audit tool usage

Log every tool call with a timestamp for compliance.

Next steps

Explore the Hooks Reference for the full event list, and see Building Event-Driven Agents to trigger agents from external systems.