Files
claudetools/scripts
Mike Swanson 06f7617718 feat: Major directory reorganization and cleanup
Reorganized project structure for better maintainability and reduced
disk usage by 95.9% (11 GB -> 451 MB).

Directory Reorganization (85% reduction in root files):
- Created docs/ with subdirectories (deployment, testing, database, etc.)
- Created infrastructure/vpn-configs/ for VPN scripts
- Moved 90+ files from root to organized locations
- Archived obsolete documentation (context system, offline mode, zombie debugging)
- Moved all test files to tests/ directory
- Root directory: 119 files -> 18 files

Disk Cleanup (10.55 GB recovered):
- Deleted Rust build artifacts: 9.6 GB (target/ directories)
- Deleted Python virtual environments: 161 MB (venv/ directories)
- Deleted Python cache: 50 KB (__pycache__/)

New Structure:
- docs/ - All documentation organized by category
- docs/archives/ - Obsolete but preserved documentation
- infrastructure/ - VPN configs and SSH setup
- tests/ - All test files consolidated
- logs/ - Ready for future logs

Benefits:
- Cleaner root directory (18 vs 119 files)
- Logical organization of documentation
- 95.9% disk space reduction
- Faster navigation and discovery
- Better portability (build artifacts excluded)

Build artifacts can be regenerated:
- Rust: cargo build --release (5-15 min per project)
- Python: pip install -r requirements.txt (2-3 min)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-18 20:42:28 -07:00
..

ClaudeTools Scripts

Utility scripts for managing the ClaudeTools system.


Core Scripts

Context Recall System

setup-context-recall.sh

  • One-time setup for context recall system
  • Configures JWT authentication
  • Tests API connectivity

test-context-recall.sh

  • Verify context recall system functionality
  • Test API endpoints
  • Check compression

Conversation Import & Archive

import-conversations.py

  • Import conversation JSONL files to database
  • Extract and compress conversation context
  • Tag extraction and categorization
  • Optional tombstone creation with --create-tombstones

archive-imported-conversations.py

  • Archive imported conversation files
  • Create tombstone markers
  • Move files to archived/ subdirectories
  • Database verification (optional)

check-tombstones.py

  • Verify tombstone integrity
  • Validate JSON structure
  • Check archived files exist
  • Database context verification

TOMBSTONE_QUICK_START.md

  • Quick reference for tombstone system
  • Common commands
  • Troubleshooting tips

Database & Testing

test_db_connection.py

  • Test database connectivity
  • Verify credentials
  • Check table access

test-server.sh

  • Start development server
  • Run basic API tests

MCP Servers

setup-mcp-servers.sh

  • Configure Model Context Protocol servers
  • Setup GitHub, Filesystem, Sequential Thinking

Tombstone System (NEW)

Archive imported conversation files with small marker files.

Quick Start

# Archive all imported files
python scripts/archive-imported-conversations.py --skip-verification

# Verify tombstones
python scripts/check-tombstones.py

# Check space savings
du -sh imported-conversations/

Documentation

  • TOMBSTONE_QUICK_START.md - Quick reference
  • ../TOMBSTONE_SYSTEM.md - Complete documentation
  • ../TOMBSTONE_IMPLEMENTATION_SUMMARY.md - Implementation details

Expected Results

  • 549 tombstone files (~1 MB)
  • 549 archived files in subdirectories
  • 99%+ space reduction in active directory

Usage Patterns

Initial Setup

# 1. Setup context recall
bash scripts/setup-context-recall.sh

# 2. Setup MCP servers (optional)
bash scripts/setup-mcp-servers.sh

# 3. Test database connection
python scripts/test_db_connection.py

Import Conversations

# Import with automatic tombstones
python scripts/import-conversations.py --create-tombstones

# Or import first, archive later
python scripts/import-conversations.py
python scripts/archive-imported-conversations.py --skip-verification

Verify System

# Test context recall
bash scripts/test-context-recall.sh

# Check tombstones
python scripts/check-tombstones.py

# Test API
bash scripts/test-server.sh

Script Categories

Setup & Configuration

  • setup-context-recall.sh
  • setup-mcp-servers.sh

Import & Archive

  • import-conversations.py
  • archive-imported-conversations.py
  • check-tombstones.py

Testing & Verification

  • test_db_connection.py
  • test-context-recall.sh
  • test-server.sh
  • test-tombstone-system.sh

Utilities

  • Various helper scripts

Common Commands

# Start API server
uvicorn api.main:app --reload

# Import conversations
python scripts/import-conversations.py

# Archive files
python scripts/archive-imported-conversations.py --skip-verification

# Check system health
python scripts/check-tombstones.py
bash scripts/test-context-recall.sh

# Database connection test
python scripts/test_db_connection.py

Requirements

Most scripts require:

  • Python 3.8+
  • Virtual environment activated (api\venv\Scripts\activate)
  • .env file configured (see .env.example)
  • Database access (172.16.3.30:3306)

Environment Variables

Scripts use these from .env:

DATABASE_URL=mysql+pymysql://user:pass@172.16.3.30:3306/claudetools
JWT_TOKEN=your-jwt-token-here
API_USER_EMAIL=user@example.com
API_USER_PASSWORD=your-password

Documentation

  • TOMBSTONE_QUICK_START.md - Tombstone system quick start
  • ../TOMBSTONE_SYSTEM.md - Complete tombstone documentation
  • ../.claude/CONTEXT_RECALL_QUICK_START.md - Context recall guide
  • ../CONTEXT_RECALL_SETUP.md - Full setup instructions

Last Updated: 2026-01-18 Version: 1.0