# What the hooks send

The hook script (`forkit-hook.mjs`) runs inside your agent: it sees each hook event your agent produces. This page lists what it sends to Forkit, where, and how to send less. Everything below can be checked in the source in this repository.

All requests go to one address: `FORKIT_URL`, default `https://forkit-mcp.com`, with your key in `Authorization: Bearer`. Nothing goes anywhere else. Every call gives up after a few seconds, and the hook always exits 0, so a Forkit outage never breaks your agent.

## What is sent, by endpoint

| Endpoint | When | What |
|---|---|---|
| `POST /api/v1/capture` | each hook event (session start and end, prompt, tool call, end of a turn) | the event type, the session id, the repository name, branch and commit; depending on the capture mode below: the prompt, the command run, the paths of edited files, the agent's last message of a turn |
| `POST /api/v1/permissions` (and `…/wait`, `…/withdraw`) | the agent asks permission for a tool (full mode only) | the tool, the command or path it wants, the repository |
| `GET /api/v1/leases/check` | before an edit | the paths about to be edited, to ask whether another agent claimed them |
| `GET /api/v1/messages`, `…/messages/wait`, `GET /api/v1/threads/:id`, `…/wait` | when there may be a message or a person's reply for this session | nothing about your code: it reads replies addressed to the session |
| `POST /api/v1/usage` | end of a turn, and during a turn at most every 20 s | token counts per model read from the agent's transcript, and the title the agent's own tool gave the session (no other transcript text) |
| `POST /api/v1/capture` (event `trace`, full mode only) | with the usage report | unless turned off (below): the agent's thinking (up to 2,000 characters each) and its subagent calls with their outcome, read from the transcript, each sent once |
| `POST /api/v1/merge-check` | only for fan-out keys (`fo_…`) or with `FORKIT_MERGE_CHECK=1`: when the agent stops, and at most every 30 s after an edit | the diff of the checkout since the commit it started from (tracked changes, commits and new files), so it can be compared with the other agents' |

## Commands you run

The CLI sends only what a command is for, when you run it: `forkit share` sends your checkout's change as a patch to the agent you name, `forkit check-merge` sends your diff, `forkit plan submit` sends the plan file, `forkit message` sends your text. `forkit run -- <agent>` (`supervise.mjs`, for agents without hooks) reports the paths of changed files every two seconds and, for a fan-out key, the diff for the merge check.

## What is never sent

- Your model provider keys.
- File contents, except in a fan-out agent's diff for the merge check (above).
- Anything outside the session's hook events: the hook does not scan your disk or read other projects.

Forkit never runs your agents. It answers the hook; your agent does the work where it runs now.

## Sending less

| Setting | Effect |
|---|---|
| `FORKIT_CAPTURE=minimal` | file paths and states only: no prompt, no command text, no thinking. Permission requests are not sent (deciding needs the command) |
| `FORKIT_CAPTURE=off` | nothing is sent |
| `FORKIT_PERMISSIONS=off` | permission requests stay in your terminal |
| `FORKIT_THINKING=0` | subagent calls are sent, the agent's thinking is not |
| `FORKIT_TRACE=0` | neither thinking nor subagent calls (the default for fan-out keys) |
| `FORKIT_MERGE_CHECK=0` | no diffs, even for a fan-out key |
| `FORKIT_LIVE_DIFF=0` | the merge check runs only when the agent stops, not after edits |

Set them in your shell, or `capture` in `~/.config/forkit/config.json` (written by `forkit init`).

## Who can see it

What a session sends is visible to the people in your Forkit workspace, like the commands an agent runs. Thinking can quote what an agent read, so it is shown the same way. Questions about data: feedback@forkit-mcp.com.
