claude-depester 1.5.0 → 1.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/README.md +5 -5
- package/lib/bun-binary.js +82 -10
- package/lib/hooks.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@ Patches Claude Code CLI and VS Code extension to replace whimsical loading words
|
|
|
8
8
|
|
|
9
9
|
Instead of seeing "Flibbertigibbeting", "Discombobulating", "Clauding", etc., you'll see a clean "Thinking".
|
|
10
10
|
|
|
11
|
-
> **Last updated:** 2026-03-
|
|
11
|
+
> **Last updated:** 2026-03-27 | **Tested with:** Claude Code 2.1.4 - 2.1.85 | **Platforms:** Linux, macOS, Windows
|
|
12
12
|
>
|
|
13
|
-
> v1.5.
|
|
13
|
+
> v1.5.1: Fix binary extraction for newer Claude Code versions (2.1.84+) that use a new Bun ELF section format. Auto-patch hook now includes `--no-animation` by default.
|
|
14
14
|
|
|
15
15
|
**CLI - Spinner:**
|
|
16
16
|
|
|
@@ -167,7 +167,7 @@ The `--install-hook` command adds a SessionStart hook to `~/.claude/settings.jso
|
|
|
167
167
|
"hooks": [
|
|
168
168
|
{
|
|
169
169
|
"type": "command",
|
|
170
|
-
"command": "npx claude-depester --silent --log"
|
|
170
|
+
"command": "npx claude-depester --silent --log --no-animation"
|
|
171
171
|
}
|
|
172
172
|
]
|
|
173
173
|
}
|
|
@@ -267,14 +267,14 @@ npx claude-depester --remove-hook # Remove hook (if installed)
|
|
|
267
267
|
|
|
268
268
|
| Platform | Binary Patching | Webview Patching | Status |
|
|
269
269
|
|----------|-----------------|------------------|--------|
|
|
270
|
-
| Linux x64 | ELF | Yes | Tested (2.1.
|
|
270
|
+
| Linux x64 | ELF | Yes | Tested (2.1.85) |
|
|
271
271
|
| Linux ARM64 | ELF | Yes | Should work |
|
|
272
272
|
| macOS Intel | MachO | Yes | Should work |
|
|
273
273
|
| macOS Apple Silicon | MachO | Yes | Tested (2.1.38) |
|
|
274
274
|
| Windows x64 | PE | Yes | Should work |
|
|
275
275
|
| Windows ARM64 | PE | Yes | Should work |
|
|
276
276
|
|
|
277
|
-
Binary repacking uses raw file writes (byte-level section replacement) for MachO and
|
|
277
|
+
Binary repacking uses raw file writes (byte-level section replacement) for MachO, PE, and newer ELF formats (Bun 1.2+ with `.bun` section), avoiding LIEF write() which could produce bloated output. Older ELF binaries (overlay format) use LIEF write(). The tool uses [node-lief](https://www.npmjs.com/package/node-lief) for binary parsing on all platforms.
|
|
278
278
|
|
|
279
279
|
## Contributing
|
|
280
280
|
|
package/lib/bun-binary.js
CHANGED
|
@@ -204,7 +204,18 @@ function extractBunDataFromSection(sectionData) {
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
/**
|
|
207
|
-
* Extract Bun data from ELF
|
|
207
|
+
* Extract Bun data from ELF .bun section (new format, Bun 1.2+)
|
|
208
|
+
*/
|
|
209
|
+
function extractBunDataFromELFSection(elfBinary) {
|
|
210
|
+
const sections = elfBinary.sections();
|
|
211
|
+
const bunSection = sections.find(s => s.name === '.bun');
|
|
212
|
+
if (!bunSection) throw new Error('.bun section not found in ELF binary');
|
|
213
|
+
|
|
214
|
+
return extractBunDataFromSection(bunSection.content);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Extract Bun data from ELF overlay (old format)
|
|
208
219
|
*/
|
|
209
220
|
function extractBunDataFromELFOverlay(elfBinary) {
|
|
210
221
|
if (!elfBinary.hasOverlay) {
|
|
@@ -281,8 +292,15 @@ function getBunData(binary) {
|
|
|
281
292
|
return extractBunDataFromMachO(binary);
|
|
282
293
|
case 'PE':
|
|
283
294
|
return extractBunDataFromPE(binary);
|
|
284
|
-
case 'ELF':
|
|
295
|
+
case 'ELF': {
|
|
296
|
+
// New Bun versions (1.2+) embed data in a .bun section; older ones use an overlay
|
|
297
|
+
const sections = binary.sections();
|
|
298
|
+
const hasBunSection = sections.some(s => s.name === '.bun');
|
|
299
|
+
if (hasBunSection) {
|
|
300
|
+
return extractBunDataFromELFSection(binary);
|
|
301
|
+
}
|
|
285
302
|
return extractBunDataFromELFOverlay(binary);
|
|
303
|
+
}
|
|
286
304
|
default:
|
|
287
305
|
throw new Error(`Unsupported binary format: ${binary.format}`);
|
|
288
306
|
}
|
|
@@ -498,22 +516,69 @@ function buildSectionData(bunBuffer, headerSize = 8) {
|
|
|
498
516
|
}
|
|
499
517
|
|
|
500
518
|
/**
|
|
501
|
-
* Repack ELF binary with modified Bun data
|
|
519
|
+
* Repack ELF binary with modified Bun data (overlay format)
|
|
502
520
|
*/
|
|
503
|
-
function
|
|
521
|
+
function repackELFOverlay(elfBinary, binaryPath, newBunBuffer, outputPath) {
|
|
504
522
|
const fs = require('fs');
|
|
505
|
-
|
|
523
|
+
|
|
506
524
|
// Build new overlay
|
|
507
525
|
const newOverlay = Buffer.allocUnsafe(newBunBuffer.length + 8);
|
|
508
526
|
newBunBuffer.copy(newOverlay, 0);
|
|
509
527
|
newOverlay.writeBigUInt64LE(BigInt(newBunBuffer.length), newBunBuffer.length);
|
|
510
|
-
|
|
528
|
+
|
|
511
529
|
elfBinary.overlay = newOverlay;
|
|
512
|
-
|
|
530
|
+
|
|
513
531
|
// Write atomically
|
|
514
532
|
const tempPath = outputPath + '.tmp';
|
|
515
533
|
elfBinary.write(tempPath);
|
|
516
|
-
|
|
534
|
+
|
|
535
|
+
const origStat = fs.statSync(binaryPath);
|
|
536
|
+
fs.chmodSync(tempPath, origStat.mode);
|
|
537
|
+
fs.renameSync(tempPath, outputPath);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Repack ELF binary with modified Bun data (.bun section format)
|
|
542
|
+
* Uses raw file write like MachO/PE to avoid LIEF write issues.
|
|
543
|
+
*/
|
|
544
|
+
function repackELFSection(elfBinary, binaryPath, newBunBuffer, outputPath, sectionHeaderSize) {
|
|
545
|
+
const fs = require('fs');
|
|
546
|
+
|
|
547
|
+
const sections = elfBinary.sections();
|
|
548
|
+
const bunSection = sections.find(s => s.name === '.bun');
|
|
549
|
+
|
|
550
|
+
const originalSectionSize = Number(bunSection.size);
|
|
551
|
+
const sectionFileOffset = Number(bunSection.offset);
|
|
552
|
+
|
|
553
|
+
const newSectionData = buildSectionData(newBunBuffer, sectionHeaderSize);
|
|
554
|
+
|
|
555
|
+
if (newSectionData.length > originalSectionSize) {
|
|
556
|
+
throw new Error(
|
|
557
|
+
`Patched section data (${newSectionData.length}) is larger than original (${originalSectionSize}). ` +
|
|
558
|
+
'This should not happen since we only replace arrays with shorter content.'
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
// Pad new section data to original size so binary layout stays identical
|
|
563
|
+
const paddedSectionData = Buffer.alloc(originalSectionSize, 0);
|
|
564
|
+
newSectionData.copy(paddedSectionData, 0);
|
|
565
|
+
if (sectionHeaderSize === 8) {
|
|
566
|
+
paddedSectionData.writeBigUInt64LE(BigInt(newBunBuffer.length), 0);
|
|
567
|
+
} else {
|
|
568
|
+
paddedSectionData.writeUInt32LE(newBunBuffer.length, 0);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
// Raw file write: copy original binary, overwrite section bytes
|
|
572
|
+
const tempPath = outputPath + '.tmp';
|
|
573
|
+
fs.copyFileSync(binaryPath, tempPath);
|
|
574
|
+
|
|
575
|
+
const fd = fs.openSync(tempPath, 'r+');
|
|
576
|
+
try {
|
|
577
|
+
fs.writeSync(fd, paddedSectionData, 0, paddedSectionData.length, sectionFileOffset);
|
|
578
|
+
} finally {
|
|
579
|
+
fs.closeSync(fd);
|
|
580
|
+
}
|
|
581
|
+
|
|
517
582
|
const origStat = fs.statSync(binaryPath);
|
|
518
583
|
fs.chmodSync(tempPath, origStat.mode);
|
|
519
584
|
fs.renameSync(tempPath, outputPath);
|
|
@@ -638,9 +703,16 @@ function repackNativeInstallation(binaryPath, modifiedClaudeJs, outputPath, targ
|
|
|
638
703
|
case 'PE':
|
|
639
704
|
repackPE(binary, binaryPath, newBuffer, outputPath, sectionHeaderSize);
|
|
640
705
|
break;
|
|
641
|
-
case 'ELF':
|
|
642
|
-
|
|
706
|
+
case 'ELF': {
|
|
707
|
+
const elfSections = binary.sections();
|
|
708
|
+
const hasBunSection = elfSections.some(s => s.name === '.bun');
|
|
709
|
+
if (hasBunSection) {
|
|
710
|
+
repackELFSection(binary, binaryPath, newBuffer, outputPath, sectionHeaderSize);
|
|
711
|
+
} else {
|
|
712
|
+
repackELFOverlay(binary, binaryPath, newBuffer, outputPath);
|
|
713
|
+
}
|
|
643
714
|
break;
|
|
715
|
+
}
|
|
644
716
|
default:
|
|
645
717
|
throw new Error(`Unsupported binary format: ${binary.format}`);
|
|
646
718
|
}
|
package/lib/hooks.js
CHANGED
|
@@ -21,7 +21,7 @@ const MAX_LOG_ENTRIES = 50;
|
|
|
21
21
|
|
|
22
22
|
// Use --log to write results to ~/.claude/depester.log for debugging
|
|
23
23
|
// All installations are patched by default (--all is no longer needed)
|
|
24
|
-
const HOOK_COMMAND = 'npx claude-depester --silent --log';
|
|
24
|
+
const HOOK_COMMAND = 'npx claude-depester --silent --log --no-animation';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Read Claude Code settings
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-depester",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Patches Claude Code CLI and VS Code extension to show 'Thinking' instead of whimsical words.",
|
|
5
5
|
"main": "lib/patcher.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"claude-depester": "./bin/claude-depester"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"test": "node
|
|
10
|
+
"test": "node --test test/*.test.js"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [
|
|
13
13
|
"claude-code",
|