Sharing Traces

Sharing via Agent Hooks

Automatically share agent sessions as an agent works.

Set up agent hooks only for selected agents with:

traces setup hooks
traces setup hooks --agent claude-code

Bare traces setup installs agent hooks together with agent skills (and Git hooks in a Git repository).

Agent hooks fire when:

  1. A session starts
  2. A prompt is submitted
  3. An agent completes

They track active traces in traces-active.json and upload traces in the background as the agent works. In a Git repository the file lives in the .git directory. Outside Git it lives in the Traces data directory, in a folder per project directory. Setup creates that folder, and hooks only share sessions from directories that have one, including their subdirectories. Agents whose hooks live in user-level config, such as Kimi, don't share sessions from non-Git directories you haven't set up.

Agent hooks work in any project directory, with or without Git. Setup refuses to install them in your home directory: there, project config such as ~/.claude/settings.json is the agent's user-level config, so the hooks would share sessions from every project.

Agent hooks are supported for Claude Code, Cursor, Codex, Copilot, Cline, OpenCode, Pi, Oh My Pi, Amp, OpenClaw, Hermes, Grok, Kimi Code, and Antigravity.

To remove only the agent hooks from the current project, run:

traces remove hooks

To remove the agent integration (agent skills and agent hooks), run:

traces remove agents

For commit-to-trace links, also set up Git hooks.

On this page

No Headings