Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Agentic Coding with OpenCode + MiniMax

A team guide for running AI coding agents cheaply and in parallel, based on hands-on experience.

Why we switched

GitHub Copilot changed its pricing model. As of April 27, 2026 it moved from request-count pricing to token-based billing — which quietly slashed how much real work each dollar buys. The same monthly spend now gets you noticeably fewer agentic tasks before you hit limits.

MiniMax token plans deliver multiples more usable agentic coding at the same price point. Paired with OpenCode (an open-source terminal/IDE AI coding agent), you get a setup that is cheaper per task, runs multiple agents in parallel, and isn’t locked to a single editor vendor.

This guide is how the team should set it up and use it.

Want to see it in action? Read Debugging a Real Issue with an AI Agent — a real end-to-end case (vague finance report → kubectl investigation → wrong-then-corrected diagnosis → fix + tests + PR → review). This guide is the setup; that one is the workflow in action.


What you need

ToolPurpose
OpenCodeThe AI coding agent (CLI + TUI + VSCode integration)
MiniMax token planThe model provider that powers the agent
VSCodeWhere we run OpenCode day-to-day
Git worktreesKeeps parallel agents from colliding

1. Set up OpenCode

Team shortcut: instead of the manual steps below, run our one-command installer — it sets up opencode + the shared LiteLLM provider + superpowers + caveman in a single shot:

bash <(curl -fsSL https://raw.githubusercontent.com/hungryhub-team/opencode-ai-setup/main/setup.sh)

See opencode-ai-setup — Team Onboarding for what it does and troubleshooting.

Read the official docs for anything the installer doesn’t cover:

Follow the install steps there, then connect it to MiniMax (next section).


2. Get a MiniMax seat

  • The CTO owns the MiniMax token plan and buys the seats centrally. Plan reference: https://platform.minimax.io/subscribe/token-plan
  • You don’t buy your own. To get access, request a seat from the CTO — seats are assigned one by one.
  • Heavy usage is fine. If your seat’s allowance isn’t enough for your workload, tell the CTO — we’re happy to size the plan up when the usage is real and productive.

Get your subscription key

Once you’ve been assigned a seat, grab your key from the MiniMax console:

  1. Open the Plan details page: https://platform.minimax.io/console/plan
  2. Find the Subscription Key (sk-cp) — it’s labeled:

    For Token Plan / credits calls; cannot be used for pay-as-you-go

  3. Copy the key. It looks like sk-cp-… (a long string).

Use the sk-cp Subscription Key, not a pay-as-you-go key — the token-plan credits only work through this key.

Wire it into OpenCode’s auth/config as the OpenCode docs describe. Never commit it to a repo and never paste it into chat/screenshots.


3. Pick the right model (keep token usage low)

MiniMax gives you two model tiers. Choosing the right one per task is the single biggest lever on your token spend. Treat it exactly like choosing Claude Sonnet vs Opus: default to the cheap one, escalate only when the task needs reasoning, not just typing.

m2.7 — the default workhorse (like Sonnet)

Use for easy / medium tasks — anything where the path is already clear and the agent is mostly typing:

  • Boilerplate, CRUD, scaffolding
  • Single-file edits, renames, formatting, comment cleanup
  • Writing tests for code that already exists
  • Following a clear spec where the approach is obvious
  • Mechanical refactors (extract a function, move a file)
  • Bug fixes where you already know the cause

m3 — escalate only when needed (like Opus)

Use for high / hard tasks — anything that needs judgment or deep reasoning:

  • Architecture and system-design decisions
  • Cross-file refactors where you don’t know the blast radius
  • Debugging a weird bug with an unknown root cause
  • Ambiguous requirements that need interpretation
  • Planning a multi-step feature before writing code
  • When m2.7 already tried and produced wrong or confused output

How to switch models

In an OpenCode session, run the /models command to open the model picker, then choose m2.7 or m3. Switch any time mid-session — e.g. flip to m3 to plan a hard refactor, then back to m2.7 to implement it.

Rule of thumb

Start every task on m2.7. Bump to m3 (via /models) only when the task needs thinking, not typing. Once m3 has produced the plan or cracked the hard part, switch back to m2.7 to do the actual implementation. This keeps token burn low.


4. Run multiple agents in parallel (VSCode workflow)

This is the productivity multiplier. You can have several agents working on different projects at once.

How:

  1. In VSCode, open the command palette and run > OpenCode: Open in New Tab.
  2. Each tab is an independent agent session — point each one at a different project or task.
  3. Use git worktrees so the agents never fight over the same working tree. Each agent gets its own isolated checkout. (See the worktree workflow in AGENTS.md at the workspace root — create them under .worktrees/.)

Limits from experience:

  • Cap it at ~3 tabs. Beyond 3 parallel agents it gets hard to track what each one is doing, and review quality drops. 3 is the sweet spot.
  • One worktree per agent. Don’t run two agents in the same directory.
VSCode
├── Tab 1 → agent on repo-A worktree   (m2.7, easy task)
├── Tab 2 → agent on repo-B worktree   (m3, hard refactor)
└── Tab 3 → agent on repo-C worktree   (m2.7, writing tests)

Install Superpowers — a very popular collection of software-development skills for AI coding agents. It bundles proven workflows (brainstorming, planning, TDD, debugging, code review, and more) that the agent pulls in automatically when relevant.

It helps a lot: instead of the agent improvising, it follows battle-tested processes. Follow the install instructions in the repo’s README.


6. Let the agent run the CLIs — don’t relay through ChatGPT

The agent is most effective when it can execute tools directly and act on what it finds. Give it permission to run the CLIs you’d run yourself:

  • gh (GitHub) — PRs, issues, CI runs
  • aws (AWS) — pull resource state, logs, identity
  • kubectl (Kubernetes) — inspect clusters, pods, logs
  • aiven (Aiven) — managed DB / service state
  • cloudflare / wrangler (Cloudflare) — DNS, workers, cache
  • …or any other CLI that gets the job done

The key habit: when the agent returns output, don’t copy-paste it into ChatGPT to “discuss” what to do next. Discuss it with the agent directly inside OpenCode / Claude Code. Let the agent pull the data itself, verify against the live service, and plan the next step in the same loop. Round-tripping through another chat breaks that loop — the agent loses context and can’t act on its own findings.

Still respect the safety rails in AGENTS.md: confirm the active gh / aws / kubectl profile/context before destructive commands, and never run terraform destroy, kubectl delete, or prod changes without explicit human approval.


7. Add automated tests to your project

AI agents work best with optimistic changes — they can move fast and refactor boldly when a test suite catches regressions. Without tests, every change is a guess.

  • If your project already has tests: point the agent at them. It can run the suite, read failures, and self-correct.
  • If your project has no tests: adding automated tests is your first task. Before asking the agent to build features on an untested codebase, have it write a baseline test suite. That suite becomes the safety net that makes every later agentic change safe.

A good loop: agent makes a change → runs the tests → reads failures → fixes → repeats, all without you babysitting each step.


Quick start checklist

  • Read https://opencode.ai/docs/
  • Install OpenCode + VSCode integration
  • Request a MiniMax seat from the CTO
  • Copy your sk-cp Subscription Key from https://platform.minimax.io/console/plan
  • Wire your assigned key into OpenCode auth (never commit it)
  • Default to m2.7; switch to m3 via /models only for reasoning-heavy tasks
  • Use > OpenCode: Open in New Tab + git worktrees for parallel work
  • Keep it to ~3 parallel agents
  • Install Superpowers
  • Let the agent run gh / aws / kubectl / aiven / cloudflare directly — discuss with the agent, not ChatGPT
  • Make sure your project has automated tests (add them first if it doesn’t)

Need more budget?

If you’re getting real value and your seat’s allowance isn’t enough, reach out to the CTO. We’d rather size up the plan when it’s genuinely productive than have you throttled mid-task.