claude-utils 0.2.0

Cross-platform companion toolkit for Anthropic's Claude Code CLI
Documentation
# Claude-Utils Implementation Status

## ✅ Completed MVP Implementation

### Core Architecture
- **Rust project structure** with proper module organization
- **Cross-platform clipboard abstraction** using arboard 3.5.0
- **MCP server implementation** with full JSON-RPC 2.0 support
- **File staging system** with deduplication and auto-cleanup
- **Authentication system** with token-based security
- **CLI interface** with subcommands for all operations

### MCP Protocol Implementation
- `initialize` / `initialized` handshake
-`tools/list` endpoint returning available tools
-`tools/call` endpoint for tool execution
-`clipboard.get` tool - reads text and images from clipboard
-`clipboard.set` tool - writes to clipboard (with --write flag)
- ✅ SSE endpoint for future real-time updates

### Features Implemented
- **Text clipboard support** - Up to 64KB inline, larger texts staged to files
- **Image clipboard support** - PNG/JPEG with automatic file staging
- **Smart file staging** - SHA-256 based deduplication
- **Thumbnail generation** - 256x256 previews for images
- **Auto-cleanup** - Removes files older than 15 minutes
- **Security** - Local-only binding, token auth, restrictive file permissions
- **Cross-platform** - Platform-specific dependencies configured

### Developer Experience
- **Zero-config discovery** - Default port 3830
- **Easy MCP registration** - `claude-utils config` generates .mcp.json
- **Quick CLI tools** - `clip get`, `clip paste` for testing
- **Comprehensive documentation** - README, setup guide, examples
- **CI/CD pipeline** - GitHub Actions for multi-platform builds

## 🚧 Not Yet Implemented

### Terminal Paste Interception
The "magic" experience of intercepting ⌘V/Ctrl+V at the terminal level is not yet implemented. This requires:
- PTY (pseudo-terminal) manipulation
- Platform-specific terminal hooks
- Complex event handling

**Current workaround**: Users need to explicitly ask Claude to read their clipboard.

### Advanced Features (Future)
- Clipboard watching with SSE streaming
- Clipboard history
- OCR capabilities
- Screenshot capture
- Multi-agent orchestration

## Usage Summary

1. **Build and install**:
```bash
cargo build --release
./install.sh
```

2. **Start daemon**:
```bash
claude-utils start
```

3. **Configure Claude Code**:
```bash
claude-utils config > .mcp.json
export CLAUDE_UTILS_TOKEN=<shown-token>
```

4. **Test**:
```bash
# Copy something to clipboard, then:
claude-utils clip get
```

5. **In Claude Code**:
```
"Analyze the image in my clipboard"
"What text is currently in my clipboard?"
```

## Technical Decisions Made

1. **Rust over other languages**: Performance, memory safety, excellent cross-platform support
2. **Direct MCP implementation**: Given uncertainty about Rust SDK versions, implemented protocol directly
3. **Axum web framework**: Modern, fast, built-in SSE support
4. **Token authentication**: Simple but effective for local security
5. **File staging approach**: Balances performance with simplicity

## Next Steps for Production

1. **Testing**: More comprehensive integration tests
2. **Error handling**: Better user-facing error messages
3. **Logging**: Structured logging with log levels
4. **Performance**: Optimize image processing pipeline
5. **Distribution**: Package for brew, apt, winget
6. **Terminal integration**: Research and implement paste interception

The MVP successfully demonstrates the concept and provides immediate value to Claude Code users, even without the terminal paste interception feature.