This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
ChittyTrace is a comprehensive AI-powered financial forensics platform for analyzing documents, tracing fund flows, generating court-ready exhibits, and providing intelligent financial analysis capabilities. It integrates with Neon PostgreSQL databases and supports Cook County court filing requirements.
# Activate virtual environment
source venv/bin/activate # On Windows: venv\Scripts\activate
# Run the Streamlit GUI application
streamlit run app.py
# Start the API server for Claude/OpenAI extension
python claude_openai_extension.py
# Run tests (when implemented)
pytest tests/# Run linting
ruff check .
# Run type checking
mypy flow_analyzer/-
document_processor.py: Handles document scanning, text extraction, and caching
- Supports PDF, Excel, CSV, text files
- Implements intelligent caching system
- Extracts metadata and content
-
claude_integration.py: Claude API integration and analysis engine
- Vector store for semantic search using Chroma
- Complex command execution (fund tracing, timeline generation)
- Form filling and exhibit generation
-
recursive_scanner.py: Enhanced document discovery
- Recursively scans directories for all document types
- Integrates with Cloudflare Workers for email ingestion
- Handles archives and communication files
-
interactive_timeline.py: Timeline visualization system
- Creates interactive Plotly timelines
- Links timeline events to source documents
- Extracts events using Claude AI
-
package_generator.py: Cook County exhibit package generator
- Formats exhibits per Cook County requirements
- Generates cover sheets, affidavits, and indices
- Creates complete filing packages
-
database_handler.py: Neon PostgreSQL integration
- Vector search capabilities
- Cross-references with connected Neon database
- Stores documents, events, and analysis results
-
claude_openai_extension.py: API interface for AI assistants
- FastAPI-based REST API
- OpenAI function calling schema
- Claude tool use integration
-
app.py: Streamlit GUI application
- Six main tabs: Query, Package Creator, Form Filler, Commands, Visualizations, Browser
- Real-time document analysis
- Interactive visualizations
The system uses Neon PostgreSQL with the following key tables:
documents: Stores all scanned documents with embeddingstimeline_events: Financial events extracted from documentscourt_exhibits: Tracks exhibit preparationanalysis_queries: Query history and AI responsesexhibit_packages: Complete court filing packages
Important: The system can cross-reference with connected Neon databases for matching transactions, property records, and legal filings when a database is configured.
When generating exhibits, the system automatically applies:
- 8.5" x 11" page size with 1" margins
- Times New Roman or Arial 12pt font
- Double spacing
- Sequential exhibit numbering
- Exhibit stickers (bottom right)
- Required authentication affidavits
The system integrates with Cloudflare Workers to ingest emails from nick@chitty.cc. Configure via:
CLOUDFLARE_WORKER_URL: Worker endpointCLOUDFLARE_WORKER_TOKEN: Authentication token
Required in .env:
ANTHROPIC_API_KEY: Claude API accessDATABASE_URL: Neon database connection (optional)CLOUDFLARE_WORKER_URL: Email ingestion endpointAPI_TOKENS: Bearer tokens for API authentication
This system integrates with ChittyCorp's enterprise AI infrastructure:
- Website: chittycorp.com
- Support: support@chittycorp.com
- Email Ingestion: Cloudflare Workers with nick@chitty.cc routing