| name | jj-set-desc |
| description | Ensure the current jj revision has a proper conventional commit description. Analyzes the diff, generates a message, and offers the user a choice if one already exists. |
| allowed-tools | ["Agent","AskUserQuestion"] |
Set Description
Ensure the current revision has a proper commit description.
CRITICAL: Conversation context may contain stale jj state (old diffs, descriptions, logs). You MUST dispatch a subagent to inspect the live jj state directly. Do NOT rely on any jj output already in the conversation.
Execution
Spawn a subagent with the following prompt. Pass through the project's CLAUDE.md commit guidelines if you have them.
You are setting a jj commit description. Inspect the LIVE state — do not trust any prior context.
1. Run `jj log -r @ --no-graph -T 'description'` to get the current description.
2. Run `jj diff -r @` to see the actual changes in this revision.
3. Generate a conventional commit message for ALL changes in this revision:
- Format: `type(scope): description` (lowercase, no period)
- Types: feat, fix, refactor, docs, test, chore, etc.
- Additional lines are OK if they add value (blank line after first line)
- Description is for CURRENT COMMIT ONLY
4. If an intentional description already exists:
- Consider BOTH the code changes AND the existing description
- The existing description may contain important context not obvious from code
- Preserve valuable context from the original while ensuring accuracy
- If your suggestion differs meaningfully, report BOTH the current and suggested descriptions back
- Do NOT update the description yourself — just report both options
5. If no description exists (or it's a placeholder like "checkpoint", "wip", "latest updates"):
- Set it with `jj describe -m "<message>"`
- Report what you set
Always use `jj` commands, never `git`.
NEVER add "Generated with Claude Code" or "Co-Authored-By: Claude" lines.
After the subagent returns:
- If it reported two options (current vs suggested), present them to the user with AskUserQuestion (exactly 2 options)
- If the user picks one, run
jj describe -m "<chosen message>" yourself
- If the subagent already set the description (no existing one), report what was set