| name | review-claudemd |
|---|---|
| description | 최근 대화를 분석하여 CLAUDE.md 파일 개선점을 찾습니다. |
최근 대화를 분석하여 글로벌(~/.claude/CLAUDE.md) 및 로컬(프로젝트) CLAUDE.md 파일을 개선합니다.
프로젝트의 대화 기록은 ~/.claude/projects/에 있습니다. 폴더 이름은 프로젝트 경로에서 슬래시를 대시로 바꾼 형태입니다.
# 프로젝트 폴더 찾기 (/ 를 - 로 변환)
PROJECT_PATH=$(pwd | sed 's|/|-|g' | sed 's|^-||')
CONVO_DIR=~/.claude/projects/-${PROJECT_PATH}
ls -lt "$CONVO_DIR"/*.jsonl | head -20가장 최근 대화 15-20개(현재 대화 제외)를 임시 디렉토리에 추출합니다:
SCRATCH=/tmp/claudemd-review-$(date +%s)
mkdir -p "$SCRATCH"
for f in $(ls -t "$CONVO_DIR"/*.jsonl | head -20); do
basename=$(basename "$f" .jsonl)
# Skip current conversation if known
cat "$f" | jq -r '
if .type == "user" then
"USER: " + (.message.content // "")
elif .type == "assistant" then
"ASSISTANT: " + ((.message.content // []) | map(select(.type == "text") | .text) | join("\n"))
else
empty
end
' 2>/dev/null | grep -v "^ASSISTANT: $" > "$SCRATCH/${basename}.txt"
done
ls -lhS "$SCRATCH"병렬로 Sonnet 서브에이전트를 실행하여 대화를 분석합니다. 각 에이전트는 다음을 읽어야 합니다:
- 글로벌 CLAUDE.md:
~/.claude/CLAUDE.md - 로컬 CLAUDE.md:
./CLAUDE.md(존재하는 경우) - 대화 파일 묶음
각 에이전트에 아래 프롬프트 템플릿을 제공합니다:
Read:
1. Global CLAUDE.md: ~/.claude/CLAUDE.md
2. Local CLAUDE.md: [project]/CLAUDE.md
3. Conversations: [list of files]
Analyze the conversations against BOTH CLAUDE.md files. Find:
1. Instructions that exist but were violated (need reinforcement or rewording)
2. Patterns that should be added to LOCAL CLAUDE.md (project-specific)
3. Patterns that should be added to GLOBAL CLAUDE.md (applies everywhere)
4. Anything in either file that seems outdated or unnecessary
Be specific. Output bullet points only.
대화를 크기별로 나눠서 배치합니다:
- 대용량 (>100KB): 에이전트당 1-2개
- 중간 (10-100KB): 에이전트당 3-5개
- 소용량 (<10KB): 에이전트당 5-10개
모든 에이전트의 결과를 다음 섹션으로 정리합니다:
- 위반된 지침 - 지켜지지 않은 기존 규칙 (더 강한 표현 필요)
- 추가 제안 - 로컬 - 프로젝트별 패턴
- 추가 제안 - 글로벌 - 모든 프로젝트에 적용되는 패턴
- 오래된 항목 - 더 이상 관련 없을 수 있는 항목
표 또는 글머리 기호로 제시합니다. 사용자에게 수정 초안 작성 여부를 확인합니다.