Clone

git clone git@git.secluded.site:synclaude.fish.git

README

synclaude.fish

REUSE
status Liberapay donation status

A Fish wrapper for the claude CLI that routes requests through Synthetic.new, enabling use of models like GLM-4.6 through claude.

Invoking synclaude with the interactive i subcommand to override the default models. First question is how to override the models, selecting each individually or by group. After selecting group, the next question is which group, large -L or light -l or both. After selecting large, the next question is which model to use, presented as a list of IDs with fuzzy filtering. After typing "mmm2" for MiniMax M2, Claude Code starts. After typing Hi and getting a response and quitting Claude Code, synclaude shows how many requests were used during the session and how many are remaining.

tl;dr

  • Configurable defaults per model tier with persistent caching
  • Displays session usage and remaining API quota after each run
  • synclaude u shows current quota
  • Invoke as synclaude i for an interactive model picker with save-as-default option
  • Configure models by group or individually through the interactive picker or flags

Requirements

  • Fish
  • claude
  • gum - for TUI prompts and spinners
  • jq - for JSON parsing
  • curl - for API requests
  • SYNTHETIC_API_KEY environment variable

Installation

Using Fundle

Add to your ~/.config/fish/config.fish:

fundle plugin 'synclaude' --url 'https://git.secluded.site/synclaude.fish'
fundle init

Then reload your shell or run fundle install.

Configuration

Set your Synthetic API key in your ~/.config/fish/config.fish:

set -gx SYNTHETIC_API_KEY your_api_key_here

Usage

Check quota

Run with u subcommand to see current API usage:

synclaude u
# Usage:  42%  (580/1000 remaining)

Basic

Use synclaude exactly like you would use claude:

# TUI
synclaude

# Non-interactively
synclaude -p "What does functions/synclaude.fish do?"

Default Models

Tier Default Model
Opus hf:moonshotai/Kimi-K2-Thinking
Sonnet hf:zai-org/GLM-4.6
Haiku hf:deepseek-ai/DeepSeek-V3.1-Terminus
Sub-agent hf:zai-org/GLM-4.6

Defaults can be overridden with flags or saved persistently through interactive mode.

Interactive overrides

Launch the interactive picker with the i subcommand:

synclaude i
  1. Select whether to override models by group or by specific model
  2. Select which ones to override
  3. Select what to override them with (shows current defaults in header)
  4. Optionally save selections as new defaults

Flags

Group flags

Flag Short Description
--heavy -H Override Opus model
--medium -M Override Sonnet and Sub-agent models
--light -l Override Haiku model

Individual flags

Flag Short Description
--opus -o Override Opus model
--sonnet -s Override Sonnet model
--haiku -k Override Haiku model
--agent -a Override Sub-agent model

All other flags are passed through to the claude command.

CLI overrides with flags

By group

# Set heavy model (Opus) to a specific model
synclaude --heavy hf:moonshotai/Kimi-K2-Thinking "Your prompt"

# Set medium models (Sonnet, Sub-agent) to GLM-4.6
synclaude --medium hf:zai-org/GLM-4.6 "Your prompt"

# Set light model (Haiku)
synclaude --light hf:qwen/Qwen2.5-Coder-32B-Instruct "Your prompt"

# Combine groups
synclaude --heavy hf:moonshotai/Kimi-K2-Thinking --medium hf:zai-org/GLM-4.6 "Your prompt"

By individual model

# Override specific models
synclaude --opus hf:moonshotai/Kimi-K2-Thinking "Your prompt"
synclaude --sonnet hf:zai-org/GLM-4.6 "Your prompt"
synclaude --haiku hf:qwen/Qwen2.5-Coder-32B-Instruct "Your prompt"
synclaude --agent hf:zai-org/GLM-4.6 "Your prompt"

Individual overrides take precedence over group overrides, which take precedence over cached/fallback defaults.

How it works

synclaude configures the following environment variables before invoking claude:

  • ANTHROPIC_BASE_URL: Points to Synthetic's Anthropic-compatible endpoint
  • ANTHROPIC_AUTH_TOKEN: Your Synthetic API key
  • ANTHROPIC_DEFAULT_OPUS_MODEL: Model to use for Opus-tier requests
  • ANTHROPIC_DEFAULT_SONNET_MODEL: Model to use for Sonnet-tier requests
  • ANTHROPIC_DEFAULT_HAIKU_MODEL: Model to use for Haiku-tier requests
  • CLAUDE_CODE_SUBAGENT_MODEL: Model for sub-agent operations
  • CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: Disabled because telemetry bad

Caching

Model preferences are stored in ~/.config/synclaude/models.conf (respects XDG_CONFIG_HOME). Use interactive mode (synclaude i) to save new defaults.

After each run, it queries the Synthetic API to display:

  • Requests used during the session
  • Remaining quota (color-coded badge: green <33%, yellow 33-66%, red >66%)

Contributions

Patch requests are in amolith/llm-projects on pr.pico.sh. You don't need a new account to contribute, you don't need to fork this repo, you don't need to fiddle with git send-email, you don't need to faff with your email client to get git request-pull working...

You just need:

  • Git
  • SSH
  • An SSH key
# Clone this repo, make your changes, and commit them
# Create a new patch request with
git format-patch origin/main --stdout | ssh pr.pico.sh pr create amolith/llm-projects
# After potential feedback, submit a revision to an existing patch request with
git format-patch origin/main --stdout | ssh pr.pico.sh pr add {prID}
# List patch requests
ssh pr.pico.sh pr ls amolith/llm-projects

See "How do Patch Requests work?" on pr.pico.sh's home page for a more complete example workflow.