Beaver - Building fixes while you sleep

🦫 Beaver

The first autonomous production bug-fixing agent.

Beaver builds fixes while you sleep. When a bug occurs, Beaver captures the error, explores your codebase, and opens a Pull Request with the fix.

Traditional tools like Sentry alert you and wait. Beaver fixes. Beaver is for developers who like sleeping. Beaver is the first autonomous agent that turns error monitoring into error resolution.

Why Beaver?

The Old Way (Sentry)

  • ✕Built for human triage
  • ✕Complex dashboards
  • ✕Noisy alerts
  • ✕You write the fix

The Future (Beaver)

  • ✓Built for AI agents
  • ✓Zero dashboard
  • ✓Autonomous triage
  • ✓Beaver writes the fix

How it works

Beaver integrates directly into your Next.js app:

  • Capture: Hooks into runtime errors, promise rejections, and React error boundaries.
  • Analyze: Claude explores your codebase using tools to find the root cause.
  • Fix: Generates a patch and opens a PR on GitHub.

Quick Start

1. Install

npm install beaversh

2. Add Instrumentation

Create src/instrumentation.ts:

export async function register() {
  if (process.env.NEXT_RUNTIME === 'nodejs') {
    await import('beaversh/register');
  }
}

3. Add Provider

Add to src/app/layout.tsx:

import { BeaverProvider } from 'beaversh/provider';

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        <BeaverProvider>{children}</BeaverProvider>
      </body>
    </html>
  );
}

4. Configure API Route

Create src/app/api/beaver/route.ts:

export { POST } from 'beaversh/api';

5. Environment Variables

Add to your .env.local:

BEAVER_REPO=owner/repo
ANTHROPIC_API_KEY=sk-ant-...
GITHUB_TOKEN=ghp_...

Requirements

  • Next.js 13+ (App Router)
  • GitHub Repository Access (Token)
  • Anthropic API Key (Claude)

Links