Files
JiangCheng 1d1df9235b feat(i18n): Add Japanese (ja/) translation (#105)
- Translate all 101 markdown files: P1 core, all 10 modules, examples,
  auxiliary docs (CONTRIBUTING, CODE_OF_CONDUCT, SECURITY, CLAUDE.md, etc.),
  peripheral docs (.github/, docs/, resources/, scripts/)
- Translate comments and user-facing messages in 06-hooks/*.sh examples
- Copy 05-mcp/*.json examples (standard JSON, no comments)
- Update root README.md language switcher to include 日本語
- Add ja/TRANSLATION_NOTES.md (glossary + style guide)

All translations pass pre-commit quality gates (markdown-lint,
cross-references, mermaid-syntax, link-check, build-epub).
2026-04-30 00:16:46 +02:00

32 lines
1.1 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# すべての bash コマンドを記録する
# フック:PostToolUse:Bash
#
# 標準入力の JSON から実行コマンドを読み取り、ファイルに記録する。
#
# 対応:macOS、Linux、WindowsGit 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