We assume you have the leaked source code of Claude Code, and it turns out that you cannot directly run it because it has some missing dependencies. This repository is right for you to make your source code work successfully.
What's inside
FAQ
claude-code-patch is a Claude Code plugin with 2 hand-picked skills for development work, indexed on Flowy. Install it with the command on its page. It includes claude-api, verify. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
$ npx -y skills add changzhiai/claude-code-patch --agent claude-code
Repo: changzhiai/claude-code-patch
We assume you have the leaked source code of Claude Code, and it turns out that you cannot directly run it because it has some missing dependencies. This repository is right for you to make your source code work successfully.
This repository provides the necessary patching and stubbing infrastructure. It acts as a specialized optimization layer, enabling you to stay in sync with the upstream source while applying persistent local modifications for local LLM support (Ollama).

install.sh)We use a consolidated install.sh script to handle the entire setup process, including source synchronization, patch application, and dependency management.
src directory available locally.Run the Installer:
./install.sh /path/to/original/claude/src
If the path is not provided as an argument, the script will prompt you for it.
What the script does:
src/ directory to match the upstream source.patch/ directory into the root, applying all custom logic and configurations.bun install to fetch all necessary dependencies.Launch the CLI:
bun run dev
The patch includes an Ollama Integration that allows using local models like Llama 3 instead of the Anthropic API.
ollamaShim.ts: A translation layer that intercepts Anthropic SDK calls and maps them to OpenAI-compatible requests for Ollama.localhost:11434 when a local model name is detected.The scripts/deep-sweep-stubber.ts enables the CLI to run without access to internal Anthropic dependencies or proprietary modules (like @ant/* or color-diff-napi).
Proxy objects that "catch-all" property access, preventing runtime crashes.useEffectEvent) in Bun environments.This branch activates various internal or experimental commands (e.g., /buddy, /ultrareview) by providing local mocks or implementations.
install.sh: The main setup script.patch/: The source of truth for all modifications. Files here are applied to the root during installation.src/: The working source directory (generated/updated by install.sh).For a full list of modified files and a detailed manifest, see patch/docs/patch.md.
[!CAUTION] Source of Truth: Always make modifications inside the
patch/directory. Changes made directly to the rootsrc/will be overwritten wheneverinstall.shis run.
For the best experience, you can create a global claude command that you can run from any terminal, automatically applying your local model settings.
A unified tool at scripts/create_launcher.sh (or patch/scripts/create_launcher.sh) is provided to handle the entire setup.
Run the script to configure your environment and link the command:
./patch/scripts/create_launcher.sh
This script will:
.env: Save these persistently to a local .env file that Bun automatically loads.~/.local/bin/claude representing your patched repository.Once set up, you can start your local Claude Code by just typing:
claude
To use the original unpatched version at any time, run:
claude --official
[!TIP] Path Precedence: Ensure that
~/.local/binis in your shell'sPATH. If it is not, the official version in/opt/homebrew/binmay take precedence.
install.sh
LICENSE
patch/
.gitignore
bunfig.toml
docs/
how_it_works.md
images/
cc.png
modify.md
patch.md
tech_stack.md
tutorial.md
package.json
scripts/
create_launcher.sh
deep-sweep-stubber.ts
src/
@anthropic-ai/
sandbox-runtime.ts
entrypoints/
cli.tsx
init.ts
sdk/
coreTypes.generated.ts
runtimeTypes.ts
settingsTypes.generated.ts
toolTypes.ts
hooks/
useDeferredHookMessages.ts
ink/
global.d.ts.ts
screens/
REPL.tsx
services/
api/
client.ts
logging.ts
ollamaShim.ts
withRetry.ts
voice.ts
skills/
bundled/
claude-api/
csharp/
claude-api.md
curl/
examples.md
go/
claude-api.md
java/
claude-api.md
php/
claude-api.md
python/
agent-sdk/
patterns.md
README.md
claude-api/
batches.md
files-api.md
README.md
streaming.md
tool-use.md
ruby/
claude-api.md
shared/
error-codes.md
live-sources.md
models.md
prompt-caching.md
tool-use-concepts.md
SKILL.md
typescript/
agent-sdk/
patterns.md
README.md
claude-api/
batches.md
files-api.md
README.md
streaming.md
tool-use.md
verify/
examples/
cli.md
server.md
SKILL.md
tools/
TungstenTool/
TungstenTool.ts
WorkflowTool/
constants.ts
types/
connectorText.ts
utils/
context.ts
debug.ts
handlePromptSubmit.ts
model/
model.ts
providers.ts
modifiers.ts
tsconfig.json
README.mdยฉ 2026 Flowy ยท Free and open source
Built for Claude Code ยท Not affiliated with Anthropic