BreadDocs
Browse documentation

Documentation

Introduction

Bread's bounded workflow, evidence, and release scope.

Open source

A local context layer

Give coding agents a smaller, fresher view of the workspace.

Bread bounds noisy reads and searches, preserves provenance, and stops stale edits before they reach disk.

49.6%
Replayed context reduction
≤0.001 ms
Pass-through p95
240
Codex adapter cases
0
Freshness ghost results

Start here

The Codex CLI path is Bread’s current live-validated release gate. The latest release bootstrap downloads a platform archive and verifies its SHA-256 digest:

curl -fsSL https://raw.githubusercontent.com/Yabuku-xD/bread/main/scripts/install-bread | sh

For a reproducible install, use an immutable release tag for both the installer script and release asset:

curl -fsSL https://raw.githubusercontent.com/Yabuku-xD/bread/<release-tag>/scripts/install-bread | sh -s <release-tag>

Codex

Add Bread's marketplace and install its plugin:

codex plugin marketplace add Yabuku-xD/bread
codex plugin add bread@bread

Start a new Codex session in the repository where you want Bread enabled, then open /hooks and review/trust Bread's exact command hook. The plugin invokes the bread binary installed above; it never downloads or executes a binary itself.

For a project-local hook instead of the plugin path, run bread install codex in the target repository. Do not use both hook surfaces: they would run the same Bread policy twice.

Need the full install and rollback path?
Read the Codex release guide →
Need codebase-indexing details?
Read the indexing contract →
Evaluating Grok Build?
Read the Grok integration guide →

Where Bread fits

Codex CLI
    │
    │ documented SessionStart, PreToolUse, PostToolUse, UserPromptSubmit events
    ▼
Bread hook and per-workspace daemon
    │
    ├── bounded search and read output
    ├── stale-edit and restricted-path checks
    ├── provenance, relevance gates, and session deduplication
    └── local lexical, structural, and optional semantic retrieval
    ▼
Native agent tools and the workspace

Unsupported events, untrusted or disabled hooks, malformed input, daemon failures, and timeouts fail open to native agent behavior. Bread is a bounded policy and context layer, not a universal interceptor.

What Bread changes

WorkflowWithout BreadWith Bread
Search a repositoryBroad command output can overwhelm contextRipgrep-compatible in-process search, ignore-aware discovery, structured capped matches
Read a large fileThe agent may receive the full fileA range or structural outline includes a freshness marker
Edit after a file changesAn old patch can target drifted contentBread denies the stale write and requests one narrow reread
Explore an unfamiliar codebaseRepeat searches and reconnect symbols manuallyBounded lexical, structural, and tested one-hop local-import context
Handle a vague promptGuess at useful repository text to addStay silent below the relevance gate

Bread uses ripgrep-compatible search crates in-process for search parity. It does not promise to outperform standalone rg at raw search throughput; its value is the bounded, safe agent workflow around that engine.

Evidence, not marketing arithmetic

All numbers below are local fixtures or matched sandbox measurements. They share a repository snapshot, policy, Codex CLI 0.144.3, gpt-5.6-terra, and low reasoning effort where stated. Sample sizes are intentionally visible because small samples and agent tool-choice variance do not establish universal outcomes.

The deterministic scorecard is deliberately narrower than the sandbox rows: it runs 128 synthetic PreToolUse pass-through decisions for a Bash ls event and reports Rust Instant percentiles; its replay reduction compresses a fixed 240-line output fixture and estimates tokens as characters divided by four. The rows labeled local sandbox n=… are separate matched observations, not scorecard medians. The five warmed release-run median described in the indexing contract applies only to its 2,000-declaration indexing fixture.

MeasurementBreadBaseline or thresholdEvidence
Broad Cargo.lock model-visible output4,172 chars73,408 chars94.3% lower, local sandbox, n=1
Broad Cargo.lock input tokens43,77970,43637.8% lower, local sandbox, n=1
Codex output tokens3201,10771.1% lower, matched pairs, n=2
Broad Cargo.lock wall time7.86 s9.74 s19.3% lower, local sandbox, n=1
README inspection wall time9.78 s7.36 s32.9% higher, local sandbox, n=1
Replayed context reduction49.6%40% targetDeterministic scorecard
Stale-edit prevention100%80% targetDeterministic replay
Freshness ghost results00 requiredDeterministic scorecard
Literal search matchesExact fixture setRipgrep reference setDeterministic parity check

The slower README inspection is important: Bread may add hook and decision overhead to a small direct read. It earns that cost only when it removes enough downstream context, repeated work, or unsafe state to repay it.

Run the default evidence scorecard yourself:

cargo run --quiet -- scorecard

Capabilities

Bounded search, reads, and edits

  • Search: ripgrep-compatible search crates, ignore-aware discovery, and structured output limits.
  • Reads: ranged reads and Tree-sitter outlines preserve useful source context while attaching freshness information.
  • Edits: deny rules run before disk access; stale patches are stopped before they can overwrite changed content.
  • Prompt context: eligible technical prompts can receive provenance-tagged, budgeted, session-deduplicated context. Vague or instruction-like prompts remain silent.

Workspace-local codebase indexing

Bread makes a deliberately narrow, inspectable index instead of claiming to replicate a proprietary indexer.

Index tierScopeResult
Native structuralRust, Python, JavaScript, TypeScript/TSXTree-sitter declarations, syntax status, and tested local imports
Bounded structuralRecognized languages with a conservative declaration formAt most 256 conservative declaration-aware chunks
LexicalUnknown or declaration-free textExact and lexical chunks without guessed structure
ExcludedDenied, ignored, .bread/, and .git pathsNever indexed

The static registry recognizes 115 language identifiers by filename, compound suffix, extension, modeline, shebang, or selected content signature. Known filenames and extensions use direct static dispatch: no runtime catalog, glob construction, registry scan, or heap allocation on that path.

Only tested repository-local imports expand a result. The index does not guess package, URL, absolute-path, standard-library, or bare-import edges. Complete generations are published atomically, so readers get the previous complete index or its replacement—not a half-updated graph.

Read the complete indexing contract →

Optional semantic retrieval

Exact symbols and lexical candidates are always available. With an explicit semantic build and opt-in, local vector candidates are fused with lexical results. A missing model, corrupt checkpoint, or semantic failure leaves the lexical tier available.

The default build does not download a semantic model or add a runtime language catalog. Build the opt-in tier only when validating it:

cargo build --features semantic --locked
./target/debug/bread index --semantic --query "authentication flow"

Hook scope and safety

For Codex, Bread registers:

  • SessionStart for startup, resume, clear, and compact;
  • PreToolUse and PostToolUse for Bash and apply_patch; and
  • UserPromptSubmit for prompt-context eligibility.

These boundaries are deliberate:

  • Ignore and deny rules run before indexing or context assembly.
  • Restricted paths never enter index records or prompt context.
  • When an installed, trusted, and healthy Bread hook evaluates a request, restricted paths are denied before disk access. Disabled or untrusted hooks, malformed input, daemon failures, and timeouts fall open to native behavior; Bread policy does not execute in those cases.
  • Hooks do not run compilers, language servers, external classifiers, or network downloads.
  • Missing daemons, parser errors, and unavailable optional assets fall back to the strongest safe lower tier.
  • The current Codex matrix has 200 local adapter cases: restricted-path denials, safe pass-throughs, concise and oversized outputs, eligible injections, and vague-prompt no-injection checks.

Commands

CommandUse it to
bread install codexAdd Bread-owned Codex hook entries to the current project
bread uninstall codexRestore the private backup or remove only Bread-owned entries
bread statusInspect daemon state plus index generation, coverage, record counts, and semantic-checkpoint presence
bread scorecardRun the deterministic default-feature evidence scorecard
bread inventoryPrint a bounded, metadata-only JSON overview of the workspace: file categories, byte totals, an estimated text-token cost, and a top-level directory breakdown
bread index --semantic --query "..."Build and query the optional local semantic index
bread run -- commandRun a command and compact its standard output

bread inventory is manual and metadata-only. It classifies files by name and extension and reads non-following metadata; it never opens contents, follows symlinks, builds the index, calls a model, or uses the network. Ignore rules, hidden-file policy, .git/ and .bread/ exclusion, and denied paths apply before counting, and only bounded aggregates are reported — never individual paths. Reach for it to orient in an unfamiliar workspace, then use search and ranged reads for specific code. It does not enable automatic media or document extraction. On Codex, one static session-start cue advertises it without injecting any workspace data.

Integration status

SurfaceCurrent position
Codex CLILive-validated release target in the shared isolated sandbox
Claude CodeProject adapter implemented; live CLI validation deferred
Grok BuildProject and user-hook adapters implemented; live CLI validation deferred

Bread does not install, upgrade, remove, or modify globally installed agent CLIs. Live integration testing stays inside an isolated sandbox with the cheapest capable model.

Release checklist

cargo fmt --all -- --check
cargo test --all-features
cargo clippy --all-targets --all-features -- -D warnings
cargo run --quiet -- scorecard
scripts/codex-release-smoke

The semantic smoke is opt-in:

BREAD_SEMANTIC_SMOKE=on scripts/codex-release-smoke

Deep dives