Repository navigation
Expand file tree
/
Copy pathpostcompact.hook.example.json
More file actions
43 lines (43 loc) · 1.67 KB
/
Copy pathpostcompact.hook.example.json
File metadata and controls
43 lines (43 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// postcompact.hook.example.json - paste-in template for ~/.claude/settings.json
//
// OPT-IN / DISABLED BY DEFAULT. The background agent writes to your vault
// UNATTENDED with --dangerously-skip-permissions, so it ships inert. It does
// nothing until BOTH env vars below are set AND the PostCompact hook is
// registered. Read the trust caveat at the top of hooks/obsidian-bg-agent.sh
// before enabling.
//
// If you ran scripts/setup.sh: it already registered the PostCompact hook and
// set OBSIDIAN_VAULT_PATH. To turn the agent ON, add the second flag to the
// "env" section of ~/.claude/settings.json (this is the only step that arms it):
// "env": {
// "OBSIDIAN_VAULT_PATH": "/path/to/your/vault",
// "OBSIDIAN_BG_AGENT_ENABLED": "1"
// }
//
// If you are wiring it by hand (no setup.sh):
// 1. Make the script executable (one-time):
// chmod +x ~/.claude/skills/obsidian-second-brain/hooks/obsidian-bg-agent.sh
// 2. Add BOTH env vars above to the "env" section.
// 3. Merge the "hooks" block below into ~/.claude/settings.json (real JSON -
// strip these comments), using the absolute path to your installed script.
//
// To DISABLE again: set OBSIDIAN_BG_AGENT_ENABLED to "0" (or remove it). The
// hard gate in the script makes clearing the flag enough to render it inert,
// even if the PostCompact hook stays registered.
{
"hooks": {
"PostCompact": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "/absolute/path/to/.claude/skills/obsidian-second-brain/hooks/obsidian-bg-agent.sh",
"timeout": 10,
"async": true
}
]
}
]
}
}