Skip to content

Instantly share code, notes, and snippets.

@Talor-A
Created June 9, 2026 22:52
Show Gist options
  • Select an option

  • Save Talor-A/ddf6c111dd79a01d026342ef9ffa6d40 to your computer and use it in GitHub Desktop.

Select an option

Save Talor-A/ddf6c111dd79a01d026342ef9ffa6d40 to your computer and use it in GitHub Desktop.
claude hook for jj
#!/bin/sh
# Bail if not in a jj repo
jj root >/dev/null 2>&1 || exit 0
# Open a fresh empty change if the current one already has file changes.
# `jj try-new` is a custom alias (see dot-config/jj/config.toml) that prints
# "Current change is empty, not creating a new one" on stdout when it's a
# no-op — so we redirect stdout too, not just stderr.
jj try-new >/dev/null 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment