SlateGet Slate
Docs / Extending

Override API

Let your agent drive the pane with one curl to the loopback listener on port 8477.

On this page
Enable itPOST /intentWiring it to an agentNotes

Enable it

# ~/.config/slate/config.toml
[override]
enabled = true
port    = 8477

The listener binds to 127.0.0.1 exclusively. It is never exposed on 0.0.0.0, there is no remote mode, and Slate refuses to start it if the port is already bound.

POST /intent

One endpoint. The body is a ViewIntent.

curl -s localhost:8477/intent \
  -H 'content-type: application/json' \
  -d '{"kind":"spec","path":"docs/retry.md"}'
BodyEffect
{"kind":"spec","path":"…"}Render that markdown file
{"kind":"diff","paths":["…"]}Diff those files
{"kind":"tree"}Working-tree status
{"kind":"log"}Commit history
{"kind":"search"}Search surface

Responses are 204 No Content on success, 400 for a malformed intent, 404 when a path does not exist inside the open workspace. Paths outside the workspace are rejected, not clamped.

Wiring it to an agent

Any hook mechanism works. With Claude Code, a post-edit hook is two lines:

#!/usr/bin/env bash
# .claude/hooks/post_edit.sh
curl -s --max-time 1 localhost:8477/intent \
  -d "{\"kind\":\"diff\",\"paths\":[\"$CLAUDE_FILE\"]}" || true
Fail open

Always append || true and a short timeout. A hook that blocks because Slate is not running is a worse outcome than a pane that did not switch.

Notes

  • An override wins over the classifier until the next manual interaction.
  • Overrides are rate-limited to 20/second; the excess is dropped, not queued.
  • The pane header shows override so you can tell agent-driven switches from inferred ones.