Skip to content

sparklingneuronics/claude-code-helpers

Repository files navigation

claude-code-helpers -- Pin Claude Code to a Specific Model

Install pinned Claude Code launchers to keep using an older Opus model after Claude Code moves to a newer default. Your regular claude command continues to auto-update normally.

Launcher Pins to Claude Code Model ID Install dir (macOS/Linux)
claude47 Opus 4.7 2.1.153 claude-opus-4-7[1m] ~/.local/share/claude47
claude46 Opus 4.6 2.1.110 claude-opus-4-6[1m] ~/.local/share/claude46

claude vs claude46 side by side

This project is not affiliated with Anthropic. Claude and Claude Code are Anthropic products/trademarks. This repository only provides helper scripts for installing and launching Claude Code.

Published by Sparkling Neuronics · GitHub


claude47 -- Pin Claude Code to Opus 4.7

install-claude47.sh installs a pinned Claude Code launcher named claude47.

It is intended for users who want to keep running Claude Opus 4.7 after Opus 4.8 became the default, while leaving the regular claude command free to auto-update.

On macOS/Linux, the script installs:

  • Claude Code 2.1.153
  • Launcher command: claude47
  • Default model: claude-opus-4-7[1m]
  • Binary path: ~/.local/share/claude47/claude-2.1.153
  • Launcher path: ~/.local/bin/claude47

(Native Windows install layout is described in the Windows section.)

The launcher sets DISABLE_AUTOUPDATER=1 and DISABLE_UPDATES=1, so claude47 stays pinned (background auto-updates blocked, and an explicit claude47 update is a no-op). Your normal claude command is not modified.

Install claude47

Run the installer directly from GitHub:

curl -fsSL https://raw.githubusercontent.com/sparklingneuronics/claude-code-helpers/main/install-claude47.sh | bash

If you prefer to inspect the script before running it:

curl -fsSL https://raw.githubusercontent.com/sparklingneuronics/claude-code-helpers/main/install-claude47.sh -o install-claude47.sh
less install-claude47.sh
bash install-claude47.sh

Install claude47 locally

From this repository:

chmod +x install-claude47.sh
./install-claude47.sh

If ~/.local/bin was not already on your PATH, open a new terminal after installation or run:

export PATH="$HOME/.local/bin:$PATH"

The installer appends that export PATH=... line to ~/.zshrc only. If your shell is bash (common on Linux), add the same line to ~/.bashrc or ~/.bash_profile yourself.


claude46 -- Pin Claude Code to Opus 4.6

install-claude46.sh installs a pinned Claude Code launcher named claude46.

It is intended for users who want to keep running Claude Opus 4.6 after Opus 4.7 became the default, while leaving the regular claude command free to auto-update.

On macOS/Linux, the script installs:

  • Claude Code 2.1.110
  • Launcher command: claude46
  • Default model: claude-opus-4-6[1m]
  • Binary path: ~/.local/share/claude46/claude-2.1.110
  • Launcher path: ~/.local/bin/claude46

(Native Windows install layout is described in the Windows section.)

The launcher sets DISABLE_AUTOUPDATER=1 and DISABLE_UPDATES=1, so claude46 stays pinned (background auto-updates blocked, and an explicit claude46 update is a no-op). Your normal claude command is not modified.

Install claude46

Run the stable installer directly from GitHub:

curl -fsSL https://raw.githubusercontent.com/sparklingneuronics/claude-code-helpers/v0.1.0/install-claude46.sh | bash

If you prefer to inspect the script before running it:

curl -fsSL https://raw.githubusercontent.com/sparklingneuronics/claude-code-helpers/v0.1.0/install-claude46.sh -o install-claude46.sh
less install-claude46.sh
bash install-claude46.sh

To run the latest version from main instead:

curl -fsSL https://raw.githubusercontent.com/sparklingneuronics/claude-code-helpers/main/install-claude46.sh | bash

Install claude46 locally

From this repository:

chmod +x install-claude46.sh
./install-claude46.sh

If ~/.local/bin was not already on your PATH, open a new terminal after installation or run:

export PATH="$HOME/.local/bin:$PATH"

The installer appends that export PATH=... line to ~/.zshrc only. If your shell is bash (common on Linux), add the same line to ~/.bashrc or ~/.bash_profile yourself.


Use

Start a pinned launcher:

claude47
claude46

Check the installed version:

claude47 --version
claude46 --version

Your regular Claude Code installation remains available separately:

claude

Default Model (override per run)

Each launcher defaults to its pinned model (claude-opus-4-7[1m] for claude47, claude-opus-4-6[1m] for claude46). Whether your account actually gets the 1M context window depends on your Anthropic plan/tier.

For a single run, pass a different model:

claude47 --model sonnet
claude46 --model claude-opus-4-6

CLI arguments take precedence over the default model set by the wrapper.

Reinstall

Run the relevant installer again:

./install-claude47.sh
./install-claude46.sh

This replaces the pinned binary and launcher at the same paths.

Uninstall

Remove the pinned binary and launcher for whichever version you want to uninstall.

macOS / Linux / WSL:

# claude47
rm -f "$HOME/.local/bin/claude47"
rm -rf "$HOME/.local/share/claude47"

# claude46
rm -f "$HOME/.local/bin/claude46"
rm -rf "$HOME/.local/share/claude46"

Optionally remove this line from ~/.zshrc if you no longer need it:

export PATH="$HOME/.local/bin:$PATH"

Native Windows:

# claude47
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\claude47"

# claude46
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\claude46"

Optionally remove the corresponding %LOCALAPPDATA%\claude4X\bin entry from your user PATH via System Properties > Environment Variables.

Requirements

  • macOS or Linux (including WSL)
  • curl
  • bash
  • ~/.local/bin on your PATH

For native Windows, see Windows below.

Windows

The bash installers do not run on native Windows. Use one of these paths:

Inside WSL (recommended)

Open a WSL shell and follow the bash install steps above. The bash script identifies WSL as Linux, and the launcher will be available from your WSL terminals.

Native Windows: PowerShell installers

The PowerShell installers pin @anthropic-ai/claude-code via npm into an isolated prefix, write a .cmd wrapper that sets DISABLE_AUTOUPDATER=1, DISABLE_UPDATES=1, and the appropriate ANTHROPIC_MODEL, and add the bin directory to your user PATH. No admin rights needed. Your global claude (if any) is untouched.

Launcher Script Install prefix npm package version
claude47 install-claude47.ps1 %LOCALAPPDATA%\claude47\ @anthropic-ai/claude-code@2.1.153
claude46 install-claude46.ps1 %LOCALAPPDATA%\claude46\ @anthropic-ai/claude-code@2.1.110

Prerequisites:

  • Node.js 18+ and npm
  • Git for Windows (Claude Code requires Git Bash on native Windows; set CLAUDE_CODE_GIT_BASH_PATH if Git is installed in a nonstandard location)

Quick install from PowerShell:

# claude47
irm https://raw.githubusercontent.com/sparklingneuronics/claude-code-helpers/main/install-claude47.ps1 | iex

# claude46
irm https://raw.githubusercontent.com/sparklingneuronics/claude-code-helpers/v0.2.0/install-claude46.ps1 | iex

Or from cmd.exe:

REM claude47
powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/sparklingneuronics/claude-code-helpers/main/install-claude47.ps1 | iex"

REM claude46
powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/sparklingneuronics/claude-code-helpers/v0.2.0/install-claude46.ps1 | iex"

To run the latest from main instead, replace the tag with main in the URL.

Local install from a cloned repo:

install-claude47.cmd
install-claude46.cmd

Open a new terminal after install, then run the launcher.

Without installing (ad-hoc via npx)

For a one-off pinned session without installing anything globally:

PowerShell:

# Opus 4.7
$env:DISABLE_AUTOUPDATER="1"
$env:DISABLE_UPDATES="1"
$env:ANTHROPIC_MODEL="claude-opus-4-7[1m]"
npx --yes --package=@anthropic-ai/claude-code@2.1.153 claude

# Opus 4.6
$env:DISABLE_AUTOUPDATER="1"
$env:DISABLE_UPDATES="1"
$env:ANTHROPIC_MODEL="claude-opus-4-6[1m]"
npx --yes --package=@anthropic-ai/claude-code@2.1.110 claude

cmd.exe:

REM Opus 4.7
set "DISABLE_AUTOUPDATER=1"
set "DISABLE_UPDATES=1"
set "ANTHROPIC_MODEL=claude-opus-4-7[1m]"
npx --yes --package=@anthropic-ai/claude-code@2.1.153 claude

REM Opus 4.6
set "DISABLE_AUTOUPDATER=1"
set "DISABLE_UPDATES=1"
set "ANTHROPIC_MODEL=claude-opus-4-6[1m]"
npx --yes --package=@anthropic-ai/claude-code@2.1.110 claude

FAQ

How do I keep using Claude Opus 4.7 after Claude Code updated to Opus 4.8?

Install the claude47 launcher from this repo and run claude47 instead of claude. It installs Claude Code 2.1.153 and defaults the model to claude-opus-4-7[1m].

How do I keep using Claude Opus 4.6?

Install the claude46 launcher and run claude46. It installs Claude Code 2.1.110 and defaults the model to claude-opus-4-6[1m].

Does this support the 1M context window?

Both launchers set their model ID with the [1m] suffix, which requests the 1M context variant. Whether your account actually gets the 1M window depends on your Anthropic plan/tier.

Will this break my normal claude install?

No. The pinned launchers do not replace your normal claude binary -- they live at different paths. claude keeps updating, and the pinned launchers stay frozen. They do share Claude Code's per-user auth/config directory (~/.claude/ on macOS/Linux/WSL, %USERPROFILE%\.claude\ on native Windows), so logging in for one logs in for all.

How do I switch back to the latest Claude Code?

Just run claude as usual, or follow the commands in the Uninstall section for your platform.

Can I install both claude46 and claude47 at the same time?

Yes. They use separate install directories and separate launcher names, so they coexist without conflict.

Maintenance

This repository is shared as a small personal helper. Issues and pull requests may not be reviewed, and no maintenance, compatibility, or support commitment is implied.

License

This repository is licensed under the MIT License. The license applies only to the scripts and documentation in this repository. It does not apply to Claude Code or any Anthropic software downloaded by the helper script.

About

claude46 launcher for Claude Code: keep using Claude Opus 4.6 / claude-opus-4-6[1m] after Opus 4.7 updates. macOS, Linux, WSL, and native Windows.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors