February 25, 2026 · Zapat Team

How Zapat Reads Your Codebase (and Why It Matters)

The biggest failure mode of AI code generation is producing code that works in isolation but does not fit the codebase. Wrong naming conventions, unfamiliar patterns, dependencies the project does not use. Zapat avoids this by giving agents full repository context.

The Clone Step

When a Zapat job starts, the first thing that happens is a full clone of your repository into an isolated Fargate container. The agent has the same view of your code that a new engineer would — every file, every config, every test.

This matters because LLM context windows have limits. Zapat does not try to stuff your entire codebase into a prompt. Instead, the agent uses tools to navigate the repository: reading files, searching for patterns, understanding imports, tracing dependencies. It builds a mental model of the codebase dynamically, the same way a human developer would.

Convention Detection

Before writing any code, the triage agent analyzes the files relevant to the issue and identifies patterns:

  • Naming: camelCase vs. snake_case, file naming conventions, component naming patterns
  • Testing: Jest, Vitest, pytest — and where tests live relative to source files
  • Architecture: MVC, service layers, module boundaries, import patterns
  • Dependencies: What libraries are already in package.json/requirements.txt — the agent uses existing deps instead of adding new ones
  • Formatting: Inferred from existing code and any config files (Prettier, ESLint, Black)

This context feeds into every subsequent agent in the pipeline. The builder writes code that looks like your code, not generic AI output.

Isolation and Security

Each job runs in its own Fargate container with:

  • No cross-job state: One job cannot see another job's data
  • Network isolation: The container has outbound access (for package registries and APIs) but is isolated from your internal network
  • Ephemeral storage: The container and all data are destroyed after the job completes
  • Read-write access only to the branch: Agents work on a dedicated branch, never directly on main

Your source code is accessed via the GitHub App you install — the same permission model you use for CI/CD tools. Zapat never stores your source code beyond the lifetime of a job.

The Result

Because agents have full codebase context, the code they produce:

  • Follows your existing patterns and conventions
  • Uses dependencies already in your project
  • Places files in the correct directories
  • Names functions and variables consistently with your style
  • Includes tests that follow your existing test patterns

This is the difference between "AI that writes code" and "AI that writes code for your project."

What We Do Not Do

Zapat does not fine-tune models on your codebase. Your code is not used for training. We use large foundation models (currently Anthropic Claude) with dynamic context from your repository. When the job is done, the container is destroyed and your code is gone from our systems.