Beyond Git Worktree
Cloud AgentsLong read

From Laptop Toy to Production Infrastructure What Teams Actually Need to Run Claude Code at Scale

Running Claude Code across a team demands enforced isolation, governance, and budgets.

· 8 min read
Cover illustration for “From Laptop Toy to Production Infrastructure What Teams Actually Need to Run Claude Code at Scale”
Cloud Agents · November 23, 2026 · 8 min read · 1,826 words

To run Claude Code across an engineering organization, teams need an execution environment that enforces isolation, governance, and budgets and keeps audit trails that last. Managed cloud platforms are the production approach for teams that do not want to build and maintain those controls themselves. For teams evaluating Claude Code and another coding agent together, the buying question is whether a platform supports both agents within that governed environment.

Why running Claude Code on a laptop is not the same problem as running it across an engineering organization

On a laptop, Claude Code feels ready because it works, responds quickly, and fits into a developer’s existing workflow. One person controls the session, credentials, spending, and access to sensitive systems. Governance rests with the person at the keyboard. But what breaks when many engineers or a large fleet of agents run at once? The assumptions that made local use manageable no longer hold across shared resources and overlapping sessions.

That change is architectural. Teams already use Claude Code for large-scale migrations and codebase-wide audits, so agent capability is not the missing component. The gap lies around the agent. Isolation must limit what each session can reach, governance must enforce permissions, cost controls must stop jobs from spending too much, and observability must keep evidence of what happened. Across an organization, those controls must be explicit and auditable.

What production-scale Claude Code actually looks like before the infrastructure catches up

incident.io went from zero to four to seven concurrent agents in four months on a roughly 500,000-line TypeScript codebase. Git worktrees provided separate branch directories so parallel agents could work without interfering with one another’s changes. That pattern solves an immediate coordination problem. It also shows how fast teams can put parallel execution to work before the infrastructure is ready.

Teams have taken a similar path with configuration, using plain-text Markdown files. By default, Claude Code reads CLAUDE.md, or AGENTS.md when no CLAUDE.md exists. Loading both requires an explicit setting. These files are readable, editable, and version-controllable, but their instructions also consume tokens on tasks.

Claude Code’s workflow documentation describes orchestration as JavaScript scripts that the runtime executes, making the workflow readable and rerunnable. That same auditability principle applies to instruction files. An audit needs access to what the agent was told. Yet neither readable scripts nor separate working directories solve credential scope, spend attribution, cross-session audit trails, or access to systems a session should never touch.

Why isolation is the first infrastructure problem to solve, not an afterthought

Git worktrees separate branches. They do not isolate credentials, network access, file system permissions, or token spending. The boundary is a workflow convenience. Without session-level isolation, one agent can gain access to credentials meant for another, runaway jobs can use up shared resources, and a compromised session can expose more than the task it was given.

The 2026 incident record makes that exposure concrete. A production database was deleted in a single API call. The Cloud Security Alliance described an attacker hijacking an active coding-assistant session and seeding the Shai-Hulud worm across roughly 100 internal code repositories. In both incidents, the environment placed no hard limits on what the agents could do. How much the agents could access set the scope of the damage they could do, even when the task seemed simple.

The production model therefore gives each session its own sandbox, fresh credentials, and revocation when the session ends. Those credentials bound the session’s blast radius. Claude Code’s workflow documentation describes dozens to hundreds of agents per run, while its sub-agent documentation says subagents can spawn their own subagents. Without isolation, that expansion can extend a misconfigured workflow’s reach across everything available to its parent session.

Repository tiering applies the same principle to the organization. The highest-sensitivity code, including cryptographic implementations, authentication, and customer data processing, warrants restrictions on AI assistant use or local-only models. Production application code and infrastructure-as-code can permit approved enterprise-tier agents with strict configuration.

Why prompt rules are not governance and what actual governance requires

Instructions are advisory, while permissions are enforced. A system prompt saying “never modify production configuration” can be undermined by adversarial input. A credential without write access to that configuration cannot be persuaded to grant it. Isolation establishes where a session operates, while governance determines what it is allowed to do there.

The Cloud Security Alliance found high- and critical-severity CVEs in MCP-integrated projects that were part of a large supply chain of package downloads. A prompt rule cannot constrain a compromised MCP server. The control must exist outside the instructions that the agent interprets.

Production governance includes SSO integration, SIEM-connected audit logging, secret scanning on agent PRs, PR policy gates, license governance, sandboxed execution, and incident response runbooks. Labeling an agent PR with its tool and session ID lets security operations trace it to the originating session in the SIEM. Without that link, the PR and its execution history remain disconnected evidence.

CLAUDE.md and AGENTS.md still belong in version control, reviewed like other code. Their role is a record of intent. Version history establishes what instructions changed, when they changed, and who changed them. It does not turn those instructions into permissions, and treating it as enforcement leaves the original governance gap intact.

How cost compounds at agent scale and why post-hoc billing alerts always fire too late

The same need for enforced boundaries applies to spending. Agentic tasks use far more tokens than ordinary chats, and multi-agent workflows multiply that use as agents work in parallel and make repeated passes. Claude Code’s workflow documentation warns that workflows can use far more tokens than a typical session. A codebase-wide migration or audit can revisit the codebase many times through dozens to hundreds of agents. The task description alone does not reveal the resulting consumption.

A monthly bill that adds up all the spending comes after those decisions. It also obscures which agents, teams, or features drove the spend. Attribution requires metadata on every request from the start, including team, feature, user, and environment.

Budget enforcement must therefore sit at the gateway before tokens are consumed. Soft budgets warn operators below the maximum, while hard budgets act as circuit breakers at the limit. A post-hoc billing alert can report an overage, but it cannot prevent one that has already occurred.

Dynamic workflows have token budgets set by hand that stop a run at the chosen limit, though costs still vary. The workflow documentation recommends piloting a small task slice before expanding to recurring automation. Model routing provides another control by matching query complexity to model tier rather than using the most capable model for every task.

What observability means for agents and why application monitoring tools don't cover it

Application monitoring can establish that an agent ran without explaining what it was told, what it did, or the basis for its choices. Agent observability needs those additional records. The enterprise SIEM should receive a record of every file access, shell command, PR creation, and API call. SOC 2 Type 2 auditors need evidence that controls worked throughout the audit period, beyond proof that they were in place at one moment.

Instruction loading needs its own observable record. That record should identify which instruction files were considered, which were loaded, why others were skipped, and the hashes of loaded files. The configured instructions are not necessarily the loaded instructions. When an agent makes an unsafe or expensive change, an investigation starts from evidence if it uses a record of loaded instructions and from an assumption if it relies on configured instructions.

The AGENTS.md telemetry-gating bug illustrates the operational consequence. Before the fix in Claude Code v2.1.281, AGENTS.md could be silently ignored when telemetry was disabled. A reviewed file in the repository did not prove that the session used it.

Audit readiness also requires immutable records of decisions, actions, and outcomes that survive the session. The workflow runtime’s progress view shows phases and how many agents are running, and agent details show prompts, recent tool calls, and results. That is useful session-level visibility, but it is not the complete enterprise record. Production observability sends that data to a durable system that security and compliance teams can query independently.

How can a team run Claude Code without managing infrastructure while connecting isolation, governance, cost, and observability?

A coherent execution environment treats these controls as properties of one system. In the common DIY setup, teams instead install Claude Code, add CLAUDE.md, write prompt prohibitions, and watch spending through a provider dashboard. Each component addresses a separate concern. None, by itself, connects an authorized person to a bounded session, its budget, its actions, and the resulting code change.

In a connected environment, YAML or Markdown configuration lives in the repository and passes through review. Each session runs in a sandbox with credentials minted for that session and revoked on completion. Budgets apply before consumption at session, developer, and time-period levels. Every tool call, diff, and token is logged and attributable to a person or trigger.

Managed platforms package this execution layer for teams that do not want to maintain it. Their production value lies in governed cloud sandboxes. For a team seeking Claude Code and another coding agent together, support for both is one criterion, while shared isolation, budget enforcement, and durable attribution are the operating requirements.

Building the same layer over a raw installation remains legitimate. It also transfers ownership of sandbox design, credential lifecycle, the cost-enforcement gateway, audit pipelines, and compliance posture to the engineering organization before the first agent ships a PR. The choice is therefore about operational responsibility.

Where to start if your team is already running Claude Code and needs to close the gap

The practical sequence starts with the worst possible outcome. First, scope credentials to the task, separate read paths from destructive ones, and issue short-lived credentials that expire with the session. Limit the blast radius before using agents more widely. This work can begin before the rest of the execution environment changes.

Next, put the configuration for agents in version control and review changes to CLAUDE.md and AGENTS.md through PRs. That makes changes to instructions tracked, attributed, and reversible. Then enforce budgets before tokens are consumed. Start with a hard cap per session and extend it to developers and time periods, so a large dynamic workflow cannot spend without an enforced limit.

With those boundaries established, connect tool calls and diffs to the existing observability stack. Preserve session IDs that link a PR to the execution that created it. Never merge a generated diff without validation, starting with lint, type checks, and tests, then expanding coverage as usage reveals where agents drift.

This sequence does not require every team to become an infrastructure provider. When maintaining sandboxes, credentials, and audit pipelines consumes more engineering time than agents save, a managed platform becomes a natural option. The decision should turn on whether it supplies those operating controls. Hosting the agent is only the beginning of that responsibility.

Sources

  1. Orchestrate subagents at scale with dynamic workflows - Claude Code Docs
Filed underCloud Agents

More in Cloud Agents