https://github.com/melon-hub/claude-code-image-paste-wsl
Paste clipboard images into VS Code/Cursor terminal for Claude Code. WSL optimized.
https://github.com/melon-hub/claude-code-image-paste-wsl
claude claude-code clipboard image-paste screenshot screenshot-tool terminal vs-code-extenstion vscode-extension windows wsl
Last synced: 29 days ago
JSON representation
Paste clipboard images into VS Code/Cursor terminal for Claude Code. WSL optimized.
- Host: GitHub
- URL: https://github.com/melon-hub/claude-code-image-paste-wsl
- Owner: melon-hub
- License: other
- Created: 2026-01-03T00:50:44.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-01-03T02:20:35.000Z (about 1 month ago)
- Last Synced: 2026-01-11T10:09:55.632Z (about 1 month ago)
- Topics: claude, claude-code, clipboard, image-paste, screenshot, screenshot-tool, terminal, vs-code-extenstion, vscode-extension, windows, wsl
- Language: JavaScript
- Homepage:
- Size: 263 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Claude Code Image Paste (WSL)
Paste images from clipboard into terminals for Claude Code conversations. Optimized for Windows & WSL environments.
**Works with all VS Code-based IDEs**: VS Code, Cursor, Windsurf, VSCodium, and other forks.
**Based on [agg4code/claude-image-paste](https://github.com/aggroot/claude-image-paste)** - enhanced with WSL path handling, auto-save to project directory, and automatic cleanup.
## β¨ Features
- π **Clipboard Images**: Paste screenshots directly from your clipboard
- π **File Support**: Copy image files from Explorer and paste their paths
- πΌοΈ **Multiple Formats**: PNG, JPG, JPEG, GIF, BMP, WebP, SVG, ICO, TIFF
- π **WSL Path Conversion**: Automatically converts paths for WSL terminals
- π **Auto-Save to Project**: Save images to your project directory instead of temp
- π§Ή **Auto-Cleanup**: Keeps only the last N images to prevent folder bloat
- π€ **@ Prefix**: Automatically adds `@` prefix for Claude Code file imports
- π **Auto-Gitignore**: Automatically adds save directory to `.gitignore`
- βοΈ **File Renaming**: Optional rename dialog for custom filenames
- π
**Smart Naming**: Auto-generates timestamped filenames with configurable prefix
## π Installation
### VS Code / VSCodium
Install from the marketplace:
```
ext install melon-hub.claude-code-image-paste-wsl
```
Or search "Claude Code Image Paste WSL" in the Extensions panel.
### Cursor / Windsurf / Other Forks
These IDEs don't always sync with the VS Code Marketplace. Install manually:
1. Download the latest `.vsix` from [Releases](https://github.com/melon-hub/claude-code-image-paste-wsl/releases)
2. `Ctrl+Shift+P` β "Install from VSIX..."
3. Select the downloaded file
4. Restart the IDE
## π Usage
1. **Copy an image**:
- Take a screenshot (`Win+Shift+S`, `PrintScreen`, etc.)
- OR copy an image file from File Explorer
- OR right-click an image in browser β Copy image
2. **With your terminal open**, press:
```
Ctrl+Alt+V
```
3. **The image path is inserted** with `@` prefix, ready for Claude Code!
> **Note**: The keyboard shortcut requires a terminal to be open. The command palette (`Ctrl+Shift+P` β "Paste Image for Claude") is available but will shift focus away from the terminal.
## βοΈ Settings
Configure in VS Code Settings (`Ctrl+,`) β search "Claude Image Paste":
| Setting | Default | Description |
|---------|---------|-------------|
| `saveDirectory` | `""` | Where to save images (see below) |
| `skipRenamePrompt` | `false` | Skip the file rename dialog |
| `maxImages` | `10` | Max images to keep in directory (oldest auto-deleted) |
| `filenamePrefix` | `img_` | Prefix for auto-generated filenames |
### π
Filename Format
Images are automatically named with a timestamp:
```
img_20250103_143052.png
β β β
β β βββ Time: 14:30:52 (HHMMSS)
β ββββββββββββ Date: 2025-01-03 (YYYYMMDD)
βββββββββββββββββPrefix (configurable)
```
This ensures filenames are **unique** and **sort chronologically** in file explorers.
### π How `saveDirectory` Works
| Value | Behavior | Example Result |
|-------|----------|----------------|
| `""` (empty) | Uses system temp folder | `C:\Users\You\AppData\Local\Temp\img_20250103_120000.png` |
| `.claude-images` | Relative to **current workspace root** | `[workspace]/.claude-images/img_20250103_120000.png` |
| `screenshots` | Relative to **current workspace root** | `[workspace]/screenshots/img_20250103_120000.png` |
| `~/Pictures` | Expands `~` to home directory | `/home/you/Pictures/img_20250103_120000.png` |
| `/absolute/path` | Uses exact path | `/absolute/path/img_20250103_120000.png` |
**Key point**: Relative paths (like `.claude-images`) are resolved from whatever folder you have open in VS Code/Cursor. So if you open `/home/user/my-project`, images save to `/home/user/my-project/.claude-images/`.
The folder is **automatically created** if it doesn't exist, and **automatically added to `.gitignore`**.
### π‘ Recommended Setup
Add to your VS Code/Cursor `settings.json`:
```json
{
"claudeImagePaste.saveDirectory": ".claude-images",
"claudeImagePaste.skipRenamePrompt": true,
"claudeImagePaste.maxImages": 10
}
```
This configuration:
- β
Saves images to `.claude-images/` in your project root
- β
Skips the rename prompt for faster workflow
- β
Auto-deletes old images, keeping only the last 10
## π οΈ Requirements
- **Windows 10/11** with **WSL2** (or native Windows)
- **PowerShell** (comes with Windows)
- **VS Code 1.74.0+** or any VS Code-based IDE (Cursor, Windsurf, VSCodium, etc.)
## π Troubleshooting
**"No active terminal found"**
- Open a terminal first (`` Ctrl+` ``)
- Make sure at least one terminal exists in VS Code/Cursor
**"No image in clipboard"**
- Ensure you copied an image (not just selected it)
- Try copying again - some apps don't copy to clipboard correctly
**"Failed to move file to custom directory"**
- Check the directory path is valid
- Ensure you have write permissions
- Try using an absolute path instead of relative
**Keyboard shortcut doesn't work**
- Ensure a terminal is open (doesn't need to be focused)
- Check for conflicts: `Ctrl+K Ctrl+S` β search "Paste Image"
- Try reassigning to a different shortcut
**Extension not updating**
- Fully close and reopen VS Code/Cursor (reload window may not be enough)
## π‘ Contributing
Have an idea or found a bug? Contributions welcome!
- **Bug reports**: [Open an issue](https://github.com/melon-hub/claude-code-image-paste-wsl/issues/new?template=bug_report.md)
- **Feature requests**: [Open an issue](https://github.com/melon-hub/claude-code-image-paste-wsl/issues/new?template=feature_request.md)
- **Pull requests**: Fork, make changes, submit a PR
## π₯ Credits
- **Original Extension**: [claude-image-paste](https://github.com/aggroot/claude-image-paste) by [agg](https://github.com/aggroot)
- **WSL Fork**: [melon-hub](https://github.com/melon-hub)
## π License
MIT License - see [LICENSE](LICENSE)