mirror of
https://github.com/luongnv89/claude-howto.git
synced 2026-08-08 00:08:36 +02:00
Internal accuracy pass against v2.1.220 — no missing upstream features, but broken example code, disagreeing counts, and metadata drift.
Functional fixes: pre-commit.sh now exits 2 so it actually blocks; dependency-check.sh reads file_path from stdin JSON instead of $1; database-mcp.json uses ${DATABASE_URL}; broken fences repaired; three command templates had invalid skill names.
Factual corrections: /fork and /subtask unswapped and /subtask added; /fewer-permission-prompts; permissions.defaultMode; dontAsk/auto unreversed; 31 hook events verified name-by-name; subagent depth 3; skill precedence enterprise > project > personal; /output-style removed not deprecated; permissionDecision gained defer.
Follow-up review fixed defects the pass left behind: zh/vi headers claiming 31 events above 25-name lists, a surviving hardcoded DB credential in the MCP README examples, an unbalanced fence swallowing a metadata footer, and non-canonical tool names. All four translated CATALOG summary tables were recounted so their arithmetic holds.
Full detail in CHANGELOG.md under v2.1.220-r2.
32 lines
1.1 KiB
Bash
32 lines
1.1 KiB
Bash
#!/bin/bash
|
||
# すべての bash コマンドを記録する
|
||
# フック:PostToolUse(matcher: Bash)
|
||
#
|
||
# 標準入力の JSON から実行コマンドを読み取り、ファイルに記録する。
|
||
#
|
||
# 対応:macOS、Linux、Windows(Git Bash)
|
||
|
||
# Claude Code フックプロトコルに従い、標準入力から JSON を読み取る
|
||
INPUT=$(cat)
|
||
|
||
# tool_input から bash コマンドを抽出
|
||
# 注:sed の [^"]* は JSON 内のエスケープされた引用符で停止する。ダブルクォートを
|
||
# 含むコマンドの場合、最初の \" までしかキャプチャできない。これは sed ベースの
|
||
# JSON パースの既知の制約だが、ロギング用途としては許容範囲。
|
||
COMMAND=$(echo "$INPUT" | sed -n 's/.*"command"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' | head -1)
|
||
|
||
if [ -z "$COMMAND" ]; then
|
||
exit 0
|
||
fi
|
||
|
||
TIMESTAMP=$(date "+%Y-%m-%d %H:%M:%S")
|
||
LOGFILE="$HOME/.claude/bash-commands.log"
|
||
|
||
# ログディレクトリが無ければ作成
|
||
mkdir -p "$(dirname "$LOGFILE")"
|
||
|
||
# コマンドを記録
|
||
echo "[$TIMESTAMP] $COMMAND" >> "$LOGFILE"
|
||
|
||
exit 0
|