# oracle
> Bundle code and prompts for AI analysis with multi-model support

## Summary
Bundles code files with prompts and sends them to AI models (GPT-5, Gemini, Claude) for analysis, code review, or documentation. Supports API and browser modes, multi-model comparisons, and session persistence.

## Capabilities
- Bundle source files with prompts for AI-assisted code analysis
- Multi-model comparison: run the same query across GPT-5, Gemini, Claude, and others
- API mode with automatic provider detection from environment variables
- Browser mode using Chrome cookies from signed-in ChatGPT or Gemini sessions
- Token budgeting with per-file usage reports
- Session management: save, replay, and resume interrupted queries
- Async handling for long-running GPT-5 Pro queries with reattach support
- Dry-run mode to preview bundles without sending
- Copy assembled bundle to clipboard for manual paste workflows
- MCP server mode via oracle-mcp for integration with AI coding assistants

## When to Use
- Getting AI-powered code review or analysis with full file context
- Comparing how different AI models answer the same question about your code
- Sending large codebases to AI models with proper token budgeting
- Working without API keys by using browser-based AI sessions
- Persisting AI query sessions for later review or continuation

## When NOT to Use
- Simple questions that do not require file context
- Real-time interactive coding assistance (use an IDE copilot instead)
- Processing sensitive code that should not be sent to cloud AI providers

## Usage Patterns
### Review code with API
```
oracle -p "Review this code for bugs" --file src/app.ts
```
Sends the file with the prompt to the default AI model for review

### Multi-model comparison
```
oracle -p "Analyze architecture" --models gpt-5.1-pro,gemini-3-pro --file "src/**/*.ts"
```
Runs the same query against multiple models and compares responses

### Dry run to preview
```
oracle --dry-run summary -p "Explain this" --file src/
```
Previews the bundle summary without sending it to any provider

### Copy bundle to clipboard
```
oracle --render --copy -p "Analyze this" --file docs/
```
Assembles the bundle and copies it to clipboard for manual pasting

### Check session status
```
oracle status --hours 72
```
Lists all oracle sessions from the last 72 hours

## Input / Output
- **stdin**: Not typically used
- **stdout**: AI model responses, session summaries, bundle previews
- **stderr**: Progress and status messages

## Installation
- **npm**: `npm install -g @steipete/oracle`
- **homebrew**: `brew install steipete/tap/oracle`
- **npx**: `npx -y @steipete/oracle`

## Related Tools
- [summarize](/tools/summarize) (complementary): Summarize handles URL/media content; Oracle handles code file bundles

---
Source: https://littlescripts.sh/tools/oracle
