claudefix 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +97 -0
- package/bin/claude-fixed.js +1184 -0
- package/bin/claudefix-cli.js +239 -0
- package/bin/wrapper.js.template +87 -0
- package/index.cjs +380 -0
- package/install-hook.cjs +309 -0
- package/install.sh +68 -0
- package/loader.cjs +15 -0
- package/package.json +53 -0
- package/preinstall.cjs +253 -0
- package/setup-interactive.cjs +349 -0
- package/vendor/node-pty/lib/eventEmitter2.js +47 -0
- package/vendor/node-pty/lib/index.js +52 -0
- package/vendor/node-pty/lib/interfaces.js +7 -0
- package/vendor/node-pty/lib/shared/conout.js +11 -0
- package/vendor/node-pty/lib/terminal.js +190 -0
- package/vendor/node-pty/lib/types.js +7 -0
- package/vendor/node-pty/lib/unixTerminal.js +346 -0
- package/vendor/node-pty/lib/utils.js +29 -0
- package/vendor/node-pty/linux-x64/pty.node +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 jonhardwick-spec
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# claudefix | Anthropic pls hire me :)
|
|
2
|
+
|
|
3
|
+
**Developed by Hardwick Software Services @ [justcalljon.pro](https://justcalljon.pro/)**
|
|
4
|
+
|
|
5
|
+
Fixes screen glitching, blocky color display, AND the scrollback lag in Claude Code CLI on Linux. This affects a ton of people using Linux terminals - VTE rendering bugs cause background colors to be drawn ON TOP of text instead of behind it.
|
|
6
|
+
|
|
7
|
+
## What It Fixes
|
|
8
|
+
|
|
9
|
+
1. **VTE Color Glitches** - Background colors rendering on top of text (common on Xvfb/VNC/Linux)
|
|
10
|
+
2. **Compound ANSI Sequences** - Strips background colors from complex escape codes (v2.3.1)
|
|
11
|
+
3. **Scrollback Buffer Bloat** - Terminal lags after long sessions because Claude doesn't clear scrollback
|
|
12
|
+
4. **Resize Event Thrashing** - tmux/screen users get cooked by rapid SIGWINCH events
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx claudefix install
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
This checks for permissions first and tells you if you need sudo. Or just run directly:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
sudo npm install -g claudefix
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
> **Note:** Global npm install requires sudo on most systems. If you don't have sudo, see [Alternative Install](#alternative-install) below.
|
|
27
|
+
|
|
28
|
+
That's it! The install script:
|
|
29
|
+
1. Auto-detects and installs build dependencies (if running as root)
|
|
30
|
+
2. Compiles node-pty for your system
|
|
31
|
+
3. Sets up your `claude` command to use the fix
|
|
32
|
+
|
|
33
|
+
**Works with both npm-installed Claude AND native Claude installs** (the new self-updating version at `~/.local/share/claude/versions`).
|
|
34
|
+
|
|
35
|
+
## This Isn't Malware - Here's What It Actually Does
|
|
36
|
+
|
|
37
|
+
Some people see "binary wrapper" and freak out. Let's be real clear about what's happening here.
|
|
38
|
+
|
|
39
|
+
**claudefix doesn't modify, patch, replace, or tamper with the claude binary.** The original claude binary runs completely untouched. What we do is spawn it inside a pseudo-terminal (PTY) using `node-pty` and filter the terminal output stream before it hits your actual terminal. That's it.
|
|
40
|
+
|
|
41
|
+
Think of it like piping `claude` through `sed` - the binary runs normally, we just clean up the ANSI escape codes it spits out before they reach your screen. The claude process doesn't know or care that it's running inside our PTY wrapper. It thinks it's talking to a normal terminal.
|
|
42
|
+
|
|
43
|
+
Here's what the wrapper actually does to the output stream:
|
|
44
|
+
|
|
45
|
+
1. **Strips background colors** - Removes ANSI background color codes (like `\x1b[48;5;XXm`) that cause VTE rendering glitches on Linux
|
|
46
|
+
2. **Clears scrollback periodically** - Sends `\x1b[3J` every 500 renders or 60 seconds to prevent terminal lag
|
|
47
|
+
3. **Debounces resize events** - Batches SIGWINCH signals instead of thrashing the terminal
|
|
48
|
+
|
|
49
|
+
**You can verify this yourself:**
|
|
50
|
+
- Read `bin/claude-fixed.js` - it's ~100 lines of straightforward PTY spawn + regex filtering
|
|
51
|
+
- Set `CLAUDEFIX_DISABLED=1` to bypass the wrapper entirely
|
|
52
|
+
- Run `claude` directly if you don't trust it - you'll just get the screen glitches back
|
|
53
|
+
- It's MIT licensed, fully open source, nothing hidden
|
|
54
|
+
|
|
55
|
+
## Config
|
|
56
|
+
|
|
57
|
+
| Env Var | What It Does | Default |
|
|
58
|
+
|---------|--------------|---------|
|
|
59
|
+
| `CLAUDEFIX_DISABLED` | Set to `1` to disable the fix | off |
|
|
60
|
+
| `CLAUDE_TERMINAL_FIX_DEBUG` | Set to `1` for debug logs | off |
|
|
61
|
+
|
|
62
|
+
## Manual Usage
|
|
63
|
+
|
|
64
|
+
If the auto-setup didn't work:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
claude-fixed # Use this instead of claude
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Or alias it:
|
|
71
|
+
```bash
|
|
72
|
+
alias claude='claude-fixed'
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## shoutout to the big dogs
|
|
76
|
+
|
|
77
|
+
hey [@anthropics](https://github.com/anthropics) yall made a sick product but these terminal bugs been cooking people for months. maybe steal this fix idc - just add `\x1b[3J` to your clear command and strip BG colors on Linux.
|
|
78
|
+
|
|
79
|
+
**Anthropic if you're reading this - I'm available for hire**
|
|
80
|
+
- Email: jonathan.m.hardwick@gmail.com
|
|
81
|
+
- Site: https://justcalljon.pro
|
|
82
|
+
|
|
83
|
+
## Alternative Install
|
|
84
|
+
|
|
85
|
+
If you don't have sudo access, configure npm to use your home directory:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
mkdir -p ~/.npm-global
|
|
89
|
+
npm config set prefix '~/.npm-global'
|
|
90
|
+
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
|
|
91
|
+
source ~/.bashrc
|
|
92
|
+
npm install -g claudefix
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## License
|
|
96
|
+
|
|
97
|
+
MIT - do whatever you want with it
|