Skip to content

calmzealA/WinCCSnap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WinCCSnap

WinCCSnap Logo

🇺🇸 English | 🇨🇳 中文文档

Windows 10+ PowerShell 5.1+ License: MIT

A lightweight PowerShell utility that enables clipboard image pasting into Claude Code on Windows by automatically converting CF_BITMAP to PNG format.

💡 This project was generated by Claude Code - A clipboard enhancement tool designed specifically for Windows users of Claude Code

🎯 Problem Solved

Claude Code on Windows currently doesn't support pasting clipboard bitmap images directly. When you take a screenshot with Win+Shift+S, the image gets stored as CF_BITMAP format which Claude Code cannot process.

Before: Screenshot → Clipboard → ❌ Cannot paste into Claude Code
After: Screenshot → WinCCSnap → PNG → ✅ Direct paste into Claude Code

✨ Features

  • Zero Configuration: Install once, works immediately
  • Real-time Conversion: Automatically converts bitmap to PNG
  • Background Service: Runs silently with minimal CPU usage
  • Immediate Effect: No restart required after installation
  • Battery Friendly: Optimized for laptops
  • Clean Uninstall: Complete removal when no longer needed

🚀 Quick Start

1. Installation

Open PowerShell as Administrator and run:

# Download and install
iwr -useb https://raw.githubusercontent.com/calmzealA/WinCCSnap/main/WinCCSnap.ps1 | iex
.\WinCCSnap.ps1 install

2. Usage

After installation, you can immediately use screenshots in Claude Code:

  1. Press Win+Shift+S to take a screenshot
  2. Switch to Claude Code
  3. Press Ctrl+V to paste the image

3. Management Commands

# Check detailed status (scheduled task + current job)
.\WinCCSnap.ps1 info

# Start immediately after restart (current session only)
.\WinCCSnap.ps1 restart

# Test if it's working correctly
.\WinCCSnap.ps1 test

# Remove completely
.\WinCCSnap.ps1 remove

# Show help
.\WinCCSnap.ps1 help

🔧 Technical Details

Architecture

  • Listener: Background PowerShell job monitoring clipboard
  • Converter: .NET System.Windows.Forms for image processing
  • Storage: Temporary PNG files in %TEMP%\clip.png
  • Trigger: 500ms polling interval with <1% CPU usage

Security

  • Runs under current user context (not system)
  • No network access required
  • No persistent data storage
  • Clean removal leaves no traces

📊 System Requirements

  • Windows 10 or later
  • PowerShell 5.1 or later
  • .NET Framework 4.0 or later (built-in)
  • Administrator privileges for installation

🔄 After Restart

Why it might not work immediately

  • Scheduled Task starts automatically but takes 1-2 minutes after login
  • PowerShell Job (temporary) disappears after restart

Solutions

  1. Wait 1-2 minutes for scheduled task to start automatically
  2. Manual start: Run .\WinCCSnap.ps1 restart to start immediately
  3. Verify: Run .\WinCCSnap.ps1 test to check functionality

Understanding the Architecture

  • Scheduled Task: Persistent system service, starts at login
  • PowerShell Job: Temporary session process for immediate testing
  • Use restart command after restart to bridge the gap

🛠️ Development

Manual Installation

git clone https://github.com/calmzealA/WinCCSnap.git
cd WinCCSnap
.\WinCCSnap.ps1 install

Debugging

# Check running processes
Get-Job -Name "WinCCSnapListener"

# View logs
Get-ScheduledTaskInfo -TaskName "WinCCSnapListener"

# Manual trigger
schtasks /run /tn WinCCSnapListener

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

📄 License

MIT License - see LICENSE file for details.

🙏 Acknowledgments

  • Inspired by the clipboard handling in WeChat
  • Built with PowerShell and .NET Framework
  • Optimized for Claude Code workflows

中文文档: README.zh-CN.md

About

让Windows用户在Claude Code中直接粘贴剪贴板图片的PowerShell工具

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors