Skip to main content

moai cc / cg / glm Launchers

UPDATED 2026-08-08 4 min read EDIT ON GITHUB ↗

moai cc, moai cg, and moai glm are three launchers that run Claude Code with different backend configurations. All three adjust settings and then exec to replace the current process with Claude Code. Since which model does which work is what drives cost, the launcher choice is the first tokenomics decision.

The three launchers compared

LauncherBackendPurpose
moai ccClaude onlyStandard execution — every agent uses Claude models
moai glmGLM onlyEvery agent uses GLM models via the Z.AI proxy
moai cgClaude + GLM hybridLeader is Claude, teammates are GLM (60-70% cost reduction)

moai cc — Claude backend

bash
moai cc [-p profile] [-w [name]] [-- claude-args...]

Removes GLM-specific environment variables from .claude/settings.local.json, resets team mode if it was enabled, and then runs Claude Code.

FlagDescription
-p, --profile <name>Use a named Claude profile (~/.moai/claude-profiles/<name>/)
--permission-mode <mode>Specify the permission mode
-b, --bypassShorthand for --permission-mode bypassPermissions
-c, --continueContinue the previous session
-m, --model <model>Override the model selection
-w, --worktree [name]Launch inside an isolated git worktree (.claude/worktrees/<name>/) — name omitted means auto-generated
--chrome / --no-chromeToggle the Chrome MCP

The permission mode is one of default, acceptEdits (project default), plan, auto, bypassPermissions, dontAsk. The auto mode runs a background classifier that inspects actions and requires a Team plan + Sonnet/Opus 4.6 or later.

moai glm — GLM backend

bash
moai glm setup <api-key>   # Save API key (first time only)
moai glm                   # Run with the GLM backend
moai glm -p work           # Run with the 'work' profile
moai glm status            # Check credential status

Reads GLM credentials from ~/.moai/.env.glm, injects environment variables such as ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL, and then runs Claude Code.

SubcommandDescription
moai glm setup [api-key]Save the GLM API key
moai glm statusShow the current GLM credential status
Warning
GLM does not support the auto permission mode (it is a third-party provider). If you need auto, use moai cc or moai cg. Also, Z.AI has a low concurrent-request limit (1-3 in-flight on the paid tier), so for parallel multi-agent execution the moai cg hybrid mode is more stable.

moai cg — Claude + GLM hybrid

bash
moai cg [-p profile]

CG stands for “Claude + GLM”, a cost-optimized team configuration.

  • Leader (current tmux pane): uses Claude models (opus/sonnet)
  • Teammates (new tmux panes): use GLM models via the Z.AI proxy

On launch it validates the tmux session, removes the GLM environment in the leader pane (Claude), injects the GLM environment into the tmux session (teammates), and sets teammateMode=tmux and team_mode: cg.

Prerequisites:

  1. Set the GLM API key with moai glm setup <api-key>
  2. Run inside a tmux session for per-pane environment isolation

Profiles (-p flag)

All three launchers accept -p <name> to select a named profile, which sets CLAUDE_CONFIG_DIR to ~/.moai/claude-profiles/<name>/. Use this to keep multiple accounts / setting sets separate.

Isolated worktree (-w flag)

All three launchers accept -w [name] to start the session inside an isolated git worktree, collapsing the two-step cd then launch into a single command.

bash
moai cc -w feat-login    # Start in .claude/worktrees/feat-login/
moai cc -w               # Auto-generated name
moai glm -w feat-login   # Same for the GLM backend
moai cg -w feat-login    # Same for the hybrid

Behavior:

  • The worktree path is .claude/worktrees/<name>/. <name> is a worktree name — not a branch name and not a SPEC ID.
  • If a worktree of that name already exists it is reused rather than recreated, so this doubles as the re-entry path into a tree an earlier session was working in.
  • Omitting the name lets Claude Code generate one.
  • The -w=name, --worktree name, and --worktree=name spellings are all accepted and mean the same thing.
  • Arguments after -- pass through to Claude Code untouched and are unaffected by this rewrite.
Info
Naming the worktree after the SPEC ID (moai cc -w SPEC-XXX-001) lets a session handoff bring the next session back into the same working tree with one line.