Files
ar9av__obsidian-wiki/.claude/settings.json
Arnav de3a090b8f feat(capture): auto-capture findings at session end via Stop hook (#81)
* feat(capture): auto-capture findings at session end via Stop hook

Ports hivemind's session-end capture pattern into the wiki framework:

- `.claude/hooks/wiki-stop-capture.sh` — fires on Claude Code Stop event,
  reads the session transcript JSONL, and if ≥1 file edit or ≥4 shell calls
  are detected, feeds back a message prompting /wiki-quick-chat-capture.
  The stop_hook_active guard prevents re-entry on the follow-up turn.

- `.claude/settings.json` — wires the hook into the project's Claude settings
  so it activates automatically for any Claude Code session in this repo.

- `wiki-quick-chat-capture/SKILL.md` — adds a KEEP/SKIP gate as Step 0.
  Makes the skill safe to call automatically: purely conversational sessions
  with no concrete findings exit immediately. Manual invocations err toward KEEP.

- `wiki-setup/SKILL.md` — adds an optional step to install the hook globally
  into ~/.claude/settings.json so it works across all projects, not just this repo.

* fix(stop-hook): route rewake message to stderr

Claude Code Stop hooks deliver content back to Claude via stderr, not stdout.
The echo was going to stdout so the hook silently exited 2 with no visible effect.

Confirmed: exit=2 with stderr content triggers the /wiki-quick-chat-capture prompt.
2026-06-10 22:46:22 +05:30

16 lines
229 B
JSON

{
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bash .claude/hooks/wiki-stop-capture.sh"
}
]
}
]
}
}