diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index c351e85..610fffc 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -11,7 +11,7 @@ "name": "learn", "source": "./plugins/learn", "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"] } ] diff --git a/plugins/learn/.claude-plugin/plugin.json b/plugins/learn/.claude-plugin/plugin.json index 8088147..44f4200 100644 --- a/plugins/learn/.claude-plugin/plugin.json +++ b/plugins/learn/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "learn", "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": { "name": "Romfast Team" } diff --git a/plugins/learn/commands/setup.md b/plugins/learn/commands/setup.md index 78b7c3e..cf512f7 100644 --- a/plugins/learn/commands/setup.md +++ b/plugins/learn/commands/setup.md @@ -22,9 +22,13 @@ Verifică și instalează hooks-urile necesare pentru plugin-ul Learn în `~/.cl "hooks": { "SessionEnd": [ { - "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 + } + ] } ], "PreCompact": [ @@ -33,7 +37,7 @@ Verifică și instalează hooks-urile necesare pentru plugin-ul Learn în `~/.cl "hooks": [ { "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 } ] diff --git a/plugins/learn/scripts/install-hooks.sh b/plugins/learn/scripts/install-hooks.sh index 2940a02..7ef75f0 100755 --- a/plugins/learn/scripts/install-hooks.sh +++ b/plugins/learn/scripts/install-hooks.sh @@ -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 = {