Manage agent lifecycle hooks: list, upsert, delete, toggle, test-fire, reload from disk, disable all, and acknowledge the hook-trust prompt. Hooks are session-scoped — every operation on this page requires a live session_id. Guarded writes (upsert, delete, toggle, disable-all) additionally require a single-use write nonce minted by beginHookWrite.
Lists the lifecycle hooks for a live session. Returns the live + on-disk hook summaries, drift status, per-scope settings files, and the execution-trust probe. session_id may be supplied in the body or as the ?session_id query alias; the body value wins.
The request was malformed or carried invalid parameters.
Correct the request body or query parameters.
realm_scope_unsupported
Realm scope unsupported
A per-request realm header was supplied to an active-only / global-no-realm RPC, which has no realm dimension to scope.
Omit the realm header on this route, or open a session to scope by realm.
{
"code": "forbidden",
"message": "request must arrive through the Hoody proxy"
}
Error Code
Title
Description
Resolution
forbidden
Forbidden (not via the Hoody proxy)
The request did not arrive through hoody-proxy: its source IP is private/local. The gateway has no service-level auth — authorization is owned by hoody-proxy.
Reach the agent through hoody-proxy (e.g. hoody agent … → platform → proxy).
{
"code": "rate_limited",
"message": "request rate limit exceeded"
}
Error Code
Title
Description
Resolution
rate_limited
Too many requests
The per-client request rate limit was exceeded; the gateway throttled the request before dispatch.
Honor the Retry-After header and retry; reduce the request rate.
{
"code": "internal_error",
"message": "internal server error"
}
Error Code
Title
Description
Resolution
internal_error
Internal error
An unexpected error occurred while handling the request.
Issues the two-step write nonce required before every guarded hook mutation: not just upsert/delete, but also toggle and disable-all. The returned nonce binds to a (session, op, scope) tuple and is single-use. A nonce minted for op:toggle is NOT accepted by upsert, etc.
"message": "invalid op: must be one of upsert, delete, toggle, set_disabled"
}
Error Code
Title
Description
Resolution
bad_request
Bad request
The request was malformed or carried invalid parameters.
Correct the request body or query parameters.
realm_scope_unsupported
Realm scope unsupported
A per-request realm header was supplied to an active-only / global-no-realm RPC.
Omit the realm header on this route, or open a session to scope by realm.
{
"code": "forbidden",
"message": "request must arrive through the Hoody proxy"
}
Error Code
Title
Description
Resolution
forbidden
Forbidden (not via the Hoody proxy)
The request did not arrive through hoody-proxy.
Reach the agent through hoody-proxy (e.g. hoody agent … → platform → proxy).
{
"code": "not_found",
"message": "session not found"
}
Error Code
Title
Description
Resolution
not_found
Not found
The requested resource does not exist.
Verify the path and identifier.
{
"code": "payload_too_large",
"message": "request body exceeds the configured size limit"
}
Error Code
Title
Description
Resolution
payload_too_large
Payload too large
The request body exceeds the configured size cap (MaxBodyBytes; default 8 MiB). The gateway rejects an oversized body at the edge (http.MaxBytesReader) before the handler reads it.
Reduce the request body below the configured limit; split a large payload into smaller requests.
{
"code": "rate_limited",
"message": "request rate limit exceeded"
}
Error Code
Title
Description
Resolution
rate_limited
Too many requests
The per-client request rate limit was exceeded; the gateway throttled the request before dispatch.
Honor the Retry-After header and retry; reduce the request rate.
{
"code": "internal_error",
"message": "internal server error"
}
Error Code
Title
Description
Resolution
internal_error
Internal error
An unexpected error occurred while handling the request.
Retry; if persistent, inspect the daemon logs.
{
"code": "service_unavailable",
"message": "service unavailable"
}
Error Code
Title
Description
Resolution
service_unavailable
Service unavailable
The daemon could not service the request (too busy, or a per-client stream concurrency cap was hit).
Creates or updates a hook. Requires a nonce minted by beginHookWrite for op:upsert and a live session_id. Defining a hook persists an arbitrary command that fires on lifecycle events.
const result = await client.agent.hooks.upsertHook({
"X-Hoody-Cwd": "/home/user/projects/myapp",
"X-Hoody-Config-Dir": "/home/user/.hoody",
"X-Hoody-Container": "local"
}, {
session_id: "sess_8f3a2b1c4d5e6f70",
nonce: "nonce_4d2c1e8f9a0b6c5d7e3f1a2b8c9d0e1f",
scope: "project",
event: "PreToolUse",
matcher: "Bash",
command: "echo running pre-tool hook",
timeout: 5000
});
{
"upserted": true,
"hook": {
"event": "PreToolUse",
"matcher": "Bash",
"command": "echo running pre-tool hook",
"enabled": true,
"timeout": 5000,
"scope": "project"
}
}
{
"code": "bad_request",
"message": "invalid nonce for op:upsert"
}
Error Code
Title
Description
Resolution
bad_request
Bad request
The request was malformed or carried invalid parameters.
Correct the request body or query parameters.
realm_scope_unsupported
Realm scope unsupported
A per-request realm header was supplied to an active-only / global-no-realm RPC.
Omit the realm header on this route, or open a session to scope by realm.
{
"code": "forbidden",
"message": "request must arrive through the Hoody proxy"
}
Error Code
Title
Description
Resolution
forbidden
Forbidden (not via the Hoody proxy)
The request did not arrive through hoody-proxy.
Reach the agent through hoody-proxy (e.g. hoody agent … → platform → proxy).
{
"code": "not_found",
"message": "session not found"
}
Error Code
Title
Description
Resolution
not_found
Not found
The requested resource does not exist.
Verify the path and identifier.
{
"code": "payload_too_large",
"message": "request body exceeds the configured size limit"
}
Error Code
Title
Description
Resolution
payload_too_large
Payload too large
The request body exceeds the configured size cap (MaxBodyBytes; default 8 MiB). The gateway rejects an oversized body at the edge (http.MaxBytesReader).
Reduce the request body below the configured limit; split a large payload into smaller requests.
{
"code": "rate_limited",
"message": "request rate limit exceeded"
}
Error Code
Title
Description
Resolution
rate_limited
Too many requests
The per-client request rate limit was exceeded; the gateway throttled the request before dispatch.
Honor the Retry-After header and retry; reduce the request rate.
{
"code": "internal_error",
"message": "internal server error"
}
Error Code
Title
Description
Resolution
internal_error
Internal error
An unexpected error occurred while handling the request.
Retry; if persistent, inspect the daemon logs.
{
"code": "service_unavailable",
"message": "service unavailable"
}
Error Code
Title
Description
Resolution
service_unavailable
Service unavailable
The daemon could not service the request (too busy, or a per-client stream concurrency cap was hit).
const result = await client.agent.hooks.toggleHook({
"X-Hoody-Cwd": "/home/user/projects/myapp",
"X-Hoody-Config-Dir": "/home/user/.hoody",
"X-Hoody-Container": "local"
}, {
session_id: "sess_8f3a2b1c4d5e6f70",
nonce: "nonce_4d2c1e8f9a0b6c5d7e3f1a2b8c9d0e1f",
scope: "project"
});
{
"toggled": true,
"scope": "project",
"enabled": false
}
{
"code": "bad_request",
"message": "invalid nonce for op:toggle"
}
Error Code
Title
Description
Resolution
bad_request
Bad request
The request was malformed or carried invalid parameters.
Correct the request body or query parameters.
realm_scope_unsupported
Realm scope unsupported
A per-request realm header was supplied to an active-only / global-no-realm RPC.
Omit the realm header on this route, or open a session to scope by realm.
{
"code": "forbidden",
"message": "request must arrive through the Hoody proxy"
}
Error Code
Title
Description
Resolution
forbidden
Forbidden (not via the Hoody proxy)
The request did not arrive through hoody-proxy.
Reach the agent through hoody-proxy (e.g. hoody agent … → platform → proxy).
{
"code": "not_found",
"message": "session not found"
}
Error Code
Title
Description
Resolution
not_found
Not found
The requested resource does not exist.
Verify the path and identifier.
{
"code": "payload_too_large",
"message": "request body exceeds the configured size limit"
}
Error Code
Title
Description
Resolution
payload_too_large
Payload too large
The request body exceeds the configured size cap (MaxBodyBytes; default 8 MiB). The gateway rejects an oversized body at the edge (http.MaxBytesReader).
Reduce the request body below the configured limit; split a large payload into smaller requests.
{
"code": "rate_limited",
"message": "request rate limit exceeded"
}
Error Code
Title
Description
Resolution
rate_limited
Too many requests
The per-client request rate limit was exceeded; the gateway throttled the request before dispatch.
Honor the Retry-After header and retry; reduce the request rate.
{
"code": "internal_error",
"message": "internal server error"
}
Error Code
Title
Description
Resolution
internal_error
Internal error
An unexpected error occurred while handling the request.
Retry; if persistent, inspect the daemon logs.
{
"code": "service_unavailable",
"message": "service unavailable"
}
Error Code
Title
Description
Resolution
service_unavailable
Service unavailable
The daemon could not service the request (too busy, or a per-client stream concurrency cap was hit).
Disables (or re-enables) all hooks at once. Requires the begin-write nonce minted by beginHookWrite for op:set_disabled and a live session_id. The daemon RPC fails closed without the nonce.
const result = await client.agent.hooks.disableAllHooks({
"X-Hoody-Cwd": "/home/user/projects/myapp",
"X-Hoody-Config-Dir": "/home/user/.hoody",
"X-Hoody-Container": "local"
}, {
session_id: "sess_8f3a2b1c4d5e6f70",
nonce: "nonce_4d2c1e8f9a0b6c5d7e3f1a2b8c9d0e1f",
scope: "project"
});
{
"disabled": true,
"scope": "project"
}
{
"code": "bad_request",
"message": "invalid nonce for op:set_disabled"
}
Error Code
Title
Description
Resolution
bad_request
Bad request
The request was malformed or carried invalid parameters.
Correct the request body or query parameters.
realm_scope_unsupported
Realm scope unsupported
A per-request realm header was supplied to an active-only / global-no-realm RPC.
Omit the realm header on this route, or open a session to scope by realm.
{
"code": "forbidden",
"message": "request must arrive through the Hoody proxy"
}
Error Code
Title
Description
Resolution
forbidden
Forbidden (not via the Hoody proxy)
The request did not arrive through hoody-proxy.
Reach the agent through hoody-proxy (e.g. hoody agent … → platform → proxy).
{
"code": "not_found",
"message": "session not found"
}
Error Code
Title
Description
Resolution
not_found
Not found
The requested resource does not exist.
Verify the path and identifier.
{
"code": "payload_too_large",
"message": "request body exceeds the configured size limit"
}
Error Code
Title
Description
Resolution
payload_too_large
Payload too large
The request body exceeds the configured size cap (MaxBodyBytes; default 8 MiB). The gateway rejects an oversized body at the edge (http.MaxBytesReader).
Reduce the request body below the configured limit; split a large payload into smaller requests.
{
"code": "rate_limited",
"message": "request rate limit exceeded"
}
Error Code
Title
Description
Resolution
rate_limited
Too many requests
The per-client request rate limit was exceeded; the gateway throttled the request before dispatch.
Honor the Retry-After header and retry; reduce the request rate.
{
"code": "internal_error",
"message": "internal server error"
}
Error Code
Title
Description
Resolution
internal_error
Internal error
An unexpected error occurred while handling the request.
Retry; if persistent, inspect the daemon logs.
{
"code": "service_unavailable",
"message": "service unavailable"
}
Error Code
Title
Description
Resolution
service_unavailable
Service unavailable
The daemon could not service the request (too busy, or a per-client stream concurrency cap was hit).
The request was malformed or carried invalid parameters.
Correct the request body or query parameters.
realm_scope_unsupported
Realm scope unsupported
A per-request realm header was supplied to an active-only / global-no-realm RPC.
Omit the realm header on this route, or open a session to scope by realm.
{
"code": "forbidden",
"message": "request must arrive through the Hoody proxy"
}
Error Code
Title
Description
Resolution
forbidden
Forbidden (not via the Hoody proxy)
The request did not arrive through hoody-proxy.
Reach the agent through hoody-proxy (e.g. hoody agent … → platform → proxy).
{
"code": "not_found",
"message": "session not found"
}
Error Code
Title
Description
Resolution
not_found
Not found
The requested resource does not exist.
Verify the path and identifier.
{
"code": "payload_too_large",
"message": "request body exceeds the configured size limit"
}
Error Code
Title
Description
Resolution
payload_too_large
Payload too large
The request body exceeds the configured size cap (MaxBodyBytes; default 8 MiB). The gateway rejects an oversized body at the edge (http.MaxBytesReader).
Reduce the request body below the configured limit; split a large payload into smaller requests.
{
"code": "rate_limited",
"message": "request rate limit exceeded"
}
Error Code
Title
Description
Resolution
rate_limited
Too many requests
The per-client request rate limit was exceeded; the gateway throttled the request before dispatch.
Honor the Retry-After header and retry; reduce the request rate.
{
"code": "internal_error",
"message": "internal server error"
}
Error Code
Title
Description
Resolution
internal_error
Internal error
An unexpected error occurred while handling the request.
Retry; if persistent, inspect the daemon logs.
{
"code": "service_unavailable",
"message": "service unavailable"
}
Error Code
Title
Description
Resolution
service_unavailable
Service unavailable
The daemon could not service the request (too busy, or a per-client stream concurrency cap was hit).
Test-fires a hook command — this executes an arbitrary command now. The daemon’s human-only _machine_confirmed denial lives only on the model-facing tool path, NOT on the hooks.test RPC this route dispatches. The HTTP edge has no service-level auth; securing the public surface is hoody-proxy’s responsibility. Requires a live session_id (hooks are session-scoped).
const result = await client.agent.hooks.testHook({
"X-Hoody-Cwd": "/home/user/projects/myapp",
"X-Hoody-Config-Dir": "/home/user/.hoody",
"X-Hoody-Container": "local"
});
{
"fired": true,
"exit_code": 0,
"stdout": "running pre-tool hook\n",
"stderr": ""
}
{
"code": "bad_request",
"message": "invalid request"
}
Error Code
Title
Description
Resolution
bad_request
Bad request
The request was malformed or carried invalid parameters.
Correct the request body or query parameters.
realm_scope_unsupported
Realm scope unsupported
A per-request realm header was supplied to an active-only / global-no-realm RPC.
Omit the realm header on this route, or open a session to scope by realm.
{
"code": "forbidden",
"message": "request must arrive through the Hoody proxy"
}
Error Code
Title
Description
Resolution
forbidden
Forbidden (not via the Hoody proxy)
The request did not arrive through hoody-proxy.
Reach the agent through hoody-proxy (e.g. hoody agent … → platform → proxy).
{
"code": "not_found",
"message": "session not found"
}
Error Code
Title
Description
Resolution
not_found
Not found
The requested resource does not exist.
Verify the path and identifier.
{
"code": "payload_too_large",
"message": "request body exceeds the configured size limit"
}
Error Code
Title
Description
Resolution
payload_too_large
Payload too large
The request body exceeds the configured size cap (MaxBodyBytes; default 8 MiB). The gateway rejects an oversized body at the edge (http.MaxBytesReader).
Reduce the request body below the configured limit; split a large payload into smaller requests.
{
"code": "rate_limited",
"message": "request rate limit exceeded"
}
Error Code
Title
Description
Resolution
rate_limited
Too many requests
The per-client request rate limit was exceeded; the gateway throttled the request before dispatch.
Honor the Retry-After header and retry; reduce the request rate.
{
"code": "internal_error",
"message": "internal server error"
}
Error Code
Title
Description
Resolution
internal_error
Internal error
An unexpected error occurred while handling the request.
Retry; if persistent, inspect the daemon logs.
{
"code": "service_unavailable",
"message": "service unavailable"
}
Error Code
Title
Description
Resolution
service_unavailable
Service unavailable
The daemon could not service the request (too busy, or a per-client stream concurrency cap was hit).
const result = await client.agent.hooks.ackHookTrust({
"X-Hoody-Cwd": "/home/user/projects/myapp",
"X-Hoody-Config-Dir": "/home/user/.hoody",
"X-Hoody-Container": "local"
});
{
"acknowledged": true,
"session_id": "sess_8f3a2b1c4d5e6f70"
}
{
"code": "bad_request",
"message": "invalid request"
}
Error Code
Title
Description
Resolution
bad_request
Bad request
The request was malformed or carried invalid parameters.
Correct the request body or query parameters.
realm_scope_unsupported
Realm scope unsupported
A per-request realm header was supplied to an active-only / global-no-realm RPC.
Omit the realm header on this route, or open a session to scope by realm.
{
"code": "forbidden",
"message": "request must arrive through the Hoody proxy"
}
Error Code
Title
Description
Resolution
forbidden
Forbidden (not via the Hoody proxy)
The request did not arrive through hoody-proxy.
Reach the agent through hoody-proxy (e.g. hoody agent … → platform → proxy).
{
"code": "not_found",
"message": "session not found"
}
Error Code
Title
Description
Resolution
not_found
Not found
The requested resource does not exist.
Verify the path and identifier.
{
"code": "payload_too_large",
"message": "request body exceeds the configured size limit"
}
Error Code
Title
Description
Resolution
payload_too_large
Payload too large
The request body exceeds the configured size cap (MaxBodyBytes; default 8 MiB). The gateway rejects an oversized body at the edge (http.MaxBytesReader).
Reduce the request body below the configured limit; split a large payload into smaller requests.
{
"code": "rate_limited",
"message": "request rate limit exceeded"
}
Error Code
Title
Description
Resolution
rate_limited
Too many requests
The per-client request rate limit was exceeded; the gateway throttled the request before dispatch.
Honor the Retry-After header and retry; reduce the request rate.
{
"code": "internal_error",
"message": "internal server error"
}
Error Code
Title
Description
Resolution
internal_error
Internal error
An unexpected error occurred while handling the request.
Retry; if persistent, inspect the daemon logs.
{
"code": "service_unavailable",
"message": "service unavailable"
}
Error Code
Title
Description
Resolution
service_unavailable
Service unavailable
The daemon could not service the request (too busy, or a per-client stream concurrency cap was hit).