Gemini history analyzer

From daymade/claude-code-skills · View interactive version

Gemini history analyzer is an AI agent skill from the GitHub repository daymade/claude-code-skills. Analyze Google Takeout exports of Gemini conversation history. Use when the user mentions Gemini takeout, Gemini export, Gemini history, Gemini conversation analysis, Google Takeout zip analysis, or drags a takeout zip into the project. Also use when the user asks to "analyze my Gemini data", "what

How to use this skill

Skill file

Gemini History Analyzer

Extract, categorize, and analyze Google Takeout ZIP exports of Gemini Apps activity. The skill handles:

Quick Judgment: Meeting Transcripts vs Prompt-Response

Before full analysis, sample 3-5 files to determine the conversation type:

| Signal | Meeting Transcript | Prompt-Response |

|--------|-------------------|-----------------|

| Speaker labels | "张三:"、"李四:"、"Speaker 1:" | "User:"、"Assistant:"、"You:" |

| Content pattern | Discussion flow, turn-taking, small talk | Q&A, instruction→output |

| Length distribution | Variable, lots of short turns | Longer assistant responses |

| File naming | Often Chinese, meeting-style titles | English, topic-based titles |

The analysis approach differs:

Step 1: Extract the ZIP

Google Takeout files contain Chinese/Unicode filenames. macOS unzip corrupts these — always use unar.

# Install unar if missing
brew install unar 2>/dev/null || true

# Extract to a target directory
unar -o <output-dir> -q "<takeout-zip-path>"

The standard structure:

Takeout/
└── My Activity/
    └── Gemini Apps/
        ├── *.txt          # Conversation transcripts
        ├── *.html         # Web-format backups (rare)
        ├── *.png/jpg      # Images from conversations
        ├── *.mp3/mp4/wav  # Audio/video attachments
        ├── *.pdf          # Uploaded/shared documents
        ├── *.xlsx/docx    # Office documents
        └── *.zip          # Nested archives (animation frames, etc.)

Step 2: Inventory and Categorize

Run a full inventory before reading any single file:

# Count by extension
find <extract-dir> -type f | sed 's/.*\.//' | sort | uniq -c | sort -rn

# List all txt files (these are the primary content)
find <extract-dir> -name "*.txt" -type f | sort

# Get total size per type
find <extract-dir> -type f -exec du -sh {} \; | sort -rh | head -30

Build a table of:

Step 3: Sample and Classify

Read 3-5 txt files spread across the file list (not just the first few — timestamps/file sizes may cluster by type). For each:

  1. Read the first ~100 lines to determine conversation type
  2. Identify language (Chinese/English/mixed)
  3. Classify topic area at a high level
  4. Note speaker count and pattern

Use this sample to decide the analysis strategy for the remaining files.

Step 4: Full Content Analysis

For each txt file, read and extract:

4a. Metadata

4b. Topic Classification

Assign primary + secondary topics. Default categories (adjust based on actual content):

4c. Key Findings Per File

For each file, capture:

Step 5: Domain-Specific Keyword Search

When looking for content in a specific domain (finance, legal, etc.):

  1. Design keyword list with AND/OR logic — e.g., finance: stock OR investment OR fund OR portfolio OR 股票 OR 投资 OR 基金, but also domain-specific terms like EPS, P/E, dividend, arbitrage
  2. Grep every txt file for each keyword batch
  3. Read surrounding context (10 lines before/after each match) — keyword matching alone produces massive false positives. "Investment" can mean business strategy, "option" can mean UI choice, "fund" can mean insurance feature
  4. Classify each match as:
  1. Re-read full files for definite + ambiguous hits

Never stop at grep output — context verification is mandatory.

Step 6: Generate Report

Report Structure

# Gemini History Analysis Report
**Source**: <zip filename>
**Date analyzed**: <today>
**Extraction size**: <N files, N MB>

## 1. Content Overview
- Total conversations: N
- Conversation type: [Meeting Transcripts | Prompt-Response | Mixed]
- Language distribution: X% Chinese, Y% English, Z% Mixed
- Date range: <earliest> to <latest>
- Media attachments: N images, N audio, N video

## 2. Topic Distribution
| Category | Count | % | Notes |
|----------|-------|---|-------|
| ... | | | |

## 3. Key Findings
(Bulleted, organized by significance)

## 4. Domain-Specific Analysis
(If user requested finance/legal/etc. keyword search)
- Matches found: N
- Confirmed relevant: N
- False positives: N (with examples of what caused them)

## 5. Notable Documents
Non-txt files worth attention: PDFs, spreadsheets, etc.

## 6. Valuable Quotes
Verbatim quotes that capture key insights

## 7. PII / Sensitive Content
(Flag if detected — do NOT include the actual PII in the report)
- File: <name>, Type: <resume/background-check/etc.>, Risk: <high/medium/low>

Step 7: Memory File Generation (Optional)

If the user wants to persist findings as project memory (like .claude/projects/<path>/memory/):

When to generate memory files

Memory file types to offer

  1. User profile (user-profile.md) — if conversations reveal user's role, preferences, personality
  2. Feedback/Workflow (feedback-*.md) — if conversations reveal proven workflows, dos/don'ts
  3. Project context (project-*.md) — if conversations reveal ongoing projects, decisions, constraints

Memory writing protocol

Step 8: Cleanup

# Remove extracted files after analysis complete (user confirms)
rm -rf <extract-dir>

Critical Pitfalls (From Real Usage)

1. ZIP extraction: ALWAYS use `unar`

macOS unzip silently corrupts Chinese filenames — files become garbled paths, many fail to extract. brew install unar + unar -o <dir> <zip> handles everything correctly.

2. Keyword search: grep is step 1, not the answer

Keyword matching on "stock", "investment", "fund", "option", "portfolio", "trading" produced matches in 80%+ of files in a real analysis — every single one was a false positive. These words appear in software development contexts constantly. Always read surrounding context for every match.

3. Know what you're reading

Gemini Takeout txt files are NOT the original Gemini prompt-response pairs. They can be:

Read the first ~100 lines of each file before assuming its nature.

4. PII is likely present

Resumes, background check forms, contact lists — these routinely appear in conversation history. Flag them, do NOT include their contents in reports. If creating memory files or wiki pages, ensure PII is summarized, not copied.

5. Large files need triage

A 63KB transcript is a 2-hour meeting. Don't read the whole thing unless it's flagged as highly relevant. Read the first 10% + last 10% for gist; read fully only if keyword hits or topic relevance warrant it.

6. Parallel reads for scale

For 100+ files, spawn parallel sub-agents to read and summarize in batches (10-15 files each). Merge results. One agent reading all files sequentially will exhaust context.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.