forked from FlorianBruniaux/claude-code-ultimate-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsonnetplan.sh
More file actions
32 lines (31 loc) · 1.18 KB
/
Copy pathsonnetplan.sh
File metadata and controls
32 lines (31 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
# sonnetplan — Budget hybrid mode: Sonnet 4.6 (plan) + Haiku 4.5 (act)
#
# How it works:
# Claude Code's `opusplan` alias routes to Opus (plan) + Sonnet (act).
# By remapping the environment variables that resolve the `opus` and `sonnet`
# aliases, we effectively create a cheaper Sonnet→Haiku hybrid.
#
# Usage:
# sonnetplan # Start Claude in current directory
# sonnetplan --project /path # Start in specific project
#
# Installation:
# Add this function to your ~/.zshrc or ~/.bashrc:
#
# source /path/to/sonnetplan.sh
#
# Or copy the function body directly into your shell config.
#
# Verification:
# After running `sonnetplan` and typing `/model opusplan`, check the
# status bar — it should show "Model: Sonnet 4.6" in plan mode.
# Do NOT rely on asking the model "what model are you?" — that self-report
# is unreliable. Use the status bar or your billing dashboard instead.
#
# GitHub issue tracking native support: https://github.com/anthropics/claude-code/issues/9749
sonnetplan() {
ANTHROPIC_DEFAULT_OPUS_MODEL=claude-sonnet-4-6 \
ANTHROPIC_DEFAULT_SONNET_MODEL=claude-haiku-4-5-20251001 \
claude "$@"
}