Overview
Thehistory.jsonl file is a line-delimited JSON log containing every prompt you’ve sent to Claude Code. Each line is a separate JSON object representing one history entry with the prompt text, timestamp, and project context.
File Location
File Format
JSONL (JSON Lines): Each line is a valid JSON object. Lines are separated by newline characters (\n).
JSONL format allows for efficient append-only writes and streaming reads. Each line can be parsed independently.
Data Structure
HistoryEntry Interface
The prompt text that was sent to Claude. This is the user’s message content.
Metadata about any content that was pasted or attached to the prompt. Typically an empty object
{} for simple text prompts.Unix timestamp in milliseconds when the prompt was sent
Project identifier (typically the project directory name or ID)
Loading Function
Fromsrc/lib/load-data.ts:
- Reads the entire file as a string
- Trims whitespace and splits on newlines
- Parses each line as JSON
- Filters out any lines that failed to parse
- Returns an empty array if the file doesn’t exist
Invalid lines are silently skipped. This prevents corruption in one entry from breaking the entire history.
Usage in Export Script
Fromscripts/export.mjs:
- Reads and parses the JSONL file line by line
- Counts the total number of entries
- Logs success with entry count or failure if file is missing
- Includes the full history array in the export bundle
Example Entries
Use Cases
Prompt History Search
The Prompt History component enables:- Full-text search across all prompts
- Filter by project
- Copy prompts to clipboard
- View chronologically or by project
Pattern Analysis
Analyze your prompting patterns:- Most common request types
- Average prompt length
- Time gaps between prompts
- Project-specific prompting styles
Debugging Sessions
Cross-reference prompts with session metadata:Data Export
Export to other formats:File Growth
The history file grows continuously as you use Claude Code. A typical entry is ~100-500 bytes depending on prompt length. Estimated growth:- 10 prompts/day × 200 bytes = 2 KB/day
- 1 year = ~730 KB
- 5 years = ~3.6 MB
Privacy Considerations
Related Data Sources
- session-meta - Session-level metadata
- stats-cache - Aggregated statistics
- project-memory - Project-specific memory files