Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:57:23 +08:00
commit 8a3ade8edb
9 changed files with 181 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
{
"name": "claude-hook-advisor",
"description": "Intelligent command history tracking with automatic failure detection. Tracks all bash commands Claude runs (successful and failed) with semantic directory aliasing and command mapping.",
"version": "1.0.0",
"author": {
"name": "sirmews",
"url": "https://github.com/sirmews/claude-hook-advisor"
},
"commands": [
"./commands"
],
"hooks": [
"./hooks"
]
}

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# claude-hook-advisor
Intelligent command history tracking with automatic failure detection. Tracks all bash commands Claude runs (successful and failed) with semantic directory aliasing and command mapping.

View File

@@ -0,0 +1,13 @@
---
description: Show only failed bash commands from history
allowed-tools: Bash(claude-hook-advisor:*)
---
!claude-hook-advisor --history --failures --limit 20
The output above shows all commands that failed. Let me analyze these failures and:
1. Identify patterns in the errors
2. Suggest fixes for the failed commands
3. Explain why each command might have failed
What would you like me to help with regarding these failures?

View File

@@ -0,0 +1,10 @@
---
description: Search command history by pattern (usage: /history-search <pattern>)
allowed-tools: Bash(claude-hook-advisor:*)
---
!claude-hook-advisor --history --pattern "$ARGUMENTS" --limit 50
I've searched the command history for commands matching "$ARGUMENTS". The results above show all matching commands with their success/failure status.
Let me help you understand these results or find specific commands you're looking for.

View File

@@ -0,0 +1,13 @@
---
description: Show command history for a specific session (usage: /history-session <session-id>)
allowed-tools: Bash(claude-hook-advisor:*)
---
!claude-hook-advisor --history --session "$1" --limit 100
The output above shows all commands from session "$1". This includes:
- All commands attempted in this session
- Success and failure status for each
- Complete timeline of command execution
Let me analyze this session's activity and help you understand what happened.

13
commands/history.md Normal file
View File

@@ -0,0 +1,13 @@
---
description: Show recent bash command history (last 20 commands)
allowed-tools: Bash(claude-hook-advisor:*)
---
!claude-hook-advisor --history --limit 20
The command history above shows all recent bash commands I've executed. Each entry includes:
- ✓ for successful commands
- ✗ FAILED for commands that failed
- Timestamp, command, working directory, and session ID
Let me analyze this history and answer any questions you have about it.

13
commands/validate.md Normal file
View File

@@ -0,0 +1,13 @@
---
description: Validate claude-hook-advisor installation and configuration
allowed-tools: Bash(claude-hook-advisor:*)
---
!claude-hook-advisor --validate
The validation output above shows the health of your claude-hook-advisor installation:
✓ = Working correctly
✗ = Needs attention
Let me analyze any issues and suggest fixes.

36
hooks/hooks.json Normal file
View File

@@ -0,0 +1,36 @@
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "claude-hook-advisor --hook"
}
]
}
],
"PostToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "claude-hook-advisor --hook"
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "claude-hook-advisor --hook"
}
]
}
]
}
}

65
plugin.lock.json Normal file
View File

@@ -0,0 +1,65 @@
{
"$schema": "internal://schemas/plugin.lock.v1.json",
"pluginId": "gh:sirmews/claude-hook-advisor:plugin",
"normalized": {
"repo": null,
"ref": "refs/tags/v20251128.0",
"commit": "b5cb593d6570fb2e2fcb4d129888f59818bae84e",
"treeHash": "46341b7395d5aa8c0481310a78410a2e1276a53a86c38bd94653de1bd84ad0dd",
"generatedAt": "2025-11-28T10:28:21.965367Z",
"toolVersion": "publish_plugins.py@0.2.0"
},
"origin": {
"remote": "git@github.com:zhongweili/42plugin-data.git",
"branch": "master",
"commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390",
"repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data"
},
"manifest": {
"name": "claude-hook-advisor",
"description": "Intelligent command history tracking with automatic failure detection. Tracks all bash commands Claude runs (successful and failed) with semantic directory aliasing and command mapping.",
"version": "1.0.0"
},
"content": {
"files": [
{
"path": "README.md",
"sha256": "caf2494f66df9a3ee6e345fe95c2f6815dcf5c24730f56d03a652134326b735a"
},
{
"path": "hooks/hooks.json",
"sha256": "7179bc16f0d7c1ddbfacf6c728c448dddd2747cd4bf7d3e351f2057f6062f2d5"
},
{
"path": ".claude-plugin/plugin.json",
"sha256": "ca422c0e628d2c540fa2113b4ac7d7614a450c23e081aa0ade5c7cb0e1738d76"
},
{
"path": "commands/history-search.md",
"sha256": "dca120651661d9e87a8e1d983010d10e8327bb8cfea1f9233653ac6914ba15fb"
},
{
"path": "commands/history-failures.md",
"sha256": "cd917ef60e6fb51d974d3e8138003855682a4c908bd8bca30c1679efa8ff2fc2"
},
{
"path": "commands/validate.md",
"sha256": "35cffdb2430a605e1bfd89a40729a8a4eb0ed39a291c7fdfad3e2b1c2693e1f4"
},
{
"path": "commands/history.md",
"sha256": "589bada289d36cdaf2d46b1ddd6f48a50acd90276c9f2141d5efe43030ff58f2"
},
{
"path": "commands/history-session.md",
"sha256": "b030381fb26d407c233e8a6366ac6b9cb627e9fdc7ca3d44879acbb861188583"
}
],
"dirSha256": "46341b7395d5aa8c0481310a78410a2e1276a53a86c38bd94653de1bd84ad0dd"
},
"security": {
"scannedAt": null,
"scannerVersion": null,
"flags": []
}
}