Skip to main content

What you’ll build

A developer flow that agents can actually run. You point Copass at three repos — a shared schema package, a backend service, a frontend app — and ask it to add a feature. The agent reads the full cross-repo graph, plans the change, and opens a PR in each repo with a dependency note linking them. Cursor and Claude Code live inside one repo. This recipe lives above them.

Step 1 — index each repo

The CLI ingests a repo into the sandbox. Copass chunks the code, extracts entities (types, functions, modules), and crucially — links entities across repos. A CheckoutRequest type defined in api-schemas gets linked to every import of it in backend-api and frontend-web.
cd ~/code/api-schemas  && copass ingest .
cd ~/code/backend-api  && copass ingest .
cd ~/code/frontend-web && copass ingest .
Want the index to stay fresh? Use copass watch . per repo — it mirrors every save into the sandbox. See Filesystem driver.

Step 2 — ship the feature

import { AgentRouter } from '@copass/agent-router';
import open from 'open';

const router = new AgentRouter({
  auth: { type: 'api-key', key: process.env.COPASS_API_KEY! },
  sandboxId: process.env.COPASS_SANDBOX_ID!,
});

await router.integrations.connect('github', { onConnectUrl: open, scope: 'org' });

for await (const event of router.run({
  provider: 'anthropic',
  model: 'claude-opus-4-7',
  system: `You are a senior engineer implementing a feature that spans three repos:
  • api-schemas   — shared TypeScript types, validated with zod. Published to npm.
  • backend-api   — Hono service that imports api-schemas and exposes REST endpoints.
  • frontend-web  — Next.js app that imports api-schemas for form typing and API calls.

When you receive a feature request:
  1. Plan the change. Identify every type, endpoint, and component that needs to move.
  2. For each repo, open a PR with a minimal, reviewable diff. Use the GitHub integration.
  3. In the backend and frontend PR descriptions, link to the schemas PR as a blocking dependency.
  4. Keep diffs tight. Don't refactor unrelated code. Don't invent new patterns — match what's already in each repo.
  5. In each PR body, cite the specific files in the other repos that would break if this PR merges first.`,
  message: `Add an optional "discount_code" field to the checkout flow.
The schema should validate the code as 4–12 alphanumeric chars. The backend should accept it, echo it back in the response, and log it.
The frontend should add an input to the checkout form and send it on submit.`,
  endUserId: 'eng-bot',
})) {
  if (event.type === 'text')      process.stdout.write(event.text);
  if (event.type === 'tool_call') console.log(`\n${event.name}`);
}
The agent returns three PR URLs — one per repo, each with a dependency note linking the other two.

What’s happening

  • One sandbox, three data sources — every copass ingest . registers that repo as a named data source inside the same sandbox. The knowledge graph sees all three as first-class context, not as three isolated searches.
  • Cross-repo entity linking is the unlock — when the agent reads CheckoutRequest in api-schemas, the graph already knows every file in backend-api and frontend-web that imports it. The agent doesn’t have to guess or grep; the joins are pre-computed.
  • GitHub is the write layer — the connected integration gives the agent github.create_pull_request across any repo in the org. One auth, N repos.
  • The coordination is the value — a single-repo agent has to be told about the other repos. A cross-repo agent plans them together. PR ordering, dependency notes, and “this will break if merged first” warnings fall out for free.

Make it yours

  • Expand the fleetcopass ingest . works on any repo. Five repos, ten, the whole monorepo adjacent. The sandbox is free and scales with you.
  • Keep it live — replace copass ingest with copass watch per repo. Agents always see the latest code without you running anything.
  • Constrain the agent — append Never touch CI configs, env files, or migrations without explicit instruction. to the system prompt. The model respects it because the context is rich enough to know what those files are.
  • Run it from CI — wrap in a GitHub Actions workflow that fires on a /feature issue comment. The bot reads the issue, ships the three PRs, and tags the assignees.
  • Swap GitHub for GitLab or Bitbucketrouter.integrations.connect('gitlab', …). Same prompt. Full list at pipedream.com/apps.

Why this is different from Cursor / Claude Code

Tools that live inside one repo can only reason about what they can see. A monorepo agent helps if you’re lucky enough to have a monorepo; everyone else is copy-pasting types between IDE windows. Copass’s sandbox is the shared context layer that sits above the IDE. Once your repos are indexed, every agent — this one, your next one, your teammate’s — starts with the full graph. Single-repo agents stay useful for typing and refactoring; cross-repo agents become possible for the first time.