Skip to content

Commit f642167

Browse files
committed
Add initial Claude Code workaround scripts and docs
Introduce README.md with documentation, UpdateFix.sh for resolving update lock issues, requirements.txt for Python dependencies, and wsl-paste-workaround.py to enable image pasting in Claude Code via WSL. These tools address common workflow problems and provide setup and usage instructions.
0 parents  commit f642167

File tree

4 files changed

+486
-0
lines changed

4 files changed

+486
-0
lines changed

README.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Claude Code Workarounds
2+
3+
A collection of daily workarounds and fixes for common issues when using Claude Code.
4+
5+
## Overview
6+
7+
This repository contains scripts and utilities to solve frequent problems encountered while using Claude Code. Each tool addresses specific limitations or bugs that affect daily workflow.
8+
9+
## Current Tools
10+
11+
### wsl-paste-workaround.py
12+
Enables image pasting when using Claude Code through WSL.
13+
14+
**What it does:**
15+
- Captures images from Windows clipboard when using Shift+Insert
16+
- Automatically saves images to a `sharedclaude` folder
17+
- Pastes the correct `@sharedclaude/filename.png` format into terminal
18+
19+
**When to use:**
20+
- Working with Claude Code in WSL environment
21+
- Need to paste images from Windows clipboard
22+
- Want automatic image organization in shared folder
23+
24+
**Installation:**
25+
```bash
26+
pip install -r requirements.txt
27+
```
28+
29+
**Usage:**
30+
```bash
31+
# Run with admin privileges (recommended)
32+
python wsl-paste-workaround.py /path/to/your/project
33+
34+
# Or provide path interactively
35+
python wsl-paste-workaround.py
36+
```
37+
38+
**How it works:**
39+
- If path doesn't end with `sharedclaude`, creates that subdirectory automatically
40+
- Press Shift+Insert to capture clipboard image
41+
- Images auto-delete after 5 minutes
42+
- Press Ctrl+C to stop
43+
44+
### UpdateFix.sh
45+
Fixes Claude update issues when it claims another instance is updating.
46+
47+
**When to use:**
48+
- Claude says it's outdated but update fails
49+
- Gets "another instance is updating" error when no other instance exists
50+
51+
**Usage:**
52+
```bash
53+
./UpdateFix.sh
54+
```
55+
56+
**What it does:**
57+
- Cleans up stuck update locks
58+
- Runs Claude update
59+
- Removes outdated Claude binaries
60+
- Refreshes shell cache
61+
62+
## Installation
63+
64+
1. Clone this repository
65+
2. Install Python dependencies:
66+
```bash
67+
pip install -r requirements.txt
68+
```
69+
3. Make shell scripts executable:
70+
```bash
71+
chmod +x UpdateFix.sh
72+
```
73+
74+
## Requirements
75+
76+
- Python 3.6+
77+
- Windows (for WSL paste workaround)
78+
- WSL environment (for paste workaround)
79+
- Claude Code installed
80+
81+
## Contributing Your Workarounds
82+
83+
**Have your own Claude Code fixes?** We'd love to include them!
84+
85+
Submit your workarounds via:
86+
- Pull requests with your scripts and documentation
87+
- Issues describing problems and solutions you've found
88+
- Suggestions for improvements to existing tools
89+
90+
Each contribution should include:
91+
- Clear description of the problem it solves
92+
- Installation instructions
93+
- Usage examples
94+
- When to use it
95+
96+
## Adding New Workarounds
97+
98+
This repository will be updated with additional workarounds and fixes as they are developed for daily Claude Code usage.
99+
100+
## Support This Project
101+
102+
If these tools help your Claude Code workflow:
103+
104+
**Star this repository** to help others discover these fixes
105+
🔄 **Share with colleagues** who use Claude Code
106+
🤝 **Contribute your own workarounds** to help the community
107+
108+
## Notes
109+
110+
- Run `wsl-paste-workaround.py` with administrator privileges for best results
111+
- Images are automatically cleaned up after 5 minutes to save disk space
112+
- Backup your work before running any fix scripts
113+
114+
---
115+
116+
**Found this helpful?** Star the repo and share it with other Claude Code users!

UpdateFix.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
##
4+
## Use this when claude code says its outdated and when you do claude update it says another instance is updating even
5+
## though there is no other instance updating.
6+
##
7+
8+
echo "Cleaning up old Claude locks..."
9+
rm -f ~/.claude/.update.lock
10+
rm -rf ~/.claude/.update.tmp*
11+
12+
echo "Running Claude update..."
13+
claude update
14+
15+
echo "Verifying installed Claude versions..."
16+
CLAUDE_BIN_PATHS=$(which -a claude)
17+
for path in $CLAUDE_BIN_PATHS; do
18+
version_output=$($path --version 2>/dev/null)
19+
echo " $path => $version_output"
20+
done
21+
22+
main_path=$(which claude)
23+
main_version=$($main_path --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
24+
25+
if [ -x /usr/local/bin/claude ]; then
26+
local_version=$(/usr/local/bin/claude --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
27+
if [ "$local_version" != "$main_version" ]; then
28+
echo "Removing outdated /usr/local/bin/claude (version $local_version)..."
29+
sudo rm /usr/local/bin/claude
30+
fi
31+
fi
32+
33+
echo "Refreshing shell command cache..."
34+
hash -r
35+
36+
echo "Update complete. Claude version now:"
37+
which claude
38+
claude --version

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pywin32>=306
2+
Pillow>=9.0.0

0 commit comments

Comments
 (0)