Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fbbp/0ee8ea2024dac0a487761262bd37e13f to your computer and use it in GitHub Desktop.
Save fbbp/0ee8ea2024dac0a487761262bd37e13f to your computer and use it in GitHub Desktop.
該当プロジェクトで行なったClaude Codeの全セッション内容を振り返りレポートを.mdで出力するプロンプト

Extract Full Claude Code Project History

⚠️ PRIVACY WARNING: Do NOT include ANY sensitive information in the output:

  • Session IDs/hashes (e.g., "474f0d06-d2e9-41a2..." → "Session-1")
  • Usernames (e.g., "/Users/john/" → "/Users/[USER]/")
  • Exact file paths containing personal info
  • API keys, tokens, or credentials
  • Private repository names or company-specific terms

Analyze all session history for this project and create a comprehensive markdown summary.

Steps:

1. Find project directory

pwd  # Get current path
# Convert to Claude format: /path/to/project → -path-to-project

2. List all sessions

ls -lat ~/.claude/projects/[ESCAPED_PATH]/*.jsonl

3. For each JSONL file:

# Get date
stat -f "%Sm" -t "%Y-%m-%d" [FILE] || date -r [FILE] "+%Y-%m-%d"

# Extract key activities (grep for: created, updated, implemented, added, fixed, 作成, 実装, 追加, 修正, 更新)
cat [FILE] | jq -r 'select(.type=="user") | .message' | grep -E "content" | head -30

# Find created files
grep "File created" [FILE] | grep -oE "at: [^\"]*"

# Find errors
grep -i "error" [FILE] | grep -v "without" | head -5

4. Check git history if exists

git log --oneline --date=short --pretty=format:"%h %ad %s" | head -20

5. Check key files

ls -la README* *.py *.js requirements*.txt package*.json 2>/dev/null
find . -name "*stats*.json" -o -name "*.log" 2>/dev/null | head -10

6. Create summary markdown

Japanese Structure / 日本語版構成:

# [プロジェクト名] セッション履歴

## プロジェクト概要
[プロジェクト全期を通した説明]

## タイムライン
- **YYYY-MM-DD**: [その日のセッションでなにがあったのかの概要を詳細に書く]
- **YYYY-MM-DD**: [その日のセッションでなにがあったのかの概要を詳細に書く]
- **YYYY-MM-DD**: [その日のセッションでなにがあったのかの概要を詳細に書く]

## セッション詳細

### YYYY-MM-DD - セッション [Session-1] 
⚠️ Replace actual session hash with Session-1, Session-2, etc.
**実施内容:**
- [主要タスクのリスト]

**作成/更新ファイル:**
- [ファイルリスト - mask full paths]

**主な実装:**
- [機能/修正のリスト]

[各セッションについて同様に記載]

## プロジェクト統計
- 総セッション数: X
- 作成ファイル数: Y
- 使用技術: [リスト]

## 現在の状態
[現状、エラー、TODO項目]

Notes:

  • For large JSONLs use: tail -n 500 [FILE]
  • If jq fails, use: grep -o '"content":"[^"]*"' | sed 's/"content":"//'
  • CRITICAL: Mask ALL sensitive info:
    • Session hashes: "abc123-def456..." → "Session-1"
    • Usernames: "/Users/john/" → "/Users/[USER]/"
    • Company/project names → "[PROJECT]"
    • Any file paths with personal info
  • Focus on significant sessions if many exist
  • Before sharing, double-check NO real session IDs are visible

Execute this analysis and create project_history.md.

🔒 FINAL CHECK: Before outputting, ensure NO session hashes, usernames, or sensitive paths are visible!

Don't hold back. Give it your all. ultrathink.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment