Teaching AI to Run OpenCode
43sThis segment sets up a high-level, futuristic concept of an AI agent autonomously teaching itself to run benchmarks, which is both educational and inspiring for tech audiences.
▶ Play Clip"Delivers exactly what the title promises — a clear tutorial on running OpenCode inside a Claude Code agent."
The video demonstrates how to build a new skill for an autonomous Claude Code AI agent that can run OpenCode CLI with different LLM models via OpenRouter. The agent runs multiple models in parallel on the same creative prompt, generates HTML outputs, and autonomously creates a grid-style comparison video using Remotion.
Teach the AI agent to run OpenCode with specific models (e.g., GLM5, Opus 4.6) in parallel, store outputs (HTML), and turn them into a grid video using Remotion for comparison.
First step: fetch OpenCode CLI documentation to find the correct flag for running a model and prompt from the command line.
Using Claude Code with the documentation to figure out the command: 'opencode run -m provider/model prompt'. Tested with the prompt 'Should I walk or drive to the car wash? It's 50 m away.'
Confirmed that Gemini 3 Pro correctly suggested driving, while other models had different responses. Validated the command format.
Saved the successful approach as a Claude Code skill: 'skills/open_code_test_skill.md', enabling parallel runs across multiple models with the same prompt.
Set up an experiment with four models (GLM5, Minimax 2.5, Gemini 3 Pro, Opus 4.6) on a prompt to build a retro arcade space game in a single HTML file. Ran them in parallel.
Used an existing Remotion skill to combine the four HTML outputs into a grid-style comparison video with model names displayed.
The agent successfully created the MP4 video and drafted a post on X with the video and comparison text. The full pipeline from prompt to social media draft is automated.
The skill enables autonomous benchmarking of LLMs on creative tasks by running OpenCode in parallel, generating visual outputs, and sharing results. This demonstrates a practical way to extend an AI agent's capabilities.
What is the format of the OpenCode CLI command to run a model with a prompt?
opencode run -m provider/model 'prompt'
04:10
Which model correctly suggested driving to the car wash for the distance of 50 m?
Gemini 3 Pro
04:49
What tool is used to combine multiple HTML outputs into a grid-style video?
Remotion
08:11
Name two models tested in the creative benchmark.
GLM5, Minimax 2.5, Gemini 3 Pro, Opus 4.6 (any two)
07:00
What is the purpose of the skill created in the video?
To run OpenCode with multiple models in parallel on the same prompt, generate HTML outputs, and autonomously create a comparison video.
00:02
Agent skill for parallel LLM benchmarking
Demonstrates a practical method to automate LLM comparison using an AI agent.
00:02Model behavior varies by reasoning
Highlights that different LLMs give different answers to the same simple prompt, which is useful for benchmarking.
04:22Parallel execution of multiple models
Shows how to run multiple models concurrently to save time, a key advantage of automation.
06:25Full pipeline from prompt to social media
Completes the entire workflow: generate content, create video, and draft a social media post autonomously.
10:52[00:02] So today, this is what we are going to try to teach our AI agent. So if you didn't know, my AI agent is kind of running on its own Mac Mini here. And today, we want to try to teach it a new skill I've been playing around with. So
[00:14] basically, I'm just going to go through here how we are going to do this or how here how we are going to do this or how my plan to execute this skill. So since our AI agent is running on cloud code, we want cloud code to be able to run
[00:27] open code because we want to do some benchmark testing on different creative task. So we want cloud code to be able to run open code with a specific model. So this could be GLM5, Opus 4.6. And we can do this in parallel. So we can do
[00:43] can do this in parallel. So we can do like a same prompt with let's say five different models. And we just store the output, we save it. Let's say that's an output, we save it. Let's say that's an HTML file. And from this HTML file, this
[00:55] could be like create a Space Invader game that runs autonomous, right? And we save all of those HTML files in like a folder. And from there, uh, the agent can use Remotion to turn those into like a grid style video. I'm going to put one
[01:10] up on the screen here so you can see what I mean. And this video can now be autonomously posted on X comparing all the models with the prompt, right? And you can see what kind of model it is and how they yeah uh compared to each other
[01:25] running on the same prompt. So basically this is a way to automate the system creating the video posting it. So this should be a skill for our AI agent. understandable. So, I'm just going to go
[01:38] through today how I do this when I try to create a new skill and we're going to test kind of the full workflow. So, let's just head over to the Mac Mini and see yeah if we can do this. Okay, so now the first thing we need to do is to
[01:52] start building our skill. We need some documentation because we need to figure documentation because we need to figure out how we can run open code uh in kind of yeah, I would say like a CLI style. We don't really have to go into the tool
[02:04] to actually run some commands. I think there is a flag for this. So what I want to do now is just go to the open code documentation. I think if we go to CLI here, you can see we have a bunch of flags here. So I can zoom in a bit for
[02:19] you. So you can see we have all the flags we need here. So I think there's a flag called run. But let's just grab all this documentation here for cloud code. And we can kind of look inside this documentation. So let's just head back
[02:33] documentation. So let's just head back to cursor here. Let's go to our to cursor here. Let's go to our docs and let's call this uh open code MD documentation. So now we have some
[02:46] documentation and I guess we can now just start asking cloud code how we actually can do this. So let me come up with the prompt here. Okay, so the the documentation we just fetched. Find a way to run open code with a set model
[02:59] and a prompt from cloud code. So, we want to be able to run open code from want to be able to run open code from cloud code. Uh, for example, launch open code with the open router GLM model with the prompt, should I walk or drive to
[03:11] the car wash? It's 50 m away. Test it also. So, I just want to show you that I am already logged into open code in this uh in this browser. So, I kind of put in my open router API key. So, we can switch between models and run open code
[03:27] using open router. Okay. So let's see now if claude code can figure out uh to running this by using the documentation here. I think the flag is called something like open code dash run-od or something like that. But let's just
[03:43] see what claude comes up with here and then we're going to test this and we're going to turn it into a skill we can use for the automated testing later. Okay. figured it out now. You can see it's running like a bash command here to
[03:55] check all the models from open router. And it already figured out we can do the -ash run m uh command. And here you can see the GLM file. And now it's going to try to run this. Should I walk or drive
[04:08] to the car wash? It's using bash to actually send this. And you can see works perfectly. Yes, we got it. So you can see the command format was open code run- model provider model and the prompt. So that's pretty simple. And the
[04:22] response we got was you should walk to the car wash. I just saw this on X someone running this test. And yeah, that was a bit strange. So now I'm just going to try to do good. Let's test it on Gemini 3 Pro because I think I read
[04:35] somewhere that Gemini Pro will suggest, of course, you have to drive to the car wash. You can't just walk to the car wash. So let's see if we can execute this with the Gemini 3 Pro here. Yeah, it found the model. Okay, so let's run
[04:49] the command. Okay, perfect. So that is what I was looking for. Gemini returns drive. You can't wash the car if you leave it behind. Yes, that is exactly what I was looking for. So now that we have a way to kind of run open code from
[05:04] um from code, we can start honing out the skill here. So I'm just going to do now. Then I'm going to show you how we're going to do this in parallel and actually running some creative HTML benchmarks. So I'm just going to do
[05:20] great job. Now let's turn this into a cloud skill under skills open code test skill MD add the workflow to run different models from open router uh to models in parallel with the same prompt for testing. Create a skill for future
[05:34] use. Okay, so hopefully now we can just save the way we did this and then we can kind of expand trying to create the creative HTML benchmark. Now you can see cloud code suggest to create this open code skill.
[05:48] Run the same protocols multiple open router models in parallel with open code CLI. Yeah, that is perfect. So we have bash read, right? Okay. So yeah, this is the skill we want to save. So I'm just going to save that. And now we're going
[06:01] to try to adjust it a bit so we can bring in our creative um tests and we're going to assign it to like a specific folder name for the output. So I'm just
[06:13] here and we're going to try to set up an experiment with four different models in be a bit big now but basically the idea is that we can do like the creative LLM
[06:25] benchmark tests now uh with the prompt. So I'm not going to read the full prompt here but basically create a single HTML file with a full screen animated retro arcade space battle scene and we kind of do the full prompt here what we wanted
[06:38] to do. So this could be like a set prompt we have for all future task. And prompt we have for all future task. And I said save this as task-model in at llm test. This is where I want to store this. For example, game atg glm5.html.
[06:53] Um the user will specify what models to run for kind of the parallel test. Uh use the set format naming in the prompt adjust uh each model of course u adjusted to each model call of course. So let's test this on GLM 5, Minimax
[07:09] So let's test this on GLM 5, Minimax 2.5, Gemini 3 Pro, and Opus 4.6. Look up the model names before beforehand to get it correct. Run in parallel. So basically this is what we want uh cloud code to do autonomously. So we can just
[07:24] give it like a task run this test on uh these five four models. And we want the result and the benchmark and of course the video generation later to be automated. So you can see now let me run all the four models in parallel with the
[07:39] same prompt. And yeah, we're going to do that. So hopefully now each prompt has the specified naming output and this will just speed up everything because we are running everything in parallel. So what I want to see now in our LLM test
[07:56] folder here, yeah, we have some files here before, but let's see if we get the four HTML files here now. So we can turn those into the grid style video. Okay, so you can see now all the tests we ran in parallel was done. So do you want to
[08:11] open all this so we can compare them? Uh, yes. Let's do that. And after that, now we're going to use that remotion skill. this we already have this skill and we're going to turn this into like a video. So here we can see all the HTML
[08:27] we created. This was Opus. This is uh Gemini Gemini Miniax and this is GLM5. Damn, that looks good to be honest. So now that we have all these HTML files here, what we
[08:41] can do now is turn this into like this grid video. And this is a very cool way to kind of benchmark this. So, let's do that now. Uh, I'm just going to close that now. Uh, I'm just going to close this. Okay. Uh, let's close this. And
[08:54] now we just gonna, uh, since we already have that skill, I'm just going to use that. But basically, it's just remotion taking all of those HTML files and turning those into this grid system with just the name
[09:09] of the the model. So, we can get everything in together into one video and we can kind of compare them side by side. So, I'm just going to refer to my remote skill here to create those videos. So, I'm just going to upgrade
[09:24] videos. So, I'm just going to upgrade the LLM bench skill.md file uh with the open code test skill. So, now we can just run the the open code test that we did now with those four models and we autonomously turn those results into our
[09:39] emotion video. I think that's a good way to do this. And yeah, and let's create the video and let's take a look at it before we do the last part that is going to be to actually set up like a a way just to post this on social media or
[09:55] share this. Okay. Okay, perfect. So now you can see we have kind of merge this skill into one because I don't think we need both. So now let's create the MP4 file for a space game test with all those models just so we can have like an
[10:08] those models just so we can have like an output file here. we can check and uh yeah that should be basically it uh is that should be basically it and after that uh I guess I don't really like a new skill to actually to post this you
[10:23] can see we have the skill we have the retrospace benchmark we have everything put together into one HTML file and now we can just turn this into an MP4 video
[10:35] and this is a pretty cool skill to have to test different type of models using cloud code via open router uh with the same prompts in parallel. Okay, so you just going to say open the video so we can check it out. And the final step now
[10:52] is just going to let's play it. Yeah, that is working. Perfect. Now you can see retro space battle benchmark. We have the GLM miniax cloth opus and Gemini 3 Pro. Okay. So, yeah, pretty good. So, basically the
[11:11] So, yeah, pretty good. So, basically the last step now is just to tell our agent uh compose, not compose, post this uh on X
[11:23] not compose, post this uh on X uh as a test. Uh but don't click post. I'm not going to post this, but just create a draft, I guess. create a draft of the video plus the text. So this
[11:36] could also be in the pipeline when we run this test. We can just autonomously run this test. We can just autonomously share this on X with our agents account. And you can see this is just probably going to inject the video now and it's
[11:48] going to do some kind of text, I guess. Okay. So you can see we pushed in the video. Good. That's the 15 second clip. And this is uploading. So this is the benchmark comparison.mpp4. Uh, now we're just going to do the text,
[12:01] I guess. Okay, so it's just going to say, "Gave four LLMs the same prompt. Build a retro arcade space game demo in a single HTML 5. Here's how GLM 5, Minimax 2.5, Gemini 3 Pro, and Claude Opus did side by side." Okay, that's
[12:14] pretty good. I kind of like that. I think that's a way good way to do this. So, yeah, overall pretty happy with this skill and this is something I'm going to be using more going forward. So hopefully this gave you some inspiration
[12:27] hopefully this gave you some inspiration on how you can start creating different skills that uh your agent can take advantage of. So I was thinking actually for today's video that I wanted to do like um a different type of skill where
[12:41] I kind of see if I can be like an accountant uh picking up like uh invoices from emails running like a free accounting software. But that's going to be another video because I think this was pretty interesting too. And I'm
[12:54] this because this is something I'm going to give my agent the op option to do. So each time there's a new model, we can run this more creative HTML tests and we can share the results very easily with this automated setup. So pretty cool
[13:10] this automated setup. So pretty cool that cloud code can run open code in uh open with open router and set different models and it can run it in parallel with uh the same prompt. So we can get the outputs in this very visual way
[13:23] here. So super happy how it turned out and like I said hope this gave you some inspiration to start setting up your dedicated AI agent. So if you want more content like this just uh give me give this video a like and subscribe and I'm
[13:38] going to keep posting how this agent evolve. We're going to do a 4 week experiment. I think we are like 12 13 days in now. So I'm going to keep it up. So yeah, thank you for tuning in. Have a great day and I'll see you again. Yeah.
⚡ Saved you 0h 13m reading this? Transcribe any YouTube video for free — no signup needed.