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:
@@ -11,7 +11,7 @@
|
|||||||
"name": "learn",
|
"name": "learn",
|
||||||
"source": "./plugins/learn",
|
"source": "./plugins/learn",
|
||||||
"description": "Domain-based memory with selective saving, signal detection, and memory hygiene",
|
"description": "Domain-based memory with selective saving, signal detection, and memory hygiene",
|
||||||
"version": "2.1.2",
|
"version": "2.1.3",
|
||||||
"keywords": ["learn", "memory", "patterns", "gotchas", "domains", "cleanup", "hygiene"]
|
"keywords": ["learn", "memory", "patterns", "gotchas", "domains", "cleanup", "hygiene"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "learn",
|
"name": "learn",
|
||||||
"description": "Claude Learn: Session analysis for patterns and gotchas with domain-based memory, selective saving, and memory hygiene",
|
"description": "Claude Learn: Session analysis for patterns and gotchas with domain-based memory, selective saving, and memory hygiene",
|
||||||
"version": "2.1.2",
|
"version": "2.1.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Romfast Team"
|
"name": "Romfast Team"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,9 +22,13 @@ Verifică și instalează hooks-urile necesare pentru plugin-ul Learn în `~/.cl
|
|||||||
"hooks": {
|
"hooks": {
|
||||||
"SessionEnd": [
|
"SessionEnd": [
|
||||||
{
|
{
|
||||||
"type": "command",
|
"hooks": [
|
||||||
"command": "echo '\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n💡 Tip: Rulează /learn:analyze pentru a captura lecțiile din sesiune\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'",
|
{
|
||||||
"timeout": 5
|
"type": "command",
|
||||||
|
"command": "echo '\\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\\n💡 Tip: Rulează /learn:analyze pentru a captura lecțiile din sesiune\\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'",
|
||||||
|
"timeout": 5
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"PreCompact": [
|
"PreCompact": [
|
||||||
@@ -33,7 +37,7 @@ Verifică și instalează hooks-urile necesare pentru plugin-ul Learn în `~/.cl
|
|||||||
"hooks": [
|
"hooks": [
|
||||||
{
|
{
|
||||||
"type": "command",
|
"type": "command",
|
||||||
"command": "echo '\n⚠️ Context plin! Rulează /learn:analyze ACUM pentru a salva lecțiile înainte de compact!\n'",
|
"command": "echo '\\n⚠️ Context plin! Rulează /learn:analyze ACUM pentru a salva lecțiile înainte de compact!\\n'",
|
||||||
"timeout": 5
|
"timeout": 5
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -37,10 +37,12 @@ d = json.load(open('$SETTINGS_FILE'))
|
|||||||
hooks = d.get('hooks', {})
|
hooks = d.get('hooks', {})
|
||||||
session_end = hooks.get('SessionEnd', [])
|
session_end = hooks.get('SessionEnd', [])
|
||||||
for h in session_end:
|
for h in session_end:
|
||||||
cmd = h.get('command', '')
|
inner_hooks = h.get('hooks', [])
|
||||||
if 'learn:analyze' in cmd:
|
for ih in inner_hooks:
|
||||||
print('yes')
|
cmd = ih.get('command', '')
|
||||||
exit(0)
|
if 'learn:analyze' in cmd:
|
||||||
|
print('yes')
|
||||||
|
exit(0)
|
||||||
print('no')
|
print('no')
|
||||||
" 2>/dev/null)
|
" 2>/dev/null)
|
||||||
|
|
||||||
@@ -60,11 +62,15 @@ settings_file = os.path.expanduser("~/.claude/settings.json")
|
|||||||
with open(settings_file, 'r') as f:
|
with open(settings_file, 'r') as f:
|
||||||
settings = json.load(f)
|
settings = json.load(f)
|
||||||
|
|
||||||
# Define Learn hooks
|
# Define Learn hooks (format: hooks array inside)
|
||||||
learn_session_end = {
|
learn_session_end = {
|
||||||
"type": "command",
|
"hooks": [
|
||||||
"command": "echo '\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n💡 Tip: Rulează /learn:analyze pentru a captura lecțiile din sesiune\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'",
|
{
|
||||||
"timeout": 5
|
"type": "command",
|
||||||
|
"command": "echo '\\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\\n💡 Tip: Rulează /learn:analyze pentru a captura lecțiile din sesiune\\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'",
|
||||||
|
"timeout": 5
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
learn_pre_compact = {
|
learn_pre_compact = {
|
||||||
|
|||||||
Reference in New Issue
Block a user