A tool for summarizing codebases using AI, part of a Continuous Context Sharing System.
Timewave Condenser takes XML representations of your codebase and leverages AI models (Claude or OpenAI) to generate comprehensive summaries. These summaries provide insights into your code's architecture, components, and relationships, making it easier to understand complex codebases.
For a deeper understanding of how this tool fits into the larger Continuous Context Update System, please see the System Overview document.
- Extracts summaries from codebases in both Markdown and XML formats
- Supports multiple AI providers (Claude and OpenAI)
- Configurable via TOML configuration files
- Area-specific prompts for different parts of a codebase
- Robust error handling with fallback summaries
- Detailed documentation and examples
This project uses Nix for reproducible development environments and CI/CD integration.
# Clone the repository
git clone https://github.com/timewave-computer/timewave-condenser.git
cd timewave-condenser
# Enter the Nix development shell
nix develop
The Nix development shell provides all dependencies needed for development and testing. The flake has been simplified to work optimally in both CI environments and for local development after cloning the repository.
The tool generates two output files:
-
Markdown Summary (
summary.md
): A comprehensive overview of your codebase, including:- The main purpose of the codebase
- Key components and their relationships
- Important functions and data structures
- Overall architecture and design patterns
- Notable algorithms or techniques used
-
XML Summary (
summary.xml
): A structured summary in XML format, including:- Project metadata (name, purpose, main languages)
- Component breakdown
- Key files and their purposes
- Dependencies
- Recommendations for improvements
# Using Node.js
node dist/summarize.js --input=/path/to/input.xml --output=/path/to/output/dir
# Using npm script
npm start -- --input=/path/to/input.xml --output=/path/to/output/dir
--input
,-i
: Path to the input XML file (required)--output
,-o
: Path to the output directory (required)--provider
,-p
: AI provider to use (claude
oropenai
, default:claude
)--config
,-c
: Path to TOML configuration file--area
,-a
: Area from TOML config to use for prompt--systemPrompt
: Custom system prompt--maxTokens
: Maximum tokens (default: 4000)--apiKey
: API key (can also use environment variable)--verbose
,-v
: Enable verbose logging
ANTHROPIC_API_KEY
: API key for ClaudeOPENAI_API_KEY
: API key for OpenAI
The AI summary feature requires access to either Claude or OpenAI's API services.
-
Create an Anthropic Account
- Visit Anthropic Console and sign up
- Complete verification steps as required
-
Generate an API Key
- Navigate to the "API Keys" section
- Click "Create API Key"
- Name your key (e.g., "Timewave Condenser")
- Set usage limits if desired
-
Use Your API Key
- Option 1: Environment variable (recommended):
export ANTHROPIC_API_KEY=your_api_key_here
- Option 2: Command line parameter:
node dist/summarize.js --input=input.xml --output=./output --apiKey="your_api_key_here"
- Option 1: Environment variable (recommended):
-
Create an OpenAI Account
- Visit OpenAI Platform and sign up
- Add a payment method
-
Generate an API Key
- Navigate to "API keys"
- Click "Create new secret key"
- Name your key
-
Use Your API Key
- Option 1: Environment variable (recommended):
export OPENAI_API_KEY=your_api_key_here
- Option 2: Command line parameter:
- Option 1: Environment variable (recommended):