Skip to main content
skill CX Codex

groove-admin-claude-hooks — Claude Code skill: hooks

Installs groove’s native shell hooks in .claude/settings.json. They track git activity, prepare session-capture drafts, and guard managed paths.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add andreadellacorte/groove --skill groove-admin-claude-hooks -a claude-code
Open on GitHub

What groove-admin-claude-hooks does

This skill registers selected Claude Code hooks and writes their shell scripts to .groove/hooks/claude/. The hooks run on Stop, PostToolUse, PreToolUse, and SessionStart events outside the model. Existing non-groove entries in .claude/settings.json are kept.

The available scripts cover an end-of-day reminder, commit-message buffering, protection for .agents/skills/groove and skills/groove, context reload after startup or compaction, an hourly version check, and a git-based draft at .groove/.cache/pending-capture.md. The scripts parse hook input with python3, so two of them will fail to extract commands or paths without it.

During setup, the skill can ask for a subset of hooks. Use --list to inspect registered entries and script files, or --disable <hook> to remove one registration while keeping its script. Session capture also requires .groove/index.md and a git repository.

What it helps with

  • install groove shell hooks for Claude Code
  • buffer commit messages for later capture
  • draft a session record from git activity
  • stop writes to managed groove paths
  • reload workflow context after startup or compaction

Example prompts for the agent

  • Install all groove-admin-claude-hooks hooks in this project.
  • Show the current hook status with --list.
  • Disable the version-check hook with --disable version-check.

How to install groove-admin-claude-hooks

1Skills CLI (Vercel)

npx skills add andreadellacorte/groove --skill groove-admin-claude-hooks -a claude-code

2Manually: put the files in place

~/.claude/skills/groove-admin-claude-hooks/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/groove-admin-claude-hooks/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about groove-admin-claude-hooks

How do I install groove-admin-claude-hooks in Claude Code?

Run npx skills add andreadellacorte/groove --skill groove-admin-claude-hooks -a claude-code, then open the installed file at ~/.claude/skills/groove-admin-claude-hooks/SKILL.md.

What does groove-admin-claude-hooks do?

It adds native shell hooks to .claude/settings.json and stores their scripts in .groove/hooks/claude/. The hooks respond to session events, git activity, and writes targeting managed paths.

What does session-capture need to run?

The project needs .groove/index.md and a git repository. When commits, working changes, or buffered commit messages exist, the hook writes .groove/.cache/pending-capture.md.

Source text

SKILL.md · MIT
---
name: groove-admin-claude-hooks
description: "Install groove's Claude Code native shell hooks into .claude/settings.json. Enables deterministic session-end reminders, git activity capture, automatic session-capture drafts, and managed-path protection."
license: MIT
allowed-tools: Read Write Edit Glob Bash(git:*) Bash(mkdir:*) Bash(chmod:*) AskUserQuestion
metadata:
  author: andreadellacorte
---

<!-- groove:managed — do not edit; changes will be overwritten by groove update -->

# groove-admin-claude-hooks

Install groove's Claude Code native shell hooks. These run outside the model — deterministic, unconditional — and complement groove's advisory markdown hooks (`.groove/hooks/start.md`, `end.md`).

Use `--disable <hook>` to remove a specific hook. Use `--list` to show current status.

## Outcome

Selected hooks are registered in `.claude/settings.json` and shell scripts are written to `.groove/hooks/claude/`. Hooks fire automatically on Claude Code lifecycle events without any model involvement.

## Available hooks

| Name | Event | Matcher | What it does |
|---|---|---|---|
| `daily-end-reminder` | `Stop` | — | If hour is 16–21 local time and `.groove/index.md` exists, prints a reminder to run `/groove-daily-end` |
| `git-activity-buffer` | `PostToolUse` | `Bash` | If the Bash command contains `git commit`, appends a timestamped line to `.groove/.cache/git-activity-buffer.txt` |
| `block-managed-paths` | `PreToolUse` | `Write`, `Edit` | If `file_path` starts with `.agents/skills/groove` or `skills/groove`, exits non-zero to block the write with an explanatory message |
| `context-reprime` | `SessionStart` | `startup\|compact` | Runs the prime script directly — ensures full workflow context is loaded after every session start and compaction |
| `version-check` | `PostToolUse` | — | Checks for a new groove version once per hour; calls `groove-utilities-check` |
| `session-capture` | `Stop` | — | If there is git activity this session (commits since midnight, working changes, or buffered commits), stages a capture draft to `.groove/.cache/pending-capture.md` for next-session review. Silent. |

## Steps

### `--list`

Read `.claude/settings.json` if it exists. Report which groove hooks are registered and which scripts exist in `.groove/hooks/claude/`. Exit.

### `--disable <hook>`

Remove the named hook's entry from `.claude/settings.json` (leave the script in place). Report removed / not found. Exit.

### Default (install)

1. Ask which hooks to enable (default: all six):
   ```
   Which hooks to install? (all / comma-separated: daily-end-reminder, git-activity-buffer, block-managed-paths, context-reprime, version-check, session-capture)
   Press enter for all.
   ```

2. Read `.claude/settings.json` if it exists; parse as JSON (default `{}`). Never discard existing non-groove entries.

3. Create `.groove/hooks/claude/` directory if absent. Make each script executable (`chmod +x`).

4. For each selected hook: write the shell script and merge the hook entry into `.claude/settings.json`.

5. Write `.claude/settings.json` with the merged result.

6. Report summary:
   ```
   ✓ daily-end-reminder  — Stop hook → .groove/hooks/claude/daily-end-reminder.sh
   ✓ git-activity-buffer — PostToolUse/Bash hook → .groove/hooks/claude/git-activity-buffer.sh
   ✓ block-managed-paths — PreToolUse/Write+Edit hook → .groove/hooks/claude/block-managed-paths.sh
   ✓ context-reprime     — SessionStart hook → groove-utilities-prime.sh
   ✓ version-check       — PostToolUse hook → .groove/hooks/claude/version-check.sh
   ✓ session-capture     — Stop hook → .groove/hooks/claude/session-capture.sh
   ✓ .claude/settings.json updated
   ```

## Shell script templates

Write these verbatim to `.groove/hooks/claude/`. Never overwrite an existing script without showing a diff and confirming.

### `daily-end-reminder.sh`

```bash
#!/usr/bin/env bash
# groove: Stop hook — remind about /groove-daily-end during work hours
hour=$(date +%H)
if [ -f "$CLAUDE_PROJECT_DIR/.groove/index.md" ] && [ "$hour" -ge 16 ] && [ "$hour" -le 21 ]; then
  echo "groove: end of work hours — consider running /groove-daily-end"
fi
```

### `git-activity-buffer.sh`

```bash
#!/usr/bin/env bash
# groove: PostToolUse/Bash hook — buffer git commits for memory log
input=$(cat)
command=$(echo "$input" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('tool_input',{}).get('command',''))" 2>/dev/null)
if echo "$command" | grep -q "git commit"; then
  msg=$(echo "$command" | grep -oP '(?<=-m ")[^"]+' | head -1)
  mkdir -p "$CLAUDE_PROJECT_DIR/.groove/.cache"
  echo "$(date '+%Y-%m-%d %H:%M') | ${msg:-<no message>}" >> "$CLAUDE_PROJECT_DIR/.groove/.cache/git-activity-buffer.txt"
fi
```

### `block-managed-paths.sh`

```bash
#!/usr/bin/env bash
# groove: PreToolUse/Write+Edit hook — block edits to managed groove paths
input=$(cat)
path=$(echo "$input" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('tool_input',{}).get('file_path',''))" 2>/dev/null)
if echo "$path" | grep -qE '^(\.agents/skills/groove|skills/groove)'; then
  echo "groove: blocked — '$path' is managed by groove update. Edit under skills/ and rsync to .agents/skills/." >&2
  exit 1
fi
```

### `version-check.sh`

```bash
#!/usr/bin/env bash
# groove: PostToolUse hook — check for new groove version (once per hour)
CACHE="$CLAUDE_PROJECT_DIR/.groove/.cache/last-version-check-ts"
mkdir -p "$CLAUDE_PROJECT_DIR/.groove/.cache"
now=$(date +%s)
if [ -f "$CACHE" ]; then
  last=$(cat "$CACHE")
  diff=$((now - last))
  [ "$diff" -lt 3600 ] && exit 0
fi
echo "$now" > "$CACHE"
bash "$CLAUDE_PROJECT_DIR/.agents/skills/groove-utilities-check/scripts/check.sh" 2>/dev/null || true
```

### `session-capture.sh`

```bash
#!/usr/bin/env bash
# groove: Stop hook — stage a session capture draft from git activity for next-session review
ROOT="${CLAUDE_PROJECT_DIR:-$PWD}"
[ -f "$ROOT/.groove/index.md" ] || exit 0
command -v git >/dev/null 2>&1 || exit 0
git -C "$ROOT" rev-parse --git-dir >/dev/null 2>&1 || exit 0

CACHE="$ROOT/.groove/.cache"
PENDING="$CACHE/pending-capture.md"
BUFFER="$CACHE/git-activity-buffer.txt"

commits=$(git -C "$ROOT" log --since=midnight --oneline 2>/dev/null)
changes=$(git -C "$ROOT" diff --stat HEAD 2>/dev/null)
buffered=""
[ -s "$BUFFER" ] && buffered=$(cat "$BUFFER")

# No activity → clear any stale draft and stay silent.
if [ -z "$commits" ] && [ -z "$changes" ] && [ -z "$buffered" ]; then
  rm -f "$PENDING"
  exit 0
fi

mkdir -p "$CACHE"
{
  echo "# Pending capture — $(date '+%Y-%m-%d %H:%M')"
  echo
  echo "## Commits since midnight"
  echo "${commits:-(none)}"
  echo
  echo "## Working changes"
  echo "${changes:-(none)}"
  if [ -n "$buffered" ]; then
    echo
    echo "## Buffered commit messages"
    echo "$buffered"
  fi
} > "$PENDING"
```

## `.claude/settings.json` entries

Merge these into the `hooks` key. Preserve all other keys.

```json
{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          { "type": "command", "command": "bash $CLAUDE_PROJECT_DIR/.groove/hooks/claude/daily-end-reminder.sh" }
        ]
      },
      {
        "hooks": [
          { "type": "command", "command": "bash $CLAUDE_PROJECT_DIR/.groove/hooks/claude/session-capture.sh" }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          { "type": "command", "command": "bash $CLAUDE_PROJECT_DIR/.groove/hooks/claude/git-activity-buffer.sh" }
        ]
      },
      {
        "hooks": [
          { "type": "command", "command": "bash $CLAUDE_PROJECT_DIR/.groove/hooks/claude/version-check.sh" }
        ]
      }
    ],
    "PreToolUse": [
      {
        "matcher": "Write",
        "hooks": [
          { "type": "command", "command": "bash $CLAUDE_PROJECT_DIR/.groove/hooks/claude/block-managed-paths.sh" }
        ]
      },
      {
        "matcher": "Edit",
        "hooks": [
          { "type": "command", "command": "bash $CLAUDE_PROJECT_DIR/.groove/hooks/claude/block-managed-paths.sh" }
        ]
      }
    ],
    "SessionStart": [
      {
        "matcher": "startup|compact",
        "hooks": [
          {
            "type": "command",
            "command": "bash $CLAUDE_PROJECT_DIR/.agents/skills/groove-utilities-prime/scripts/groove-utilities-prime.sh"
          }
        ]
      }
    ]
  }
}
```

When merging: if a `hooks` key already exists, append groove entries to the relevant event arrays. Do not create duplicates — check if a groove command entry already exists before appending.

## Constraints

- Never overwrite non-groove entries in `.claude/settings.json`
- Never overwrite an existing script without diff + confirmation
- Scripts use `python3` to parse JSON stdin — if python3 is absent, skip that hook and warn
- `block-managed-paths` is aggressive: if it causes false positives the user can disable it with `--disable block-managed-paths`
- After install: remind the user that hooks take effect on the next Claude Code session restart
- `.groove/hooks/claude/` follows the `git.hooks` git strategy from `.groove/index.md`

© andreadellacorte · MIT · andreadellacorte/groove

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set39

groove-utilities-memory-log-monthly Turns the month's daily memory files into one summary at .groove/memory/monthly/YYYY-MM.md, with themes, outcomes and learnings. CX Codex +1 537installs groove-work-exec This skill takes a finished implementation plan and writes the code, tests and docs for it, logging progress in your task backend. Use it once planning is done. CX Codex +1 536installs groove-utilities-task-config Displays or updates the active task tracking backend in Groove. Useful when switching project tasks to Linear or GitHub. CX Codex +1 533installs groove-utilities-task-archive Archives completed and scrapped tasks in the configured backend. Use it when you want to close a batch of finished work with a confirmation step. CX Codex +1 532installs groove-utilities-memory-mistakes This skill turns an agent mistake into a tracked incident, fixes its cause, and records the lesson in project memory. Use it to stop repeat errors. CX Codex +1 529installs groove-admin-update Pulls the latest groove skills and applies pending migrations to your local groove state. Useful when a new release lands but your config and memory are still on the old one. CX Codex +1 528installs groove-work-doc Creates a reference document explaining how a codebase component or concept works. Use it when future agents or contributors need concrete project context. CX Codex +1 518installs groove-admin-cursor-hooks Registers groove's native Cursor hooks in .cursor/hooks.json: context re-priming after compaction, end-of-day reminders, a git commit buffer and managed-path protection. CX Codex +1 518installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor