CI-Runner Skill: Bring Your Own Compute for GitLab Pipelines
CI-Runner is a Claude Code skill that moves GitLab pipelines onto your own machine with one command, with Docker limits and a cleanup task so the machine stays usable. Real numbers, what broke, and a rebuild checklist.
We paid GitLab $0 for CI compute. Over three months our pipelines used about 24,000 minutes of compute on a machine we already owned, and GitLab does not count those minutes on any plan. Power for that machine is a separate cost, about $10 over the same period.
The reason is the meter. On GitLab’s hosted runners the Free plan gives 400 compute minutes a month, and AI coding agents use that fast: for our busiest group it ran out on day 21 in August, and on the first day of November. When the minutes are gone, jobs fail or wait, and the only way forward is to buy more. The pipelines were not the problem. The problem is that the meter grows with every agent you add, while a machine you already own does not charge per job.
GitLab plans in 30 seconds
| Plan | Price | Compute minutes per month |
|---|---|---|
| Free | $0 | 400 |
| Premium | $29 per user per month, billed annually | 10,000 |
| Ultimate | Contact sales for custom pricing | 50,000 |
| Extra minutes | $10 per 1,000, a one-time purchase | Added on top of any plan |
| Your own runner | $0 on GitLab’s side | Not counted on any plan, even Free |
Sources: GitLab pricing and the compute minutes documentation. The cheapest fix is not a bigger plan. It is your own runner.
Below: how we moved our pipelines onto our own machine, what broke on the way, what it would have cost on hosted runners, and a full list to rebuild it from zero.
Architecture: CI-Runner, from the chat
CI-Runner is a Claude Code skill. You ask for a runner in plain words. The skill calls one command from the npm package, the command creates a runner through the GitLab API, starts it in Docker on your machine, and checks that GitLab sees it online. Click through the loop below. The counter in the top strip is the model cost of the chat: reading the skill is about 3,000 tokens, which is about one cent on Claude Opus 5.5. Every step after that runs on your machine and adds nothing. It is not a CI cost: jobs on your own runner are free of GitLab minutes.
Five pieces, each doing one job:
| Piece | Job |
|---|---|
| ci-runner skill | Turns your request into one command and reports the result. It never reads or prints a token. |
| GitLab API | Creates the runner. Your personal access token is used for this step. The runner token it returns is stored on your disk and never printed. |
| Runner manager | One gitlab/gitlab-runner container (v18.2.1, nothing installed on the host) that starts job containers with the Docker executor. It also sets one limit on how many jobs run at once. |
| Job containers | One container per job. Each job class has its own memory cap, with no swap. |
| Janitor | A small scheduled cleanup task. It frees finished containers, unused volumes and old cache, and raises a cap when a job is killed for memory. |
Pipelines on your own runner do not count against the quota. GitLab says so in its compute minutes documentation: the quota applies to GitLab-hosted runners, and group or project runners you host yourself are not metered.
Cost of hosted minutes
The cost factors below are from GitLab’s compute minutes documentation and its pricing FAQ.
| Fact | Value |
|---|---|
| Extra minutes expiry | 12 months after purchase (GitLab lists expiry as not yet enforced) |
| Cost factor, Linux | small 1, medium 2, large 3, xlarge 6, 2xlarge 12 (large and bigger are Premium and Ultimate only) |
| Small runner | 2 vCPU, 8 GB |
| Medium runner | 4 vCPU, 16 GB |
The cost factor multiplies your minutes. A 10-minute job on a medium runner uses 20 compute minutes. The included minutes belong to each top-level group. We have three groups, and each one gets its own 400 free minutes.
Here is our real history, read from the GitLab API. It covers Linux jobs on our own runner from 9 August to 13 November 2026 (97 days, both days included). Nothing here was billed. It is what the same jobs would have used on hosted runners.
| Measure | Value |
|---|---|
| Job-minutes | 24,354 |
| Jobs | 11,182 |
| Pipelines | 2,745 |
| Projects | 12, in 3 groups |
| Median job | 46 seconds |
| Slowest 10% of jobs | longer than 5 minutes |
| Busiest day | 1,703 minutes and 608 jobs (5 November) |
| Month | Job-minutes | When the free 400 ran out (busiest group) |
|---|---|---|
| August | 1,150 | day 21 |
| September | 1,714 | day 10 |
| October | 11,273 | day 5 |
| November (first 13 days) | 10,217 | day 1 |
A second group passed its own 400 on 14 October and again on 5 November. October was more than 28 times one group’s free quota, and our busiest group alone passed Premium’s 10,000 included minutes that month. Compare it with August: the meter grew about 10 times in two months, as we added AI agents.
Enter your own numbers below. The presets are our real months.
- If spread evenly, the included minutes last about 2 days of a 30-day month.
- Our real figure for this month is $102.97. We have three groups, and each group gets its own 400 free minutes, so it is a little lower than a single group would pay.
- Both bars use one scale: a full bar is $500.00 a month.
- Extra minutes are a one-time $10 purchase per 1,000, valid for 12 months (GitLab lists the expiry as not yet enforced).
- Electricity for our 97 days: about $10, assuming a 150 W extra draw while jobs run and $0.17 per kWh. Hardware, idle power and setup time are not counted.
- Prices and cost factors from GitLab's compute-minutes documentation. Linux runners only. Hosted-equivalent figures are what the same minutes would cost if bought, not money that left an account.
What it adds up to for us, net of the free quota:
| Runner size | 97 days | At the November pace, per month |
|---|---|---|
| small (factor 1) | about $218 | about $230 |
| medium (factor 2) | about $459 | about $460 |
Be honest about what these numbers are. They are money not spent, not money saved from a real bill: we never bought the minutes. They are modest so far. The point is the slope. At a 10-times jump in two months, a small team with a few agents can pass Premium’s 10,000 minutes before it notices.
Now subtract the power. Our estimate is a 150 W extra draw while jobs run, at $0.17 per kWh. Both are assumptions, and $0.17 is a typical US home rate. The 24,354 job-minutes are about 406 job-hours, which is about 61 kWh, which is about $10. The range is $7 at 100 W to $21 at 300 W, and it is probably an overestimate because our jobs run in parallel. Net of that, the saving over 97 days is about $207 at the small-runner price and about $449 at medium.
What is not counted: the hardware, the PC’s idle power, and the time to set up and maintain the runner. The totals are also a floor: 1,781 jobs with a run time had no runner record and are left out, GitLab does not return deleted pipelines, and there is no per-job rounding.
Design history
The first version was one command and it worked. Everything that followed came from running it every day. Click through the five stages. Each one is what was tried, what broke, and what was learned.
Push code. Jobs have no runner tag, so GitLab runs them on its shared cloud runners. The free tier gives 400 compute minutes a month.
For our busiest group the 400 minutes ran out on day 21 in August, day 10 in September, day 5 in October and on day 1 in November. A test that only passed on Windows went green locally and red on the Linux cloud runner. An infrastructure pipeline failed 56 runs out of 56 and nobody noticed, because publishing still happened by hand from a laptop.
Minutes are a meter, not a quota you can ignore. And a pipeline nobody watches is not a safety net, it is a log of failures.
Docker compute limits
A runner on your own PC shares the machine with your own work. On Windows, Docker Desktop runs all containers inside one Linux virtual machine with a fixed amount of memory. Two things hurt us. The runner containers had no memory limit per job, so one heavy job could take the whole VM. And the VM kept the memory Linux uses to speed up file reads, so memory did not come back after a job ended.
The fix has four rules:
- One manager, one limit on parallel jobs. A single runner manager container, and one number for how many jobs run at once.
- A cap per job class. Each class (light, test, build) has a memory limit and no swap.
- A reserve rule. Caps added together must stay at or under the VM memory minus 2 GB.
- A cap moves, a pipeline does not fail. When a job is killed for memory, the janitor raises that class cap by 2 GB. If the raise would break the reserve rule, that class runs alone. Only one job bigger than the whole VM raises an alert.
Try it. Change the VM size, then simulate a memory kill in a class. The classes and sizes here are an illustration, not our real setup.
A simplified sketch of the rule, written for this article and not the shipped code:
const RESERVE_GB = 2;
const RAISE_GB = 2;
function onMemoryKill(jobClass, pool) {
const budget = pool.vmGb - RESERVE_GB;
const newCap = jobClass.capGb + RAISE_GB;
if (newCap > budget) return alert("one job is bigger than the VM");
jobClass.capGb = newCap;
if (pool.totalCapGb() > budget) jobClass.runAlone = true; // slower, still green
return retry(jobClass.failedJob);
}
The janitor is built to be boring. It cleans, and it avoids everything else:
| It removes | It never touches |
|---|---|
| Containers that finished more than 5 minutes ago | Anything while a job is running |
| Unused volumes created by the runner | Caches |
| Dangling images (layers no image uses) | Databases |
| Build cache older than 24 hours |
Its first run freed 39.4 GB.
Checks before every push
A runner only helps if the code that reaches it is worth running. The other half of the work is what happens before a push, so that CI minutes are spent on what CI must check. In plain words:
- One command to ship. It syncs with the main branch, runs the tests that the change affects, commits only the files you name, pushes, and leaves a note on the issue. If no tests ran, it refuses to push.
- Slow checks run in the background. You get a run id back in under a second. The number of parallel workers comes from the free memory, and a check never waits for memory to appear.
- A busy signal. While the machine is busy with other work, checks, ship and release wait, up to 30 minutes.
- A version check. If the files users receive changed without a version bump, it fails. Users only get the published package, so an unbumped change would never reach them.
- Release is a fixed order. Wait for a quiet machine, take a lock so two releases cannot run at once, read CI’s result for the exact commit, install the package the way a user would, then run it inside a blank container with nothing from our machine. Only then publish, using a short-lived login instead of a stored password, and repeat the same two checks against what was published.
- CI repeats these checks as jobs, and it is not always green. When it is red, the release stops at the CI step. That is the reason the step exists.
Install the CI-Runner skill
One command installs the skill:
npx '@yasaswy.nagavolu/agents' install --bundle runner --yes
Does it work from the npx package alone? Yes, with manual prerequisites. The package does not install these for you:
| Prerequisite | Detail |
|---|---|
| Virtualization and WSL2 | Virtualization on in the firmware, then wsl --install |
| Docker Desktop | Linux containers, start at sign-in, and a VM memory size that fits your jobs |
| Node 18 or newer | Node 22 is recommended |
| GitLab personal access token | api scope. Owner on the group or Maintainer on the project. GitLab 16 or newer |
| Docker Hub access | To pull the runner image |
What we tested: a blank container ran the install and the checks. Creating a runner and seeing it go online worked on our own machine, not from a blank machine.
You do not have to remember the prerequisites. After install, a banner checks them live (Docker
running, WSL2, Node, the token) and prints the next steps for what is missing. runner doctor
repeats those checks later, and it also warns when Docker Desktop does not start at sign-in or when
the Docker VM memory is too small for your caps. runner doctor --fix repairs what it can.
Then ask Claude Code for a runner, or call the commands yourself:
| You want to | Command after npx '@yasaswy.nagavolu/agents' |
|---|---|
| Create the runner | runner install --project-id <id> (or --group-id, and --url for self-managed) |
| See state, find problems | runner status, runner doctor (--fix repairs) |
| Write a pipeline file | runner init-project --profile node --write --attach --project-id <id> |
| Use the runner for a project | runner attach --project-id <id> (--no-cloud turns cloud runners off) |
| Tune or stop | runner concurrent <n>, runner cap <class> <size>, runner pause, runner resume, runner uninstall |
With --no-cloud, pipelines wait while your machine is off.
Rebuild from zero
This is the whole setup as a list. It is also our own disaster-recovery reminder: if the machine dies, this is what we follow. Tick each step as you go.
Turn on virtualization in the firmware if it is off, then install WSL2.
wsl --installSet it to start at sign-in. Docker Desktop gives the VM 50% of your RAM by default. Raise it if your jobs need more, and keep the reserve rule in mind.
The CLI ships as an npm package and runs through npx.
node --versionYou need Owner on the group or Maintainer on the project, and GitLab 16 or newer.
Either set the environment variable in a new terminal, or install the bundle and then run the secrets step in an interactive terminal.
$env:GITLAB_RUNNER_PAT = '<token>' # or: npx '@yasaswy.nagavolu/agents' secrets --bundle runnerUse --group-id to cover a whole group. Add --url for a self-managed GitLab.
npx '@yasaswy.nagavolu/agents' runner install --project-id <id>Status reads from GitLab. Doctor checks the local side, and warns if Docker does not start at sign-in or the VM memory is too small.
npx '@yasaswy.nagavolu/agents' runner status; npx '@yasaswy.nagavolu/agents' runner doctorAdd --no-cloud to switch the shared cloud runners off for that project, so no more cloud minutes are spent.
npx '@yasaswy.nagavolu/agents' runner init-project --profile node --write --attach --project-id <id>Open the pipeline in GitLab and confirm the job ran on your machine, not a cloud runner.
Raise or lower the global concurrency, set a cap per job class, pause and resume the runner when you need the machine.
npx '@yasaswy.nagavolu/agents' runner concurrent 2; npx '@yasaswy.nagavolu/agents' runner cap <class> <size>In GitLab open Settings, CI/CD, Runners and delete the dead runner so jobs do not wait for it. Then build the new machine from step 1.
Limits
- Hosted-equivalent, not a bill. The dollar figures are what the same minutes would cost to buy. Electricity is estimated at about $10 over 97 days from two stated assumptions (150 W, $0.17 per kWh). Hardware, idle power and setup time are not counted, and the totals are a floor.
- Linux jobs only.
- Your machine must be on. With cloud runners off, a sleeping PC means waiting pipelines.
- CI is not always green. The checks block a release on a red result. They do not make the pipelines pass.
Technicals
The real stack behind this build, on record:
- Agentic harness: Claude Code.
- Skill name: CI-Runner (the
ci-runnerskill). Installed withnpx '@yasaswy.nagavolu/agents' install --bundle runner --yes. It is a thin wrapper: the package’srunnercommand owns detection, tokens and retries. - Runtime: the
gitlab/gitlab-runnercontainer (v18.2.1) with the Docker executor, on Docker Desktop and WSL2. - Memory/RAG system: none.
- Package:
@yasaswy.nagavolu/agentson npm, bundlerunner. There is no separate companion repository.
Cheat sheet
- Own runners are not metered. Only GitLab-hosted minutes count against the quota.
- The meter followed our agents. About 10 times in two months for us (1,150 to 11,273).
- Caps are a starting guess. On a memory kill, raise the cap by 2 GB, or run that class alone. Never fail the pipeline.
- Reserve rule: caps added together at or under VM memory minus 2 GB.
- The janitor is boring on purpose. It never runs while jobs run and never touches caches or databases.
- Verify after every change, and roll back by itself. A redaction bug wrote the literal text
[REDACTED]as runner tokens. Verify got a 403, and the apply rolled back with no job lost. - Install is one command plus manual prerequisites. Docker Desktop, WSL2, Node, a token, Docker
Hub. The install banner and
runner doctorcheck them for you.