If you already pay for Claude Code or Codex, you can run both inside Grok Bot’s virtual computer and use them as a fallback when your usual coding agents run out of credits. In this guide I’ll show you how I installed both tools from a single chat message, signed in with my existing subscriptions, fenced Claude Code off from files it shouldn’t touch, and set up a routing rule that picks the right tool for each task.
Prefer to watch? See the full walkthrough on YouTube. I build the whole thing on screen.
Why run Claude Code and Codex inside Grok Bot?
I use Grok Bot as my orchestrator. It takes the request, breaks it up, and hands the coding work to cloud agents. That works well until you hit a usage limit in the middle of a job. Rather than waiting for the limit to reset, I wanted Grok Bot to keep going with the coding tools I already subscribe to.
Grok Bot can open its own computer: a virtual desktop with a terminal. Anything you can install on a Linux machine, you can install there, including Anthropic’s Claude Code and OpenAI’s Codex CLI. Once they’re signed in, Grok Bot can drive them for you, and you can still open the terminal and use them yourself.
Step 1: Ask Grok Bot to open a computer and install both tools
You don’t need to type install commands yourself. In the chat, I asked my chief-of-staff bot to open a computer and install Codex and Claude Code there. It started both installs and confirmed that it hadn’t touched any API keys, just installed the tools.
That’s the behavior you want. Installing software and handling credentials are different jobs, and a well-behaved agent keeps them separate. If an agent asks you to paste a key into the chat when a normal sign-in flow exists, say no and use the sign-in flow.
Step 2: Sign in with your own accounts
Installing the tools isn’t enough. Neither one runs until you authenticate:
- Codex needs you to sign in with your ChatGPT account or an OpenAI API key.
- Claude Code needs you to sign in with your Anthropic account.
Ask Grok Bot to bring up the login screens, then switch to the computer tab and finish the sign-ins yourself. Expect a captcha or two. Once you’re done, ask it to confirm both tools are authenticated and run a simple hello-world test in each. In my case it caught that Claude Code wasn’t signed in yet, which saved me from finding out halfway through a real job.
If you’d like a guided walkthrough of these coding tools, the Claude Code and Codex courses in AI Income Lab cover setup, prompts and everyday workflows.
Step 3: Sandbox Claude Code before it writes any code
This was the most useful moment in the whole setup, and Grok Bot raised it on its own. Claude Code had started in its auto mode inside the shared workspace folder. In that mode it edits files and runs commands without asking each time. That shared folder also held my live email-sending scripts.
An agent that can run commands next to scripts that send real email is a risk you don’t need. The fix is simple:
- Create a separate project folder just for coding work.
- Point Claude Code at that folder instead of the shared workspace.
- Decide whether auto mode should stay on. In my setup it came back on by default after a restart, and turning it off for good meant editing Claude Code’s settings file.
Do the same for Codex. Coding agents should work in a folder that holds only the project they’re changing, never next to scripts that send email, move money or publish content.
Step 4: Make them the fallback when your cloud agents run out
Next, tell Grok Bot when to use them. I asked it to keep the cloud agents as the default whenever I have credits, and to fall back to Codex and Claude Code when I run out. It saved that as a standing rule, so I don’t have to repeat it.
Then I put the fallback straight to work. I had three jobs running in parallel:
- An SEO audit of my two sites, using Treg for keyword and competitor data and Claude Code for the on-site checks.
- A list of open site fixes that Codex could handle, which came back as a ready-to-implement fix list.
- Content writing that had been running on cloud agents, now continued in Codex.
Grok Bot coordinated all three while Codex ran on one side of the terminal and Claude Code on the other.
Step 5: Route each task to the right tool and model
A fallback is good. Routing is better. I asked Grok Bot to set up a rule that picks Claude Code or Codex based on the task, and picks the model as well. There was no routing config on the machine yet, so it created a new rule file plus a small helper script, and said it would show me the command before running anything.
The rule is a plain markdown file, so it’s easy to read and edit. My version maps roughly like this:
- SEO audits go to Claude Code on Anthropic’s most capable model.
- English content goes to Claude Code on a mid-tier model.
- Bug fixes go to Codex on a strong coding model.
- Light tasks drop down to the lightest, cheapest model.
Model names and limits change often, so I’ve described the tiers rather than pinning exact model versions. Check what your Claude and ChatGPT plans include today, and update the rule file when they change. The principle stays the same: don’t spend your strongest model on small jobs.
Common mistakes to avoid
- Pasting API keys into chat. Use each tool’s sign-in flow from the computer tab instead.
- Skipping the test run. Ask for a hello-world test in each tool before you hand over real work.
- Leaving auto mode on in a shared folder. Move coding agents to a dedicated project folder first.
- Assuming a setting stuck. Some settings reset on restart. Check them after every restart.
- Routing everything to the top model. Match the model to the job, or your subscription limits will go fast.
- No written rules. Save the fallback and routing rules as files you can read, not as something you said once in chat.
Want help setting up your own routing rules? Ask inside AI Income Lab and build alongside other members.
Want help building this for your own business?
The video shows what’s possible. Inside AI Income Lab, the paid community from AI Automation Station, you get step-by-step courses, reusable templates, and a place to ask questions while you build. The courses walk you through builds like this one step by step. Over 2,900 members are already building with it, from $29 a month, and you can cancel anytime.
FAQ
Do I need separate API keys to use Claude Code and Codex in Grok Bot?
Not necessarily. You can sign in with your existing subscriptions: a ChatGPT account for Codex and an Anthropic account for Claude Code. Codex also accepts an OpenAI API key if you prefer usage-based billing.
Does using them inside Grok Bot cost extra?
The tools use your own Claude and ChatGPT plans, so their usage counts against those plans. Grok Bot’s own work, such as orchestrating and running the virtual computer, uses your Grok Bot allowance. Check both plans’ current limits.
Is Claude Code’s auto mode safe?
It’s useful, but it lets Claude Code edit files and run commands without asking each time. Use it only inside a folder that holds nothing you’d mind it changing, and keep it away from scripts that send email or touch production.
Can I still use the terminal myself?
Yes. The tools run in a normal terminal on the virtual computer, so you can open it and work directly. I still prefer to give requests to Grok Bot and let it coordinate the jobs.
What happens when my cloud agent credits come back?
With the rule I set up, cloud agents stay the default whenever credits are available, and Codex and Claude Code only take over when they run out.
Conclusion
Running Claude Code and Codex inside Grok Bot turns subscriptions you already pay for into a safety net, so a usage limit doesn’t stop your work. Install both, sign in yourself, move them into their own project folder, and write down a fallback and routing rule. Watch the video above to see the whole setup on screen.
If you’d rather not figure this out alone, AI Automation Station has a paid community for it: AI Income Lab. It’s where the courses, templates and help that go with these builds live, with 2,900+ members, from $29 a month, cancel anytime.
Leave a Reply