{"slug": "atuin-hooks-for-llm-agent-shell-history", "title": "atuin: hooks for LLM agent shell history", "summary": "Atuin, the shell history tool, now ships hooks that capture commands executed by AI agents including Claude Code, OpenAI Codex, and Pi, integrating them into the same history database as user-typed commands with an author tag. The feature, documented in Atuin 18.18, allows filtering by agent or user via the `--author` flag, unifying all command history in one place.", "body_md": "♠ **Today I learned**: [Atuin](https://atuin.sh/) ships\n[ hooks](https://docs.atuin.sh/18.18/guide/agent-hooks/) that capture commands\nexecuted by\n\nAs of today there are hooks for Claude Code, OpenAI Codex and Pi.\n\n```\n% atuin hook --help\nManage AI-agent shell hooks\n\nUsage: atuin hook\n       atuin hook <COMMAND>\n\nCommands:\n  install  Install hooks for an AI agent to capture commands in atuin history\n  help     Print this message or the help of the given subcommand(s)\n```\n\n`install --help`\n\ndoesn’t list which agents are supported, but a bogus one\ndoes (or simply look at their web documentation):\n\n```\n% atuin hook install invalid-agent\nError: unknown agent: invalid-agent. Supported agents: claude-code, codex, pi\n```\n\nInstalling the hook for [pi](https://pi.dev/) is straightforward:\n\n```\n% atuin hook install pi\npi extension: installed atuin extension\n\nAtuin extension installed for pi. Extension: ~/.pi/agent/extensions/atuin.ts\nReload pi with `/reload` or restart pi.\n```\n\nIt drops a small extension that wraps every `bash`\n\ntool call with\n`atuin history start --author pi`\n\n/ `history end`\n\n:\n\n``` js\nconst historyId = await startHistory(pi, ctx.cwd, command);\nif (historyId) pending.set(event.toolCallId, historyId);\n\n// ...\n\nawait endHistory(pi, ctx.cwd, historyId, exitCodeFromResult(event.result, event.isError));\n```\n\nCommands run by the agent land in the same database as everything typed by\nhand (by me!); there’s no separate table, just an `--author`\n\ntag:\n\n```\n% atuin search --help | grep -A2 author\n      --author <AUTHOR>\n          Filter by author. Supports $all-user (non-agents), $all-agent, or literal names.\n% atuin search --author pi\n% atuin search --author '$all-user'\n```\n\nOne shared history to rule them all.\n\n— § —\n\nReply via [email](mailto:serendipity@perrotta.dev?subject=Reply to: atuin: hooks for LLM agent shell history)", "url": "https://wpnews.pro/news/atuin-hooks-for-llm-agent-shell-history", "canonical_source": "https://perrotta.dev/2026/08/atuin-hooks-for-llm-agent-shell-history/", "published_at": "2026-08-06 11:21:31+00:00", "updated_at": "2026-08-09 12:32:15.039798+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "ai-tools"], "entities": ["Atuin", "Claude Code", "OpenAI Codex", "Pi"], "alternates": {"html": "https://wpnews.pro/news/atuin-hooks-for-llm-agent-shell-history", "markdown": "https://wpnews.pro/news/atuin-hooks-for-llm-agent-shell-history.md", "text": "https://wpnews.pro/news/atuin-hooks-for-llm-agent-shell-history.txt", "jsonld": "https://wpnews.pro/news/atuin-hooks-for-llm-agent-shell-history.jsonld"}}