diff
Generates LLM-optimized context for code changes by identifying modified files and expanding context to include related code.
Usage
infiniloom diff [REF] [OPTIONS]
Description
The diff command identifies and classifies code changes, providing context expansion at different depth levels. Supports various reference formats including unstaged changes, staged changes, commits, and branches.
Options
--staged
Use staged changes
--depth <LEVEL>
Context depth: 1-3 (default: 2)
--budget <TOKENS>
Token limit (default: 50,000)
-f, --format <FORMAT>
Output format: xml, markdown, json, yaml, toon, plain (default: xml)
-o, --output <PATH>
Output file path (default: stdout)
-m, --model <MODEL>
Target model for token counting (default: claude)
--include-diff
Include actual diff content (+/- lines)
--include-history
Include recent commit history for changed files
--history-count <N>
Number of recent commits to include per file (default: 3)
-i, --include <PATTERN>
Include only files matching glob pattern (repeatable)
-e, --exclude <PATTERN>
Exclude files/directories matching pattern (repeatable)
--include-tests
Include test files in context
-v, --verbose
Show detailed progress
Examples
# Unstaged changes context
infiniloom diff
# Staged changes context
infiniloom diff --staged
# Branch comparison
infiniloom diff main..feature
# With expanded context
infiniloom diff --depth 3 --include-diff