Staso Docs
Coding agents

Connect Claude Code

Staso hooks record supported Claude Code turns and proposed tool calls. Setup changes Claude Code settings; it does not change the project Claude Code edits.

1. Install and configure

python3 -m pip install --upgrade staso
staso setup --target claude-code
staso status --target claude-code

Setup prompts for your Staso API key and workspace. It stores the key in Staso's user credential storage and writes hooks in ~/.claude/settings.json. Use --scope project to write .claude/settings.local.json in the current project. Review the generated settings before running a task.

2. Run a task and inspect its trace

Ask Claude Code to read a harmless project file and explain it. Open Traces → Traces in the selected Staso workspace, then open the new session. Confirm the prompt and any exposed tool steps belong to this run. Setup reports First ingestion: pending first real agent event until a real event arrives.

A submitted prompt opens a live root. Tool callbacks and observed model usage update the same turn. Completion closes it. Token counts and model detail appear only when Claude Code exposes them to the hooks.

Guard and capture

PreToolUse checks supported proposals when Guard is enabled and a matching policy exists. Audit records a would-block finding and lets the tool continue. Block can stop a matching proposal before execution. An unavailable decision follows the configured fail-open or fail-closed setting. --no-guard disables the check during setup.

Five capture categories default on: request, system prompt, tool schema, tool arguments, and output. Claude Code hooks do not expose a host system prompt or tool schema. To suppress captured request or arguments during setup:

staso setup --target claude-code --no-capture-request --no-capture-tool-arguments

The output category controls assistant and tool response content. Suppressed content cannot supply evidence to a Guard rule. See capture controls.

Update or remove hooks

staso update
staso status --target claude-code
# To remove only these hooks:
staso uninstall --target claude-code

See Update Staso if your installation uses a tool other than pip, or troubleshooting if a trace does not appear.