> For AI agents: the complete documentation index is available at https://jig.md/llms.txt, the full documentation bundle is available at https://jig.md/llms-full.txt.

# Limits and defaults

Use this reference when a review or Run reaches a resource limit. Find the
affected task, then use its supported control. Values apply independently
unless the table describes a shared budget. A larger package allowance does
not increase a Run's memory, deadline, or retained storage.

MiB means 1,048,576 bytes. File counts include alias records where dependency
preparation records them. The tables are checked against their implementation
owners during documentation checks. Exact admission and execution requirements
remain in [project policy](https://jig.md/spec/project-policy.md).

## Override dependency preparation limits

`PACKAGE_BUN_PROJECT_COUNT_LIMIT` means review reached its allowance for distinct dependency preparations.
For a larger Flow library, increase only the count in `jig.ts`:

```ts
import { defineJig, discover } from '@jigging/jig'

export default defineJig({
  flows: discover('./flows'),
  bindings: discover('./bindings'),
  limits: {
    dependencies: {
      maxPreparations: 32,
    },
  },
})
```

Or select the allowance for one review through the operator environment:

```sh
JIG_LIMITS_DEPENDENCIES_MAX_PREPARATIONS=32 jig review
```

The count includes Flow dependencies, declared npm Flow adoption, and evaluation recipes that require preparation.
Each distinct captured preparation input counts once during that review.
Reusing admitted dependencies consumes no preparation count.
The count can therefore differ from the number of Flows.

The diagnostic reports the first rejected count as a lower bound, the effective limit, and its source.
Review stops at that boundary, so the diagnostic does not establish the library's total preparation count.
The aggregate content and deadline limits below still apply when you increase `maxPreparations`.

`PACKAGE_BUN_OUTPUT_LIMIT` means one package's prepared runtime dependency tree exceeded its byte or file allowance.
Check its production dependencies first.
When the complete tree is necessary, set the affected output allowance under `limits.dependencies`:

```ts
limits: {
  dependencies: {
    maxPreparedBytes: 64 * 1024 * 1024,
    maxPreparedFiles: 8192,
  },
},
```

The corresponding environment variables accept decimal integers in bytes or file counts:

```sh
JIG_LIMITS_DEPENDENCIES_MAX_PREPARED_BYTES=67108864 \
JIG_LIMITS_DEPENDENCIES_MAX_PREPARED_FILES=8192 \
jig review
```

Each field resolves independently: **environment variable → `jig.ts` → built-in
default**. An invalid explicit value fails, including an empty environment
variable. Jig does not load project `.env` files automatically.

All three fields must be positive safe integers within the supported maxima below.
The byte and file combination must also fit the canonical artifact capacity, including maximum-length paths and archive metadata.
Reduce either output allowance if that combination exceeds capacity. File content alone does not measure archive size.

When preparation exceeds an allowance, its diagnostic reports the effective
limit and source. Project limits form part of the reviewed configuration. An
environment override applies to that review's preparation. Later Runs consume
the retained bytes without preparing dependencies again. These controls grant
no network access or additional Run powers. Fresh resolution still requires
[`--allow-resolution-network`](https://jig.md/build/dependencies.md#fresh-resolution-and-network-access).

## Choose the appropriate control

| Control              | How to change it                                                                                                   |
| -------------------- | ------------------------------------------------------------------------------------------------------------------ |
| Config / environment | Use the documented `jig.ts` key or environment variable. Precedence is field-specific as described above.          |
| Run option           | Use `jig run --timeout DURATION`. An approved entrypoint can provide a default. Explicit Run arguments replace it. |
| Reviewed grant       | Change the resource policy in a Binding or named grant, then review the authority change.                          |
| Fixed                | No config or environment override exists. The task explanation identifies the protected boundary.                  |
| Derived              | Jig calculates the bound from other allocations. It has no independent override.                                   |

An explicit Run option does not replace a reviewed grant. Each owner enforces
its allowance, and descendants share the remaining root deadline.

Linux enforces hard aggregate memory, process, and CPU ceilings. Mac applies
the same requested values through supervised sampling and termination. Short
overshoot is possible. Wall-clock deadlines and confirmed descendant fencing
still apply on both hosts. See
[host enforcement](https://jig.md/spec/project-policy.md#containment-and-lifetime).

<!-- limit-reference:start -->

## Prepare runtime dependencies

The preparation count covers one review. Byte and file controls apply to each production package. Fixed aggregate content and deadline bounds still apply.

| Setting or bound                                    | Value                                                                            | Control              |
| --------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------- |
| `limits.dependencies.maxPreparations` (per review)  | Default 16. Supported maximum 256                                                | Config / environment |
| `limits.dependencies.maxPreparedBytes`              | Default 32 MiB (33,554,432 bytes). Supported maximum 128 MiB (134,217,728 bytes) | Config / environment |
| `limits.dependencies.maxPreparedFiles`              | Default 4,096. Supported maximum 65,536                                          | Config / environment |
| Captured source before installation, per package    | 16 MiB (16,777,216 bytes) / 4,096 files                                          | Fixed                |
| Aggregate prepared content, per review              | 256 MiB (268,435,456 bytes)                                                      | Fixed                |
| Whole preparation phase deadline                    | 180 seconds                                                                      | Fixed                |
| Workspace members in execution layout               | 256                                                                              | Fixed                |
| Additional workspace source roots, per review       | 32                                                                               | Fixed                |
| Each source-root operand and resolved absolute path | 4,096 UTF-8 bytes                                                                | Fixed                |
| Dependency aliases in execution layout              | 4,096                                                                            | Fixed                |
| Execution layout JSON                               | 1 MiB (1,048,576 bytes)                                                          | Fixed                |
| Evaluation dependency closure                       | 128 MiB (134,217,728 bytes) / 8,192 files                                        | Fixed                |

Policy owners: [`project/limits.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/project/limits.ts), [`internal/bun-native-preparation-protocol.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/internal/bun-native-preparation-protocol.ts), [`internal/bun-native-preparation-budget.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/internal/bun-native-preparation-budget.ts), [`internal/bun-execution-layout.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/internal/bun-execution-layout.ts), [`internal/workspace-source-roots.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/internal/workspace-source-roots.ts).

## Retain captured packages

Archive capacity includes metadata and retained evidence. These fixed store bounds prevent unbounded durable growth. Dependency settings do not enlarge them.

| Setting or bound                    | Value                           | Control |
| ----------------------------------- | ------------------------------- | ------- |
| One canonical captured artifact     | 192 MiB (201,326,592 bytes)     | Fixed   |
| Captured package store, per project | 1,024 MiB (1,073,741,824 bytes) | Fixed   |
| Package/0 format files              | 65,536                          | Fixed   |
| Package/0 format individual file    | 1,024 MiB (1,073,741,824 bytes) | Fixed   |
| Package/0 format aggregate content  | 4,096 MiB (4,294,967,296 bytes) | Fixed   |
| Logical package path                | 1,024 UTF-8 bytes               | Fixed   |

Policy owners: [`package/capacity.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/package/capacity.ts), [`internal/package-artifact-store.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/internal/package-artifact-store.ts).

## Bound a Run and its child work

The Run deadline covers its descendants. Fixed process budgets and derived branch reservations keep concurrently owned work inside the root allocation.

| Setting or bound                                  | Value                                      | Control        |
| ------------------------------------------------- | ------------------------------------------ | -------------- |
| Root Run deadline                                 | Default 30 seconds. Maximum 86,400 seconds | Run option     |
| Native Agent turns                                | Default 1. Range 1–8                       | Reviewed grant |
| One Flow: memory / process tasks                  | 256 MiB (268,435,456 bytes) / 64           | Fixed          |
| One Flow: CPU quota                               | 0.5 core                                   | Fixed          |
| Root: memory / process tasks                      | 1,792 MiB (1,879,048,192 bytes) / 576      | Fixed          |
| Root: CPU quota                                   | 3.5 cores                                  | Fixed          |
| Concurrent sibling Flows / exclusive leaf effects | 2 / 1                                      | Fixed          |
| Maximum child Flow levels                         | 5, subject to whole-branch reservations    | Derived        |
| Flow cleanup deadline                             | 5 seconds                                  | Fixed          |

Policy owners: [`internal/root-run-timeout-policy.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/internal/root-run-timeout-policy.ts), [`internal/root-operation-limits.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/internal/root-operation-limits.ts), [`internal/native-agent-turn-policy.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/internal/native-agent-turn-policy.ts).

## Capture and deliver files

Binding-retained reads and per-run attachments share the invocation input allowance. Fixed path and capture bounds protect descriptor traversal, transport and delivery.

| Setting or bound                                   | Value                                                                             | Control |
| -------------------------------------------------- | --------------------------------------------------------------------------------- | ------- |
| Invocation input / artifact input / output content | 64 MiB (67,108,864 bytes) / 16 MiB (16,777,216 bytes) / 16 MiB (16,777,216 bytes) | Fixed   |
| Files / tree entries                               | 64 / 256                                                                          | Fixed   |
| Relative path depth / length                       | 16 components / 512 UTF-8 bytes                                                   | Fixed   |
| Input capture / file delivery deadline             | 10 seconds / 20 seconds                                                           | Fixed   |

Policy owners: [`internal/file-input-policy.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/internal/file-input-policy.ts).

## Delegate HTTP requests

Request, response and deadline allowances belong to the reviewed HTTP grant. The original root deadline and supported maxima continue to apply.

| Setting or bound | Value                                                              | Control        |
| ---------------- | ------------------------------------------------------------------ | -------------- |
| `requestBytes`   | Default 256 KiB (262,144 bytes). Maximum 8 MiB (8,388,608 bytes)   | Reviewed grant |
| `responseBytes`  | Default 1 MiB (1,048,576 bytes). Maximum 12 MiB (12,582,912 bytes) | Reviewed grant |
| `timeoutMs`      | Default and maximum 60 seconds                                     | Reviewed grant |

Policy owners: [`project/grants.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/project/grants.ts).

## Run project commands and evaluations

These fixed profiles bound reviewed tools and their collected outputs. Evaluation phases also share the evaluation deadline and original root lifetime.

| Setting or bound                                       | Value                                                                           | Control |
| ------------------------------------------------------ | ------------------------------------------------------------------------------- | ------- |
| Project Command input files / aggregate bytes          | 64 / 256 KiB (262,144 bytes)                                                    | Fixed   |
| Project Command arguments / bytes per argument         | 32 / 1 KiB (1,024 bytes)                                                        | Fixed   |
| Project Command stdin / retained stream                | 16 KiB (16,384 bytes) / 64 KiB (65,536 bytes)                                   | Fixed   |
| Project Command deadline                               | 10 seconds                                                                      | Fixed   |
| Evaluation candidate source                            | 64 files / 8 MiB (8,388,608 bytes)                                              | Fixed   |
| Evaluation collected outputs                           | 64 files / 8 MiB (8,388,608 bytes) aggregate / 2 MiB (2,097,152 bytes) per file | Fixed   |
| Evaluation memory / scratch capacity                   | 512 MiB (536,870,912 bytes) / 512 MiB (536,870,912 bytes)                       | Fixed   |
| Evaluation total / generate / compile / test deadlines | 60 seconds / 15 seconds / 30 seconds / 15 seconds                               | Fixed   |
| Author declarations evaluated per review               | 256                                                                             | Fixed   |
| Author evaluation deadline per entry: Linux / Mac      | 3 seconds / 10 seconds                                                          | Fixed   |

Policy owners: [`internal/private-project-command.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/internal/private-project-command.ts), [`internal/project-evaluation-policy.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/internal/project-evaluation-policy.ts), [`internal/project-evaluator-policy.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/internal/project-evaluator-policy.ts).

## Exchange Agent protocol messages

These fixed ACP bounds protect one finite conversation. Additional reviewed turns share its byte and frame budgets. Environment variables cannot change the wire contract.

| Setting or bound                 | Value                                             | Control |
| -------------------------------- | ------------------------------------------------- | ------- |
| One protocol frame               | 16 MiB (16,777,216 bytes)                         | Fixed   |
| Adapter aggregate bytes / frames | 8 MiB (8,388,608 bytes) / 64                      | Fixed   |
| Client aggregate bytes / frames  | 32 MiB (33,554,432 bytes) / 8,192                 | Fixed   |
| Prompt / public answer text      | 1 MiB (1,048,576 bytes) / 8 MiB (8,388,608 bytes) | Fixed   |
| Updates / permissions            | 4,096 / 256                                       | Fixed   |
| Protocol identifier              | 1 KiB (1,024 bytes)                               | Fixed   |

Policy owners: [`internal/finite-acp-policy.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/internal/finite-acp-policy.ts).

## Save checkpoints

The fixed checkpoint profile bounds retained evidence during one root lifetime. Checkpoint success does not reset any Run allowance.

| Setting or bound                                       | Value                        | Control |
| ------------------------------------------------------ | ---------------------------- | ------- |
| Encoded checkpoint request                             | 2 MiB (2,097,152 bytes)      | Fixed   |
| Checkpoint text files / aggregate text content         | 64 / 1 MiB (1,048,576 bytes) | Fixed   |
| Checkpoint saves per invocation                        | 16                           | Fixed   |
| Retained checkpoint scopes per attempt, including root | 64                           | Fixed   |

Policy owners: [`internal/private-run-checkpoint.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/internal/private-run-checkpoint.ts).

## Inspect application composition

Each live snapshot carries one complete admitted composition or an explicit unavailable state. Fixed display bounds protect observation without changing execution authority.

| Setting or bound                            | Value                   | Control |
| ------------------------------------------- | ----------------------- | ------- |
| Flow context selected targets / connections | 256 / 1024              | Fixed   |
| Flow context inline value                   | 4 KiB (4,096 bytes)     | Fixed   |
| Components per composition                  | 256                     | Fixed   |
| Connections per composition                 | 1,024                   | Fixed   |
| Encoded composition                         | 256 KiB (262,144 bytes) | Fixed   |

Policy owners: [`packages/display-model/src/types.ts`](https://github.com/jiggy/jig/blob/main/packages/display-model/src/types.ts), [`internal/inspection-policy.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/internal/inspection-policy.ts).

## Explore before execution

Fixed exploration bounds retain complete approved configuration and bounded launch intent. Ordinary Run input, authority, and execution limits still apply.

| Setting or bound                             | Value                     | Control |
| -------------------------------------------- | ------------------------- | ------- |
| Approved workflows                           | 4,096                     | Fixed   |
| Complete project projection                  | 16 MiB (16,777,216 bytes) | Fixed   |
| Selected input schema and definitions        | 256 KiB (262,144 bytes)   | Fixed   |
| Run request envelope                         | 16 MiB (16,777,216 bytes) | Fixed   |
| Remembered request identities per session    | 128                       | Fixed   |
| Concurrent HTTP requests / project responses | 8 / 2                     | Fixed   |
| Request body read allowance                  | 10 seconds                | Fixed   |
| Private child handoff event                  | 16 KiB (16,384 bytes)     | Fixed   |

Policy owners: [`packages/display-model/src/types.ts`](https://github.com/jiggy/jig/blob/main/packages/display-model/src/types.ts), [`cli-explore-policy.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/cli-explore-policy.ts).

## Represent JSON values

JSON/0 is an interoperable value contract. Its representation bounds remain fixed, including when another configurable allowance is larger.

| Setting or bound                  | Value                                               | Control |
| --------------------------------- | --------------------------------------------------- | ------- |
| Encoded document / string         | 16 MiB (16,777,216 bytes) / 8 MiB (8,388,608 bytes) | Fixed   |
| Nesting depth / total value nodes | 128 / 262,144                                       | Fixed   |
| Entries in one object or array    | 65,536                                              | Fixed   |
| Member name / number token        | 1 KiB (1,024 bytes) / 128 bytes                     | Fixed   |

Policy owners: [`json.ts`](https://github.com/jiggy/jig/blob/main/packages/jig/src/json.ts).

<!-- limit-reference:end -->

## Related constraints and recovery

The dependency count setting covers distinct new preparations in one review, including evaluation recipes.
The byte and file settings cover each production preparation, including assembly with reused dependencies.
They do not change source capture, evaluation output, alias layout, aggregate review content, deadlines, or artifact storage.
Reused admitted packages consume none of the new-preparation count or aggregate output allowance.

Within one review, several Flow selectors can share a newly prepared capture.
Its files count once toward the aggregate limit. Each selector's retained
execution layout counts separately.

The captured package store retains evidence from declined and superseded
reviews. It performs no implicit garbage collection and offers no selective
reclamation command. State deletion is not a capacity-recovery instruction.
Follow [retained-state troubleshooting](https://jig.md/reference/troubleshooting.md#retained-state-cannot-be-opened) when retained state prevents progress.

Workspace discovery also bounds members, manifests, locks, patches, and tree
traversal. See [workspace capture](https://jig.md/spec/project-policy.md#workspace-dependency-capture)
for those exact rules. A format's larger upper bound does not enlarge a host
task's smaller allowance.

Separately mounted workspace dependencies require explicit review source-root
selections. Their fixed count and path bounds limit source authority and
directory acquisition. They have no override and do not enlarge capture budgets.
See [mounted workspace roots](https://jig.md/build/dependencies.md#separately-mounted-workspace-roots)
for selection and diagnosis.

For resource setup, see [Agent settings](https://jig.md/build/agents.md), [HTTP access](https://jig.md/build/http.md),
[files](https://jig.md/build/files.md), and [checkpoints](https://jig.md/spec/run-checkpoint.md). Terminal and
installation preferences belong in [Settings and configuration](https://jig.md/reference/configuration.md).
