Skip to content

Add Claude integration hooks and history-end locking#3204

Open
ellie wants to merge 3 commits intomainfrom
ellie/claude-shell-history
Open

Add Claude integration hooks and history-end locking#3204
ellie wants to merge 3 commits intomainfrom
ellie/claude-shell-history

Conversation

@ellie
Copy link
Copy Markdown
Member

@ellie ellie commented Feb 25, 2026

This adds Claude Code integration support behind a new [integrations] settings block (claude = true by default) and documents it in the sample config and docs.

It wires auto-configuration of Claude hooks plus hook payload capture in Atuin, gated by integrations.claude and presence of claude in PATH.

Trigger points are daemon startup and direct-db history end (not init, and not daemon-backed history end).

It also adds a global history-end.lock for all history-end commands, alongside a separate lock for Claude settings updates, to prevent race conditions.

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 25, 2026

Greptile Summary

Adds Claude Code integration with auto-hook configuration. Sets up Bash tool capture via PostToolUse hooks, adds history-end locking to prevent race conditions, and gates everything behind integrations.claude (defaults true).

  • Test compilation error on line 1326 (struct spread not valid)
  • Implementation handles both new __capture-claude-hook command and legacy atuin-capture.sh detection
  • Lock files prevent concurrent history-end operations and Claude settings updates
  • Hook auto-configuration only triggers when claude binary is in PATH

Important Files Changed

Filename Overview
crates/atuin/src/command/client/history.rs Added Claude hook capture, history-end locking, and comprehensive tests. One test has a compilation error with struct spread syntax.
crates/atuin-client/src/settings.rs Added Integrations struct with claude field defaulting to true.
crates/atuin/src/command/client/daemon.rs Added Claude hook auto-configuration on daemon startup.

Last reviewed commit: 3cc03ed

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant