{"slug": "show-hn-self-managing-codebase-with-long-horizon-agents", "title": "Show HN: Self-managing codebase with long-horizon agents", "summary": "A developer released a demo of a self-managing codebase using long-horizon agents that autonomously triages errors, upgrades libraries, and rolls back regressions. The system runs three Anthropic Managed Agents—a manager, reviewer, and retro agent—that monitor Vercel and Sentry, file Linear tickets, write code, run Playwright tests, and open pull requests without human intervention. The project aims to offload constant maintenance work from developers onto automated agents that operate on cron-driven loops and webhook-triggered resumes.", "body_md": "A demo showcasing an app maintained by a long-running agent.\n\nProduction apps need constant care: errors and stack traces to triage, slow endpoints to investigate, libraries to upgrade, regressions to roll back. That work eats developer time and can require on-call rotations.\n\nThis repo is demo that showcases what is possible in pushing those tasks onto a long-horizon agent.\n\n**The demo product.** The demo product is a Next.js travel-planner app.**The managing agent.** A cloud-hosted Anthropic Managed Agent runs every 30 minutes (and on GitHub webhooks). It monitors Vercel + Sentry, files Linear tickets for new issues, picks up tickets, writes code, runs Playwright to view it's own work in a local dev server, and opens PRs.**The review agent.** A separate reviewer agent reads each PR cold, builds, runs tests, posts approve / request-changes / escalate. Three rounds of changes → escalates to a human.**The retro agent.** The agent system is self-learning. Each session can append to`.claude/memory/`\n\n. A retro agent runs daily, summarises 24h of activity in a Linear project update, and proposes memory edits as a PR.\n\n**Two cron-driven loops + webhook-driven resumes**\n\n**Manager**(`/api/manager-tick`\n\n, every 30 min). Reads memory, checks Vercel + Sentry, files tickets, picks up one Linear ticket, runs the dev loop locally in a sandbox (install, dev server, Playwright, build, lint), opens a PR.**Reviewer**(`/api/reviewer-tick`\n\n, every 30 min). Reads each open PR cold, builds, runs e2e, posts`AGENT_REVIEW: APPROVED | REQUEST_CHANGES | ESCALATE`\n\n.**Webhooks**(`/api/github-webhook`\n\n). PR opens → reviewer fires immediately. Reviewer approval → manager session resumes (full context) and squash-merges.\n\n**Daily retro** (`/api/retro-tick`\n\n, 07:00 UTC). Reads 24h of activity, posts a Linear project update with a health field, and proposes `.claude/memory/`\n\nedits as a PR.\n\n**Stack**\n\n**Anthropic Managed Agents**— three agents (manager, reviewer, retro), all running in cloud sandboxes with a mounted clone of this repo.** Linear MCP**— Store and control plane for tasks; also the location where the agent provides project updates.** GitHub MCP**— PRs, reviews, files.** Vercel MCP**— deployments, logs.** Sentry MCP**— runtime errors.** Vercel**— hosting + cron + webhooks for the orchestration routes.** Playwright**— e2e tests inside the sandbox.\n\n```\nnpm run manager           # interactive REPL into a manager session\nnpm run manager:tick      # one-shot operational loop, prints transcript\nnpm run manager:bootstrap # apply agent YAML changes to the live agent\n```\n\n**Bring your own infrastructure.** The agent cannot create infrastructure, set env vars, register OAuth apps, or pay for services. Bootstrapping is human-only.**Further observability.** Product analytics, metrics and so on are trivial to add once the agent is running, and thus not done here.**Single-agent throughput.** WIP limit of 1 — the manager won't pick up a second ticket while another is in flight. Keeps things simple, caps throughput.\n\nI hope this inspires you to set up your own. If you would like to swap notes, I can be reached at [willtay.com](https://willtay.com/).", "url": "https://wpnews.pro/news/show-hn-self-managing-codebase-with-long-horizon-agents", "canonical_source": "https://github.com/WillTaylor22/self-managing-codebase", "published_at": "2026-05-26 10:24:50+00:00", "updated_at": "2026-05-26 10:40:06.996926+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "ai-products", "mlops", "large-language-models"], "entities": ["Anthropic", "Next.js", "Vercel", "Sentry", "Linear", "Playwright", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/show-hn-self-managing-codebase-with-long-horizon-agents", "markdown": "https://wpnews.pro/news/show-hn-self-managing-codebase-with-long-horizon-agents.md", "text": "https://wpnews.pro/news/show-hn-self-managing-codebase-with-long-horizon-agents.txt", "jsonld": "https://wpnews.pro/news/show-hn-self-managing-codebase-with-long-horizon-agents.jsonld"}}