| name | setup-atuin-hook |
| description | Install or update the Codex Atuin PreToolUse/PostToolUse hook in the current workspace or user config, then validate it by checking Atuin history. |
Setup Atuin Hook
Use this skill when the user wants the Codex Atuin hook installed, updated, or verified.
What this plugin provides
hooks/post_tool_use_to_atuin.py: entrypoint for the hook
hooks/codex_atuin_hook/: shared implementation for payload parsing, Atuin I/O, and state
examples/hooks.json: sample hook registration
Installation workflow
- Decide whether the user wants workspace-local or user-global setup.
- Enable Codex hooks in the relevant
.codex/config.toml:
[features]
codex_hooks = true
- Add both
PreToolUse and PostToolUse registrations to .codex/hooks.json, matching only Bash.
- Point the command at this plugin's
hooks/post_tool_use_to_atuin.py.
- Set
CODEX_ATUIN_AUTHOR and CODEX_ATUIN_INTENT inline in the hook command when the user wants explicit metadata.
- Validate by running a Bash tool command in Codex and checking:
atuin history last --format '{command}|{author}|{intent}|{exit}|{duration}'
Notes
- Prefer a project-local
.codex/ folder when the user asks to test in one repo.
- The hook is designed to fail open if Atuin is missing.
- The robust path uses
tool_use_id across PreToolUse and PostToolUse to compute duration.