r/ClaudeCode • • 24d ago

Help/Question anyone running CC as a background agent off linear issues? how'd you set it up

i want to be able to just delegate a linear ticket to an agent and get a PR back that's actually been tested, not just "looks right to me lol"

the tricky part is validation. i want it to spin up our whole docker compose stack, seed the db, run playwright and drop screenshots in the PR if it touched UI. stripe test mode too since half our bugs are billing stuff

right now im leaning towards claude code cloud sessions since they apparently have docker + chrome in the VM now. plan is linear webhook -> tiny lambda -> fire a scheduled task with the issue text. if the agent gets stuck it pings in linear with a link to the session and i answer from my phone.

couple things i cant figure out tho. is anyone actually using linears agent api (the delegate thing) in prod or is everyone still doing label/@mention triggers? also whose account does your agent run as, cuz with scheduled tasks every PR shows up as me which feels kinda weird (but fine)

saw cyrus on github which looks like it does most of this already, has anyone tried it? curious what ppl ended up with before i go build my own thing

3 Upvotes

17 comments sorted by

•

u/AutoModerator 24d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

3

u/DaRKoN_ 24d ago

Yes. I've built a significant amount of tooling around this. I'm not sure if genius bit of kit or silly rube goldberg machine but here is how it works:

Webhook events from linear and GitHub, run into a stateachine running in CloudFlare, it takes events in various streams and turns them into actions that a listener daemon runs on a host machine. That uses Orca to orchestrate the actual work, creating work trees sending PRs, responding to review feedback, running tests, looking at work that is blocked or unblocked, updating related issues etc.

Eventually the bottleneck became my machine and running too much work in parallel, so it now spins up cloud VMS, manages secrets, tokens repos and dependencies, puts machines to sleep and tears them down if not used for a few hours.

It started life as a simple "ping Linear every 10 mins and find work to do" and evolved to this.

2

u/Black_Magic100 24d ago

Never ever heard of linear until I started using orca a few days ago. What is the advantage of linear over GitHub issues?

1

u/DaRKoN_ 23d ago

GitHub issues are extremely bare bones and the project system is a tacked on afterthought.

1

u/Black_Magic100 23d ago

Linear looks good but not sure I can justify paying personally

2

u/NamerekDev 24d ago

I'm what happens when you skip the "Curious what ppl ended up with" part and go build your own thing. Mine polls linear and picks up tickets by status and label, never touched the agent API. I gave up on putting testing in the pipeline, the ticket says what to check and the repo's claude.md says how, so the agent brings up whatever the project needs. And, yeah, every PR shows up as me too, you get used to it. It's called even keel, open source, runs on my own machine

2

u/Duckducklaugh 24d ago

We run a bunch of scheduled Claude Code tasks for a side business (releases, daily checks), not off Linear but similar idea.

Biggest lesson: give every task its own git worktree. We had two tasks sharing one checkout, one merged master while the other had unreviewed edits sitting in the tree, and it staged them into the merge. Took an hour to untangle.

Second thing, we don't let the same agent judge its own work. Before merge a separate reviewer agent reads the diff with the rules and says accept or fix. Catches real stuff, like charging logic it would otherwise wave through.

And yes, every PR shows up as me too. Didn't bother fixing it.

1

u/bostonaholic 24d ago

I'd start with label or @mention triggers before Linear's agent API. Use a bot account so the agent's PRs aren't attributed to you. Require CI checks using Compose, Playwright, and Stripe test mode before merging. Pinging you in Linear when it's stuck is fine, but put the acceptance checks in the ticket so the agent doesn't have to guess them.

1

u/Old_Championship7240 24d ago

make a GitHub app and give its installation access token to your agent. Then pr and its activities will show up as the app name.

1

u/CCodeSI 24d ago

On the validation part specifically, a few things that made it reliable for this kind of setup:

  • One verify script as the contract. make verify (or scripts/verify.sh) that does compose up, waits for health checks, seeds a fixed dataset, runs the tests and Playwright, then tears down. The agent is told "the PR isn't done until make verify exits 0", and CI runs the exact same script. If the agent and CI validate differently, you get "passed for me" PRs.
  • Stripe needs two extra pieces in test mode. Webhooks won't reach a cloud VM on their own, so start stripe listen --forward-to localhost:PORT/webhooks inside the verify script. And for subscription bugs (renewals, failed payments, proration), use Stripe test clocks so the agent can advance time instead of writing tests that only cover the first charge, which is where billing bugs usually hide.
  • Screenshots: let Playwright produce them, not the agent. Save them as test artifacts on failure and on any spec tagged @ui, upload them from CI, and link them in the PR. The agent deciding which screenshots to take tends to show you the screens that work.
  • Make the PR body report the evidence: the verify command, its exit code, and the summary line of each suite. You can tell at a glance whether it actually ran or just "looks right".

On the account question: a separate GitHub bot account (or a GitHub App) is worth the ten minutes. Branch protection can then require your review on anything the bot opens, which you can't do while the PRs are yours.

1

u/Easy-Purple-1659 24d ago

Something that bit us with PR based validation: the agent learns to edit the test instead of the code. A failing playwright step becomes a looser assertion, the seed script grows a row that makes the expected count work out, CI goes green and the diff looks tidy.

Cheap guard is to fail the PR when the diff touches tests, fixtures or the seed script, and have the reviewer work from a clean checkout of the branch instead of trusting the screenshots the author agent attached. Push artifacts with the commit sha on them so you know they came from the code you are merging.

If the bugs are billing timing, Stripe test clocks are the part people skip. You can walk one subscription through renewal, a failed payment and dunning in about a minute instead of waiting out real weeks.

1

u/snow-beach 24d ago

Been doing Linear → Claude Code → PR for a while. Disclosure: I build DevIntern for it (self-hosted, your agent, status/label pickup, worktrees, review comments back on the same branch). Never needed Linear's Agent API.

On validation: one verify script (compose + seed + Playwright + stripe listen) that both the agent and CI must pass, so the agent doesn't invent its own "looks right" checks. Screenshots as Playwright artifacts on u/ui specs beat asking the agent to pick them.

1

u/LumPiniF 24d ago

for the PR author, you can use a github app installation token instead of yoru personal token

1

u/onitsoga 23d ago

label triggers still win in practice, the delegate api is too new to trust. give the agent its own github account or every PR looks like you. fwiw i'm building KanbanMCP, a board where agents claim cards and leave a note before stopping. tried cyrus?

1

u/Same-Swan-3877 23d ago

the whose-account bit is the one that quietly bites: run it under a dedicated github app or bot user, otherwise every review request and notification lands on you and you stop reading them. cloud sessions with docker + chrome are the only reason the playwright plan works at all.

1

u/aviator_educator 6d ago

I'm late to the party.

I looked at a few of these tools people have built and decided they still aren't great at helping me with all of the context switching.

They're not much better than having multiple claude code sessions open in a terminal. I made a more visual kanban style board that picks up linear tickets assigned to me and helps me track their progress. One quick glance at the board and I know what the status of each ticket is in the SDLC. A daemon watches for new tickets in linear, kicks off claude code sessions in the background to spec out the ticket, pauses for human review (optional), then I move the card to kick off the build process which consists of a new background claude session that writes the code, tests it, runs a 5-way agent review fixes any issues it finds, and then refactors and puts up a PR.

Guys at work keep asking me how I ship so much more code each week. They've all built their own ugly dashboards that claude told them to build. They're so dense with information that they still can't keep up with everything their claude sessions have running. Simplicity is key. You can build your own or check out the apps others are building to get a good idea of what works best for you.

1

u/OkFaithlessness7574 6d ago

https://github.com/abegalinov/dev-factory

I even made it record video from the android app testing