Tool

Patch and extend Claude Code CLI with 38 AST-based fixes

Applies 44 independently verifiable AST patches to the official Claude Code native CLI executable, with atomic promotion and rollback.

Works with claudebabelbunbatmcp

91
Spark score
out of 100
Updated 12 days ago
Source checked Sep 10, 2026
Version 1.0.0

Add to Favorites

Why it matters

Unlock hidden capabilities, fix shell quoting and LSP bugs, and improve tool ergonomics in the Claude Code CLI by applying 38 verifiable AST patches to the native binary's JavaScript bundle without redistributing binaries.

Outcomes

What it gets done

01

Apply bat-style range syntax to Read tool and batch edits to Edit tool

02

Fix shell quoting bugs that mangle negation and test operators in Bash commands

03

Fan out LSP lifecycle notifications to multiple language servers per file extension

04

Customize prompt fragments to steer the model toward better shell tooling choices

Source

Get it from source

Spark does not host a copy of it.

Open source

Reports

Agent outcome reports

No reports yet

Overview

Cc Enhanced

cc-enhanced applies a curated set of 44 independently verifiable AST patches to the official Claude Code native CLI executable, covering Read/Edit ergonomics, prompt and tool routing, and runtime/UI controls. It repacks the patched result at the original binary layout with atomic promotion and rollback, aborting without writing if any patch's verifier fails. Use it to get specific, auditable modifications to the Claude Code CLI if you accept the risk of patching a vendor executable outside Anthropic's support; maintenance is currently paused and the build is verified only against Claude Code 2.1.263, so it will drift from newer releases.

What it does

cc-enhanced applies a curated set of independently verifiable AST patches to the official Claude Code native CLI executable: it extracts the embedded JavaScript, rebundles split modules into one patch surface when needed, runs one shared AST pass (discover, mutate, finalize) with each patch owning its own verifier, and repacks the result at the exact original byte length and layout - aborting without writing anything if any selected verification fails. The primary cli-full profile bundles 44 registered patches covering Read/Edit ergonomics, prompt and tool routing, and runtime/UI controls, with atomic promotion and rollback so a patched install stays recoverable.

When to use - and when NOT to

Use it if you want specific, individually verifiable behavior changes to the Claude Code CLI (better Read/Edit diffing, modernized prompt/tool routing, expanded runtime controls) and are comfortable running a tool that modifies a locally obtained vendor executable - the project's own disclaimer states plainly that this may not be permitted under Claude Code's applicable terms, that it is not affiliated with or endorsed by Anthropic, and that use is at your own risk. Maintenance is explicitly paused (the author switched to a different tool, oh-my-pi) and the current build is verified only against Claude Code 2.1.263, so it will drift from newer releases until someone - possibly via a contributed PR - carries the patches forward. Beyond the supported standalone CLI profile, Desktop, Remote Control, and self-hosted-runner patch sets are reserved and build-only: they explicitly require target-specific receipts and compatibility proof that hasn't been established, and the project is careful to note that passing an earlier proof level (like offline construction) never promotes a reserved profile to actually verified.

Inputs and outputs

Input is a locally obtained, official Claude Code native executable. Output is either a verified, repacked, atomically promoted patched binary, or - if any selected patch's verifier fails - an aborted run that writes nothing. The repository ships only patch source and build tooling; it does not publish or redistribute any Claude Code binaries, bundles, container images, npm packages, credentials, or session state itself.

Integrations

mise install
bun install --frozen-lockfile
mise run native:update

native:update fetches the current official release, builds and verifies a separate candidate, and promotes it only after every selected patch gate passes; mise run native:rollback reverses that with an atomic symlink exchange. Native lifecycle operations (bundle parsing, repacking, prompt export, full verification) are serialized by a process-tree lease because they're memory-heavy, and the test suite deliberately runs one file at a time for the same reason. CI installs dependencies, checks docs, typechecks, lints, and runs tests - it does not build or upload patched binaries itself; only mise run verify:patches against a real native bundle proves the current upstream release still matches.

Who it's for

Claude Code power users who want specific, auditable modifications to the CLI's editing and prompt behavior and are willing to accept the risk and maintenance burden of patching a vendor binary that is explicitly outside Anthropic's support or endorsement, on a project whose own maintenance is currently paused. It's released under the MIT license.

Source README

cc-enhanced

Verifiable AST patches for the latest Claude Code native CLI

CI Tested with Claude Code 2.1.263 44 patches Maintenance paused Bun 1.4.0 MIT License

Get started · Patch catalog · Configuration · Desktop and remote targets · Documentation

cc-enhanced extracts the JavaScript embedded in an official Claude Code native executable, rebundles split modules into one patch surface when needed, applies a selected set of independently verifiable patches, and repacks the result without changing the native file's fixed layout. The primary cli-full profile improves Read and Edit ergonomics, modernizes prompt and tool routing, unlocks runtime and UI controls, and keeps the patched installation recoverable through atomic promotion and rollback.

What it changes

Area Highlights
Read and Edit bat-style Read ranges, whitespace rendering, batched edits[], safer content-addressed edits, and structured diff presentation.
Tool policy Optional removal of legacy built-ins, modern shell and MCP routing, preserved NotebookEdit support for Desktop-oriented candidates, and clearer task-output handling.
Prompt harness Stronger repository policy, focused agent roles, current code-search guidance, model routing metadata, and prompt-surface drift checks.
Runtime Cache policy, larger file limits, feature gates, model catalogs and aliases, session controls, and update protection.
Terminal UX Visible patch signatures, expanded results, plan diffs, queued follow-ups, skill and agent notices, and configurable file links.
Native lifecycle Official artifact fetching, split-module rebundling, fixed-layout repacking, receipt-bound verification, atomic promotion, rollback, and guarded cross-platform candidate workflows.

The complete behavior and source link for every tag lives in the 44-patch catalog.

Quick start

mise install
bun install --frozen-lockfile

mise run native:update

claude --version
mise run status

native:update fetches the current official release, builds and verifies a separate candidate, and promotes it only after all selected patch gates pass. Rollback is an atomic symlink exchange:

mise run native:rollback

See Getting started for requirements, patch selection, runtime tooling, traffic settings, and verification levels.

How it works

flowchart LR
    upstream["Official native executable"] --> extract["Extract or rebundle embedded JavaScript"]
    extract --> prompts["Prompt string transforms"]
    prompts --> ast["One shared AST pass<br/>discover → mutate → finalize"]
    ast --> verify{"Every selected verifier passes?"}
    verify -- no --> abort["Abort without writing"]
    verify -- yes --> signature["Inject patch signature"]
    signature --> repack["Repack at the original byte length and layout"]
    repack --> promote["Atomic promotion"]
    promote -. rollback .-> promote

Structural patches share one parsed AST and run in registration order. Each patch owns its verifier, failed tags are reported together, and no artifact is written when any required verification fails. Native lifecycle operations are serialized by a process-tree lease because bundle parsing, repacking, prompt export, and full verification are memory-heavy.

Profiles and target surfaces

Surface Patch policy Selection state What is still required
Standalone CLI (cli-full) 44 registered patches Supported and selectable A real latest-bundle verification before release or promotion claims.
Desktop-local 30 probe-required candidates, 15 exclusions Reserved and build-only Exact target receipts plus stock and patched Read/Edit/tool approval and presentation probes.
Remote Control 30 probe-required candidates, 15 exclusions Reserved and build-only Matching-host proof and separate web, mobile, and Desktop client compatibility evidence.
Self-hosted runner 30 probe-required candidates, 15 exclusions Reserved and build-only Runner registration, child execution, deployment, and client qualification.

Offline construction, matching-host execution, stock-client rendering, and live control-plane operation are separate proof levels. A passing earlier level never promotes a reserved profile or establishes later compatibility. The target workflow guide explains the commands, client UI risks, Remote Control path, self-hosted path, and upkeep model.

Documentation

Guide Use it for
Getting started Install, patch, activate, select tags, verify, and roll back.
Patch catalog Review every registered patch and its exact effect.
Configuration Configure patch selection, prompt policy, models, file opening, and runtime controls.
CLI and inspection reference Run lifecycle, prompt export, bundle inspection, evidence, and release-diff commands.
Target workflows Build or assess Desktop, Remote Control, and self-hosted candidates without overstating support.
Subscription routing Maintain the optional direct-plus-mixed-model launcher setup.
Maintainer reference Understand binary formats, patch interactions, release procedures, prompt drift, and authoring rules.

Development and verification

bun run docs:check
bun run typecheck
bun run lint
bun run test
mise run verify:patches

bun run test deliberately executes one test file at a time to bound memory. Fixture tests validate contracts and edge cases; only mise run verify:patches against a real native bundle proves that the current upstream release still matches and verifies. See the CLI reference for prompt exports, matrix checks, and release-diff tooling.

Distribution and safety

  • Generated candidates and evidence belong under ignored repository-local cache paths or another explicit private location.
  • CI installs dependencies, checks documentation, typechecks, lints, and runs the serial test suite; it does not upload release assets or patched builds.
  • Desktop-managed artifacts are not mutated by the offline candidate builder.
  • Remote Control and self-hosted live actions remain explicit, receipt-bound operations with their own trust and consent gates.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.