Claude - Opinionated Claude Code integration for Elixir

Example of the new syntax I’m experimenting with (link):

hooks: %{
    stop: [
      %{
        id: :elixir_quality_checks_stop,
        tasks: [
          "format --check-formatted",
          "compile --warnings-as-errors",
          "deps.unlock --check-unused",
          "test --stale"
        ]
      }
    ],
    post_tool_use: [
      %{
        id: :elixir_quality_checks,
        matcher: [:write, :edit, :multi_edit],
        tasks: [
          "format --check-formatted {{tool_input.file_path}}",
          "compile --warnings-as-errors"
        ]
      },
      %{
        id: :related_files_check,
        matcher: [:write, :edit, :multi_edit],
        tasks: [
          "claude.hooks.related_files"
        ]
      }
    ],
    pre_tool_use: [
      %{
        id: :pre_commit_validation,
        # Match git commit commands (but not with --no-verify)
        matcher: "Bash(git commit:*)",
        tasks: [
          "format --check-formatted",
          "compile --warnings-as-errors",
          "deps.unlock --check-unused",
          "test --stale"
        ]
      }
    ]
  }

I’d really appreicate your feedback!

1 Like

So when you shove the test results in its face like that, does it pay attention?

thank you for your encouraging words. I will create GH issues.

bradley, this is new stuff to me - can you give me some pointers to materials/references that would help me understand this so that I can give you feedback? I am sorry if this is more work for you.

Hi everyone,

I just released v0.3 which now lets you use any mix task or generic command as a hook. Check out the full details in the hooks cheatsheet.

This release also includes a few quality-of-life improvements:

  • Tidewave now auto-installs if Phoenix is detected
  • Updated docs with new guides and cheatsheets
  • Hooks are now more robust and reliable

Happy hook building!

3 Likes