> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tembo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Hooks

> Run custom commands at lifecycle events like post-clone and pre-push.

Hooks run shell commands at specific points during a session. Configure them in `.tembo.json` at your repository root.

## Available hooks

**`postClone`** - Runs after Tembo clones your repo, before it starts working.

**`prePush`** - Runs after Tembo makes changes, before pushing and opening a PR.

## Example

```json theme={null}
{
  "hooks": {
    "postClone": [
      "npm ci",
      "cp .env.example .env.local"
    ],
    "prePush": [
      "npm run lint",
      "npm run test",
      "npm run build"
    ]
  },
  "autoFix": true
}
```

## Auto-fix

Set `"autoFix": true` to let Tembo analyze hook failures and attempt to fix issues before retrying.

## Details

* Commands run sequentially in the repository root
* If a command fails, the hook stops
* Hooks run in the same [sandbox](/features/sandbox-environment) as the session
* Shell features (piping, redirects, `&&`) are supported
