Image Analysis
CCS automatically analyzes images and PDFs via CLIProxy vision models before Claude processes them. This prevents context overflow and provides structured text descriptions instead of raw visual data.Overview
When Claude’s Read tool targets an image or PDF file, CCS intercepts the request and:- Sends file to CLIProxy vision API
- Vision model analyzes and returns text description
- Claude receives description instead of raw image data
- Images:
.jpg,.jpeg,.png,.gif,.webp,.heic,.bmp,.tiff - Documents:
.pdf
Quick Start
Image analysis is enabled by default for all CLIProxy providers.Configuration
Enable/Disable
Timeout Settings
Default timeout is 60 seconds. Adjust for complex documents:Provider Models
Each provider can use a different vision model:| Provider | Default Model |
|---|---|
agy | gemini-2.5-flash |
gemini | gemini-2.5-flash |
codex | gpt-5.1-codex-mini |
kiro | kiro-claude-haiku-4-5 |
ghcp | claude-haiku-4.5 |
claude | claude-haiku-4-5-20251001 |
Provider Support
Enabled Providers
Image analysis works with all CLIProxy OAuth providers:- Antigravity (
agy) - Gemini (
gemini) - Codex (
codex) - Kiro (
kiro) - GitHub Copilot (
ghcp) - Qwen (
qwen) - iFlow (
iflow)
Skipped Providers
Claude Subscription accounts: Image analysis is automatically skipped for Claude Sub accounts to avoid conflicts with native image support. Profile Type Detection:- Account profiles (isolated instances) → Skip
- Default profiles (CLI execution) → Skip
- CLIProxy profiles → Analyze
ANTHROPIC_MODEL Fallback
When image analysis is enabled but no vision model is configured for the current provider, CCS falls back to theANTHROPIC_MODEL environment variable.
Example:
How It Works
Hook Architecture
CCS injects a PreToolUse hook into Claude’s settings:~/.ccs/hooks/image-analyzer-transformer.cjs
Execution Flow
- Claude calls Read tool with file path
- Hook checks file extension (
.jpg,.pdf, etc.) - If image/PDF:
- Reads file (max 10MB)
- Sends to
http://127.0.0.1:8317/v1/messages(CLIProxy) - Receives text description
- Returns description to Claude
- If not image/PDF:
- Returns exit code 0 (pass-through)
- Claude executes Read tool normally
Environment Variables
The hook reads these variables (set by CCS automatically):| Variable | Purpose |
|---|---|
CCS_IMAGE_ANALYSIS_ENABLED | Enable/disable feature (1/0) |
CCS_IMAGE_ANALYSIS_PROVIDER_MODELS | Provider:model mapping |
CCS_CURRENT_PROVIDER | Current CLIProxy provider |
CCS_IMAGE_ANALYSIS_TIMEOUT | Timeout in seconds |
CCS_PROFILE_TYPE | Profile type (account/default skip) |
ANTHROPIC_MODEL | Fallback model if provider not configured |
CCS_DEBUG | Enable debug output (1/0) |
Configuration File
Settings stored in~/.ccs/config.yaml:
Troubleshooting
Analysis Not Happening
Check status:- Feature disabled → Run
ccs config image-analysis --enable - Wrong profile type → Only works with CLIProxy providers
- CLIProxy not running → Check
ccs doctor
Analysis Timeout
Error: “Image analysis timeout after 60s” Solutions:Wrong Model Used
Check provider model:Debug Mode
Enable verbose logging to see hook execution:- Hook logs → stderr (when
CCS_DEBUG=1) - CLIProxy logs →
~/.ccs/logs/cliproxy/
Security Considerations
File Size Limit: 10MB maximum per file Local Only: CLIProxy runs on127.0.0.1:8317 (no external access)
API Key: Uses internal CCS-managed key (no user credentials exposed)
Related
- CLIProxy API - OAuth provider integration
- Dashboard - Visual configuration
- CLI Flags Reference - Command-line options
