Baby’s First Hook
At last, Crush is getting support for hooks. We spent a lot of time on the design to make sure it's future proof and can support a wide variety of use cases.
We're starting with just one hook, PreToolUse, which runs before a tool call. You can use it to deny tool calls, halt turns, rewrite rewrite bash commands, and perform any number of silent side effects. One popular use of PreToolUse to use rtk to reduce the number of tokens used by many common Bash commands. Here’s a hook you can use to get started with rtk.
Let us know what other hooks you'd like to see next in the discussions.
There's an also a builtin crush-hook skill which you can use to build, manage, and configure hooks. It's very easy to have Crush help you get the most out of hooks.
Note that Crush is also compatible with Claude Code hooks. That said, the Crush-specific API will typically produce simpler hooks and less code.
For the full run-down on hooks see the official hooks docs.
Enjoy!
Charm 💘
Changelog
New!
- dc003bf: feat: PreToolUse hook (#2598) (@meowgorithm)
Fixed
- 7a6149d: fix(ui): don't show disabled skills (@BrunoKrugel)
- 3cda50f: fix(ui): fix dialog box shift when session rename is active (@meowgorithm)
Docs
- e5611c3: docs(hooks): improve hook documentation (@meowgorithm)
Other stuff
- b9fdf72: chore(hooks,skills): update crush-hooks skill per recent changes (@meowgorithm)
- a7546ad: chore(tests): regression test for (lack of) disabled skills in the ui (@meowgorithm)
- 755f6fa: chore(ui): theme prep (@meowgorithm)
- f686999: chore: auto-update files (@charmcli)
- 1948ca7: fix(ui/hooks): restore hook styling (@meowgorithm)
Verifying the artifacts
First, download the checksums.txt file and the checksums.txt.sigstore.json file files, for example, with wget:
wget 'https://github.com/charmbracelet/crush/releases/download/v0.63.0/checksums.txt'
wget 'https://github.com/charmbracelet/crush/releases/download/v0.63.0/checksums.txt.sigstore.json'Then, verify it using cosign:
cosign verify-blob \
--certificate-identity 'https://github.com/charmbracelet/meta/.github/workflows/goreleaser.yml@refs/heads/main' \
--certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \
--bundle 'checksums.txt.sigstore.json' \
./checksums.txtIf the output is Verified OK, you can safely use it to verify the checksums of other artifacts you downloaded from the release using sha256sum:
sha256sum --ignore-missing -c checksums.txtDone! You artifacts are now verified!
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
