Tools: I built a CLI that runs your CI locally and fixes failures with Claude Code - Guide

Tools: I built a CLI that runs your CI locally and fixes failures with Claude Code - Guide

I built a CLI that runs your CI locally and fixes failures with Claude Code

The loop I wanted to kill

What Stitch does

Parallel execution by default

Batch fixes

Re-verify, don't re-report

Native Claude Code skill

Pluggable agent CLI

Watch mode

History that survives

Quick start

Where it goes next

Try it Stitch is an open-source CLI that parses your existing GitLab CI / GitHub Actions / Bitbucket Pipelines config, runs the jobs locally in parallel, and when something fails, hands the error to Claude Code or Codex CLI to fix. Re-verifies, commits, pushes. No API keys. MIT. Every push to a branch triggers cloud CI. Cloud CI takes 8–15 minutes. When it fails (and ~30% of pushes fail something), I open the logs in a browser, fix locally, push again, wait another 12 minutes. On a normal day, that's 30–60 minutes of waiting. On a bad day with a flaky job, it's an afternoon. I tried the existing tools: None of them solved my actual problem: keep my existing config, run it on hardware I already own, and let the AI agent CLI I already pay for handle the fix loop. A few things that ended up mattering more than I expected: Wall-clock time is max(job_i) instead of sum(job_i). A 4-job pipeline takes as long as the slowest job, not all four added together. When multiple jobs fail together, Stitch sends all the errors to the agent in a single call. One missing import that breaks lint + typecheck + tests gets fixed once, not three times. Fewer tokens, fewer round-trips. After the agent edits, Stitch re-runs the previously failed jobs to prove the fix actually worked. Up to --max-attempts per job. The fix loop closes only when the job is green. Stitch ships with a Claude Code skill that auto-triggers at four moments: Install once, never invoke again. Works with Claude Code or Codex CLI today. Uses whichever subscription you already have (Claude Pro, ChatGPT Plus). No Anthropic or OpenAI API key required. Cost of an extra fix: $0. Re-runs on every save (debounced). Auto-commits the green result. Walk away from your terminal, come back to a clean branch. Every run goes to .stitch/history.jsonl, safe to commit. Streaks compact (100 green runs = 1 line). Fixes never compact — every successful fix gets its own entry with the commit SHA. Syncs across machines naturally with the rest of the repo. Prerequisite: an agent CLI installed and logged in. Either Claude Code or OpenAI Codex CLI: To install the Claude Code skill: What's not in v1: CircleCI, Jenkins, Buildkite parsers. These are the most-requested already and on the near-term roadmap. PRs are very welcome. If you have a CI config that you think would break the parser, drop it in an issue. I want to find the edge cases before users do. MIT, no funding, no telemetry, no SaaS layer. Just a CLI that closes the loop. Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Code Block

Copy

stitch run claude | |- parses .gitlab-ci.yml / .github/workflows/*.yml / bitbucket-pipelines.yml |- filters jobs (skips deploy, publish, docker-build) |- runs each job locally (subprocess with timeout) | |- job passes? next job |- job fails? | |- spawns the AI agent CLI with the error log | |- agent investigates and edits files | |- re-runs the job to verify the fix | |- repeat up to --max-attempts | |- reports results with a live TUI stitch run claude | |- parses .gitlab-ci.yml / .github/workflows/*.yml / bitbucket-pipelines.yml |- filters jobs (skips deploy, publish, docker-build) |- runs each job locally (subprocess with timeout) | |- job passes? next job |- job fails? | |- spawns the AI agent CLI with the error log | |- agent investigates and edits files | |- re-runs the job to verify the fix | |- repeat up to --max-attempts | |- reports results with a live TUI stitch run claude | |- parses .gitlab-ci.yml / .github/workflows/*.yml / bitbucket-pipelines.yml |- filters jobs (skips deploy, publish, docker-build) |- runs each job locally (subprocess with timeout) | |- job passes? next job |- job fails? | |- spawns the AI agent CLI with the error log | |- agent investigates and edits files | |- re-runs the job to verify the fix | |- repeat up to --max-attempts | |- reports results with a live TUI stitch run claude --watch --jobs lint,test stitch run claude --watch --jobs lint,test stitch run claude --watch --jobs lint,test npm i -g @anthropic-ai/claude-code # or @openai/codex npm i -g @anthropic-ai/claude-code # or @openai/codex npm i -g @anthropic-ai/claude-code # or @openai/codex npx stitch-agent doctor # check setup npx stitch-agent run claude # run + fix npx stitch-agent doctor # check setup npx stitch-agent run claude # run + fix npx stitch-agent doctor # check setup npx stitch-agent run claude # run + fix npm install -g stitch-agent stitch run claude npm install -g stitch-agent stitch run claude npm install -g stitch-agent stitch run claude ln -s "$(npm root -g)/stitch-agent/skills/stitch" ~/.claude/skills/stitch ln -s "$(npm root -g)/stitch-agent/skills/stitch" ~/.claude/skills/stitch ln -s "$(npm root -g)/stitch-agent/skills/stitch" ~/.claude/skills/stitch - act runs GitHub Actions locally, but only GitHub, and it stops at "failed." - Gitar / Nx Cloud are SaaS platforms that intercept failures in remote CI. Each fix attempt = a remote CI cycle, and they want your pipelines on their platform. - Dagger + AI runs locally but expects you to rewrite every pipeline in their SDK. - Before every push. Ask Claude to push, commit, or open a PR — Stitch runs first. - End of a task. When Claude finishes implementing a feature, it runs Stitch as the last step. - Before marking a todo complete. If a TodoWrite item touches code, Claude runs Stitch first. - Context switch. If you pivot, Claude validates the previous change first. - Site: stitch-agent.dev - Repo: github.com/X24LABS/stitch-agent - Live on Product Hunt today: https://www.producthunt.com/products/stitch-agent?launch=stitch-agent