♠ Today I learned: Atuin ships hooks that capture commands executed by
As of today there are hooks for Claude Code, OpenAI Codex and Pi.
% atuin hook --help
Manage AI-agent shell hooks
Usage: atuin hook
atuin hook <COMMAND>
Commands:
install Install hooks for an AI agent to capture commands in atuin history
help Print this message or the help of the given subcommand(s)
install --help
doesn’t list which agents are supported, but a bogus one does (or simply look at their web documentation):
% atuin hook install invalid-agent
Error: unknown agent: invalid-agent. Supported agents: claude-code, codex, pi
Installing the hook for pi is straightforward:
% atuin hook install pi
pi extension: installed atuin extension
Atuin extension installed for pi. Extension: ~/.pi/agent/extensions/atuin.ts
Reload pi with `/reload` or restart pi.
It drops a small extension that wraps every bash
tool call with
atuin history start --author pi
/ history end
:
const historyId = await startHistory(pi, ctx.cwd, command);
if (historyId) pending.set(event.toolCallId, historyId);
// ...
await endHistory(pi, ctx.cwd, historyId, exitCodeFromResult(event.result, event.isError));
Commands run by the agent land in the same database as everything typed by
hand (by me!); there’s no separate table, just an --author
tag:
% atuin search --help | grep -A2 author
--author <AUTHOR>
Filter by author. Supports $all-user (non-agents), $all-agent, or literal names.
% atuin search --author pi
% atuin search --author '$all-user'
One shared history to rule them all.
— § —
Reply via [email](mailto:serendipity@perrotta.dev?subject=Reply to: atuin: hooks for LLM agent shell history)