{% extends "docs/base.html" %} {% block title %}Data Import Guide - Claude Code Project Tracker{% endblock %} {% block doc_content %}

Data Import Guide

Learn how to import your Claude Code usage history using the ~/.claude.json file.

What is .claude.json?

The ~/.claude.json file is automatically created by Claude Code and contains your usage history, including project paths, conversation summaries, and usage statistics.

Typical Location
macOS:
~/.claude.json
Linux:
~/.claude.json
Windows:
%USERPROFILE%\.claude.json

Import Methods

There are two ways to import your Claude Code data:

File Upload

Recommended method

  • Upload file directly through web interface
  • Works with any .claude.json file
  • Preview before importing
  • No server file system access needed

Best for most users

File Path

Server-side import

  • Specify path to .claude.json file
  • Uses default ~/.claude.json if no path given
  • Requires file system access
  • Good for server deployments

For advanced users

File Upload Step-by-Step

Find the .claude.json file on your system:

macOS/Linux
# Open terminal and check if file exists
ls -la ~/.claude.json

# Or use finder/file manager
open ~/.claude.json
Windows
# Open Command Prompt
dir %USERPROFILE%\.claude.json

# Or use File Explorer
explorer %USERPROFILE%
Tip: If the file doesn't exist, use Claude Code for a few sessions to generate usage data first.

Navigate to the data import page:

  1. Go to your Claude Code Tracker dashboard
  2. Click "Import Data" in the navigation menu
  3. Ensure the "Upload File" tab is selected (default)
Direct Link: Go to Import Page

Upload your .claude.json file:

  1. Click "Select .claude.json file" button
  2. Navigate to and select your .claude.json file
  3. File information will be displayed (name, size, modified date)
  4. The upload buttons will become enabled
File Validation
  • Must be a .json file
  • Maximum size: 10 MB
  • Must be UTF-8 encoded
  • Must contain valid JSON

Before importing, preview what data will be imported:

  1. Click "Preview Upload" button
  2. Review the import summary showing:
    • Number of projects to be imported
    • Total history entries
    • Claude usage statistics
    • Sample project paths
  3. Verify the data looks correct
Preview Benefits: Catch potential issues before importing and verify data integrity.

Complete the import process:

  1. Click "Import Upload" button (or "Looks good - Import this data" after preview)
  2. Confirm the import when prompted
  3. Wait for the import to complete
  4. Review the success summary showing imported counts
  5. Use the provided links to view your data
Import Results

After successful import, you'll see:

  • Number of projects imported
  • Number of estimated sessions created
  • Number of conversations imported
  • Any warnings or errors encountered

What Gets Imported

Projects
  • Project directory paths
  • Automatically detected programming languages
  • Project names (derived from directory names)
  • Creation timestamps (estimated)
Usage Statistics
  • Total Claude Code startup count
  • First usage timestamp
  • Prompt queue usage statistics
  • Estimated session distribution over time
Conversations
  • Conversation topic summaries from project history
  • Estimated timestamps
  • Association with imported projects
  • Import metadata for tracking
Sessions
  • Estimated sessions based on startup count
  • Distributed over your usage period
  • Random but realistic session durations
  • Associated activity and conversation counts

Data Privacy & Security

Your Data Stays Local
  • All data is processed and stored locally on your server
  • No external services are contacted during import
  • Upload is handled securely over HTTPS
  • Files are processed in memory and not stored on disk
  • Only the structured data is saved to your database
File Security
  • 10 MB upload size limit
  • JSON format validation
  • UTF-8 encoding requirement
  • No executable code processing
Data Handling
  • Files processed in memory only
  • No temporary file creation
  • Immediate cleanup after processing
  • Error handling for malformed data

Troubleshooting

Cause: The selected file doesn't have a .json extension.

Solution:

  • Ensure you're selecting the correct .claude.json file
  • Check the file extension is exactly ".json"
  • On some systems, file extensions might be hidden
  • Try copying the file and renaming it to ensure .json extension

Cause: The .claude.json file is larger than 10 MB.

Solutions:

  • Use the "File Path" import method instead
  • Contact your administrator to increase upload limits
  • Try importing a newer, smaller version of the file
  • Clean up the .claude.json file by backing up old data

Cause: The file contains malformed JSON data.

Solutions:

  • Check if the file was corrupted during transfer
  • Try re-generating the file by using Claude Code again
  • Use a JSON validator to check the file structure
  • Ensure the file wasn't partially downloaded

Possible causes and solutions:

  • Empty file: The .claude.json file might be empty or contain no project data
  • Duplicate import: Data might already exist and wasn't imported again (this is normal)
  • Filtering: Check if any filters are applied in the project view
  • Refresh: Try refreshing the page or clicking the "Refresh" button
  • Check import results: Review the import summary for any warnings or errors

Advanced Topics

Multiple Imports

The import system prevents duplicates:

  • Projects are identified by path
  • Duplicate projects won't be re-created
  • Safe to import multiple times
  • New data will be added to existing projects
Data Estimation

Since .claude.json has limited data:

  • Session times are estimated
  • Durations are randomized realistically
  • Activity counts are approximated
  • Language detection uses file system
Quick Start
  1. Find your ~/.claude.json file
  2. Go to Import Page
  3. Click "Select .claude.json file"
  4. Choose your file
  5. Click "Preview Upload"
  6. Click "Import Upload"
Pro Tip: Always preview before importing to catch any issues early.
Need Help?
{% endblock %}