Data & AI
delete-claude-code-history - Claude MCP Skill
Clear accumulated chat history from Claude Code's .claude.json configuration file to reduce file size and improve performance
SEO Guide: Enhance your AI agent with the delete-claude-code-history tool. This Model Context Protocol (MCP) server allows Claude Desktop and other LLMs to clear accumulated chat history from claude code's .claude.json configuration file to reduce file siz... Download and configure this skill to unlock new capabilities for your AI workflow.
Documentation
SKILL.md# Delete Claude Code History
When this command is used, execute the bash script to clear all project history from Claude Code's configuration file while preserving all other settings.
---
<instruction>
Clear the accumulated chat history from Claude Code's .claude.json configuration file to reduce file size and improve performance. This removes only the "history" arrays from each project while preserving all other configuration and settings.
</instruction>
<context>
Claude Code stores chat history for every project in ~/.claude.json. Over time, this file grows significantly large as it accumulates history for all projects. The file structure contains a "projects" key at root level with project paths as keys, each containing an object with a "history" array that needs to be cleared periodically.
</context>
<script>
```bash
#!/bin/bash
# Clear Claude Code history from .claude.json
CLAUDE_CONFIG="$HOME/.claude.json"
# Check if file exists
if [ ! -f "$CLAUDE_CONFIG" ]; then
echo "ā Claude Code config not found at: $CLAUDE_CONFIG"
exit 1
fi
# Create backup
BACKUP_FILE="${CLAUDE_CONFIG}.backup.$(date +%Y%m%d_%H%M%S)"
cp "$CLAUDE_CONFIG" "$BACKUP_FILE"
echo "ā
Created backup: $BACKUP_FILE"
# Clear history for all projects using jq
if command -v jq &> /dev/null; then
# Use jq to clear history arrays
jq '.projects |= with_entries(.value.history = [])' "$CLAUDE_CONFIG" > "${CLAUDE_CONFIG}.tmp" && \
mv "${CLAUDE_CONFIG}.tmp" "$CLAUDE_CONFIG"
# Count cleared projects
PROJECT_COUNT=$(jq '.projects | keys | length' "$CLAUDE_CONFIG")
# Calculate size reduction
ORIGINAL_SIZE=$(stat -f%z "$BACKUP_FILE" 2>/dev/null || stat -c%s "$BACKUP_FILE" 2>/dev/null)
NEW_SIZE=$(stat -f%z "$CLAUDE_CONFIG" 2>/dev/null || stat -c%s "$CLAUDE_CONFIG" 2>/dev/null)
SIZE_REDUCTION=$((ORIGINAL_SIZE - NEW_SIZE))
SIZE_REDUCTION_MB=$(echo "scale=2; $SIZE_REDUCTION / 1048576" | bc)
echo "ā
Cleared history for $PROJECT_COUNT projects"
echo "š File size reduced by ${SIZE_REDUCTION_MB}MB ($(echo "scale=1; $SIZE_REDUCTION * 100 / $ORIGINAL_SIZE" | bc)%)"
echo "š Original: $(echo "scale=2; $ORIGINAL_SIZE / 1048576" | bc)MB ā New: $(echo "scale=2; $NEW_SIZE / 1048576" | bc)MB"
else
echo "ā jq is required but not installed. Install with: brew install jq (macOS) or apt-get install jq (Linux)"
exit 1
fi
echo "⨠Claude Code history cleared successfully!"
```
</script>
<constraints>
- Must preserve all non-history configuration data
- Must create a timestamped backup before modification
- Must use atomic file operations to prevent corruption
- Must handle both macOS and Linux file systems
- Requires jq for safe JSON manipulation
</constraints>
<output_format>
Execute the bash script and report:
1. Number of projects processed
2. File size reduction achieved
3. Backup file location
4. Confirmation of successful completion
</output_format>
<usage>
Run this command when:
- Claude Code feels sluggish due to large config file
- Starting fresh conversations while preserving settings
- Regular maintenance (monthly recommended)
- Before sharing or debugging configuration issues
</usage>
<example>
User: /plx:clear-claude-code-history
Assistant: I'll clear the accumulated chat history from your Claude Code configuration.
[Executes script]
ā
Created backup: /Users/username/.claude.json.backup.20240109_143022
ā
Cleared history for 48 projects
š File size reduced by 15.3MB (87%)
š Original: 17.5MB ā New: 2.2MB
⨠Claude Code history cleared successfully!
Your Claude Code history has been cleared while preserving all settings. A backup was saved in case you need to restore any conversation history.
</example>Signals
Information
- Repository
- appboypov/pew-pew-plaza-packs
- Author
- appboypov
- Last Sync
- 11/3/2026
- Repo Updated
- 10/9/2026
- Created
- 1/16/2026
Reviews (0)
No reviews yet. Be the first to review this skill!
Related Skills
CLAUDE
Claude-Mem: AI Development Instructions
firecrawl-build-onboarding
Get Firecrawl credentials and SDK setup into a project. Use when an application needs `FIRECRAWL_API_KEY`, when an agent should add Firecrawl to `.env`, when the user wants to authenticate Firecrawl for app code, or when choosing the first SDK and docs for a new Firecrawl integration. This skill includes its own browser auth flow, so it does not depend on the website onboarding skill.
firecrawl-build
Integrate Firecrawl into application code whenever a product, agent, or workflow needs web data inside the app ā web search, live search results, page scraping, structured extraction, or browser interaction. Use when building any feature that needs data from the web in code, even if the user does not mention Firecrawl explicitly and only describes wanting web data, website content, search, scraping, or interaction in an application. Trigger for Firecrawl requests, "fire girl" shorthand, and generic app-level web-data needs that should map to `/scrape`, `/search`, or `/interact`. Do not use this skill for one-off terminal-only web tasks during the current session; use `firecrawl/cli` for those.
firecrawl-build-scrape
Integrate Firecrawl `/scrape` into product code for single-page extraction. Use when an app already has a URL and needs markdown, HTML, links, screenshots, metadata, or structured page output. Prefer this skill over broader crawl patterns when the feature is page-level.
Related Guides
Mastering the Oracle CLI: A Complete Guide to the Claude Skill for Database Professionals
Learn how to use the oracle Claude skill. Complete guide with installation instructions and examples.
Python Django Best Practices: A Comprehensive Guide to the Claude Skill
Learn how to use the python django best practices Claude skill. Complete guide with installation instructions and examples.
Building Full-Stack Applications with Claude: The Node.js MongoDB JWT Express React Skill Guide
Learn how to use the nodejs mongodb jwt express react Claude skill. Complete guide with installation instructions and examples.