agentleFS
dzianisvdzianisv/skills/skills/claude-max/SKILL.md

claude-max

Skill4 starsChanged 3 months agoMITView on GitHub

Configure and activate the Claude Max subscription proxy so the agent runs on Claude Opus 4 at flat-rate cost instead of per-token Azure billing. Use when the user says "configure Claude Max", "use my subscription", "set up Claude Max", or asks why the agent is using GPT/Azure instead of Claude.

  • Installs packages

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Wait for the user's reply before continuing.

    line 38
  2. Very specific:

    If it prints FAIL, tell the user the code may have expired and restart from Phase 1.

    line 55
  3. Distinctive:

    If the script exits 0, confirm to the user: "Done — your agent is now running on Claude Opus 4 via your Max subscription."

    line 73
  4. Distinctive:

    If the user wants to go back to the LiteLLM-hosted models:

    line 100

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Claude Max Subscription Setup

Connects this OpenClaw tenant to the user's Claude Max subscription via the claude-max-api-proxy (a local OpenAI-compatible server that routes through the Claude Code CLI). After setup the default agent model switches to Claude Opus 4 and all agent usage is billed to the flat-rate subscription rather than per-token.

Prerequisites

  • Claude Max or Claude Pro subscription at claude.ai
  • claude-max-api-proxy and claude CLI are pre-installed on this VM (which claude-max-api && which claude — both should resolve)

Setup Flow

The setup has three phases. Work through them in order.


Phase 1 — Start auth (get the URL)

bash ~/.openclaw/skills/claude-max/auth-flow.sh start

This prints a single https://claude.com/cai/oauth/authorize?… URL. Send that URL to the user and ask them to:

  1. Open it in their browser (logged in to their Claude account)
  2. Click Authorize
  3. Copy the authentication code shown on the next page and reply with it

Wait for the user's reply before continuing.


Phase 2 — Submit the code

Once the user sends back the code, run:

bash ~/.openclaw/skills/claude-max/auth-flow.sh submit <CODE_FROM_USER>

Expected output (success):

OK logged_in=true email=<user@example.com> subscription=max

If it prints FAIL, tell the user the code may have expired and restart from Phase 1.


Phase 3 — Enable the proxy and switch the model

bash ~/.openclaw/skills/claude-max/auth-flow.sh enable claude-opus-4

This:

  1. Starts the claude-max-api systemd service (proxy on localhost:3456)
  2. Health-checks the proxy (/health → {"status":"ok"})
  3. Updates models.providers.openai to point at localhost:3456
  4. Sets agents.defaults.model.primary to openai/claude-opus-4
  5. Validates the config and restarts the gateway atomically

If the script exits 0, confirm to the user: "Done — your agent is now running on Claude Opus 4 via your Max subscription."


Check status at any time

bash ~/.openclaw/skills/claude-max/auth-flow.sh status

Choosing a different model

Pass a model ID to enable:

Model IDNotes
claude-opus-4Most capable, default choice
claude-sonnet-4Faster, good for most tasks
claude-haiku-4Fastest, lightweight tasks
bash ~/.openclaw/skills/claude-max/auth-flow.sh enable claude-sonnet-4

Reverting to the hosted model catalog

If the user wants to go back to the LiteLLM-hosted models:

openclaw config set agents.defaults.model.primary "litellm/gpt-5.3-codex"
openclaw config set models.providers.openai.baseUrl "${LITELLM_BASE_URL}" 
openclaw config validate
bash ~/.openclaw/skills/openclaw-config/safe-restart.sh --reason "revert to LiteLLM"
sudo systemctl stop claude-max-api

Troubleshooting

SymptomFix
which claude failsnpm install -g @anthropic-ai/claude-code
Proxy starts but authentication: FAIL in logsRe-run Phase 1+2
curl localhost:3456/health times outsudo systemctl status claude-max-api — check logs
Gateway unhealthy after enableauth-flow.sh auto-rolls back config; check journalctl -u openclaw-gateway -n 50
Code expired or wrong challengeAlways use the code from the most recent start run

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.