Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

feat(skill): Add Claude Code hooks for worktrunk status

Maximilian Roos046f2a5ea22a
diff --git a/.claude-plugin/hooks/hooks.json b/.claude-plugin/hooks/hooks.json
new file mode 100644
index 000000000..61090b53a
--- /dev/null
+++ b/.claude-plugin/hooks/hooks.json
@@ -0,0 +1,36 @@
+{
+ "hooks": {
+ "UserPromptSubmit": [
+ {
+ "hooks": [
+ {
+ "type": "command",
+ "command": "git branch --show-current 2>/dev/null | xargs -I {} git config worktrunk.status.{} 🤖"
+ }
+ ]
+ }
+ ],
+ "Stop": [
+ {
+ "matcher": "",
+ "hooks": [
+ {
+ "type": "command",
+ "command": "git branch --show-current 2>/dev/null | xargs -I {} git config worktrunk.status.{} 💬"
+ }
+ ]
+ }
+ ],
+ "SessionEnd": [
+ {
+ "matcher": "",
+ "hooks": [
+ {
+ "type": "command",
+ "command": "git branch --show-current 2>/dev/null | xargs -I {} git config --unset worktrunk.status.{} 2>/dev/null || true"
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json
index 2c7a25526..a9a522394 100644
--- a/.claude-plugin/marketplace.json
+++ b/.claude-plugin/marketplace.json
@@ -15,7 +15,7 @@
"source": "./",
"strict": false,
"skills": [
- "./skills/worktrunk-config"
+ "./.claude-plugin/skills/worktrunk"
]
}
]
diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json
index ad05b6be9..36ec27533 100644
--- a/.claude-plugin/plugin.json
+++ b/.claude-plugin/plugin.json
@@ -4,5 +4,6 @@
"version": "1.0.0",
"author": {
"name": "Worktrunk"
- }
+ },
+ "hooks": "./.claude-plugin/hooks/hooks.json"
}
diff --git a/skills/worktrunk-config/README.md b/.claude-plugin/skills/worktrunk/README.md
similarity index 100%
rename from skills/worktrunk-config/README.md
rename to .claude-plugin/skills/worktrunk/README.md
diff --git a/skills/worktrunk-config/SKILL.md b/.claude-plugin/skills/worktrunk/SKILL.md
similarity index 100%
rename from skills/worktrunk-config/SKILL.md
rename to .claude-plugin/skills/worktrunk/SKILL.md
diff --git a/skills/worktrunk-config/reference/hook-types-reference.md b/.claude-plugin/skills/worktrunk/reference/hook-types-reference.md
similarity index 100%
rename from skills/worktrunk-config/reference/hook-types-reference.md
rename to .claude-plugin/skills/worktrunk/reference/hook-types-reference.md
diff --git a/skills/worktrunk-config/reference/project-config.md b/.claude-plugin/skills/worktrunk/reference/project-config.md
similarity index 100%
rename from skills/worktrunk-config/reference/project-config.md
rename to .claude-plugin/skills/worktrunk/reference/project-config.md
diff --git a/skills/worktrunk-config/reference/user-config.md b/.claude-plugin/skills/worktrunk/reference/user-config.md
similarity index 100%
rename from skills/worktrunk-config/reference/user-config.md
rename to .claude-plugin/skills/worktrunk/reference/user-config.md
diff --git a/README.md b/README.md
index 82c7430a7..40a1c9955 100644
--- a/README.md
+++ b/README.md
@@ -418,7 +418,15 @@ The custom emoji appears directly after the git status symbols.
Claude Code can automatically set/clear emoji status when coding sessions start and end. This shows which branches have active AI sessions.
-Add to `~/.claude/settings.json`:
+**Easy setup:** Install the Worktrunk Claude Code plugin which includes these hooks automatically:
+<!-- [Worktrunk Claude Code plugin](https://github.com/max-sixty/worktrunk) -->
+
+```bash
+cd ~/.claude/plugins/marketplaces
+git clone https://github.com/max-sixty/worktrunk.git worktrunk-skills
+```
+
+**Manual setup:** Alternatively, add to `~/.claude/settings.json`:
```json
{