fix: Correct hooks format - add nested hooks array

SessionEnd hooks require { hooks: [...] } format, not direct type/command.
Fixed install-hooks.sh script and setup.md command.
Bump version to 2.1.3

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-01-07 00:01:56 +00:00
parent f08704af5e
commit b9284a59f7
4 changed files with 24 additions and 14 deletions

View File

@@ -37,10 +37,12 @@ d = json.load(open('$SETTINGS_FILE'))
hooks = d.get('hooks', {})
session_end = hooks.get('SessionEnd', [])
for h in session_end:
cmd = h.get('command', '')
if 'learn:analyze' in cmd:
print('yes')
exit(0)
inner_hooks = h.get('hooks', [])
for ih in inner_hooks:
cmd = ih.get('command', '')
if 'learn:analyze' in cmd:
print('yes')
exit(0)
print('no')
" 2>/dev/null)
@@ -60,11 +62,15 @@ settings_file = os.path.expanduser("~/.claude/settings.json")
with open(settings_file, 'r') as f:
settings = json.load(f)
# Define Learn hooks
# Define Learn hooks (format: hooks array inside)
learn_session_end = {
"type": "command",
"command": "echo '\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n💡 Tip: Rulează /learn:analyze pentru a captura lecțiile din sesiune\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'",
"timeout": 5
"hooks": [
{
"type": "command",
"command": "echo '\\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\\n💡 Tip: Rulează /learn:analyze pentru a captura lecțiile din sesiune\\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'",
"timeout": 5
}
]
}
learn_pre_compact = {