oncebitten
oncebitten turns repeated agent mistakes into rules that git enforces. When the same mistake shows up in two sessions, or you state a rule once, it proposes a check. You approve it, and the check then runs at pre-push and in CI.
Docs: https://bcmyguest.github.io/oncebitten/
Status: pre-alpha. Capture, evidence clustering, check, replay, the gate, steer rules, exceptions, retire, rollback and doctor work; triage is implemented for claude, codex and opencode (docs/triage.md), with fake-host tests only; triage drafts proposed rules that wait for review in oncebitten proposals (docs/proposals.md); delivery to pull requests is not started (PLAN.md).
Install
Pick the host you use; each section is copy-pasteable. The plugins download the release binary on first use and check its SHA-256. For the command line (gate, evidence, check) see Command line.
Claude Code
/plugin marketplace add bcmyguest/oncebitten
/plugin install oncebitten@oncebitten
Codex
codex plugin marketplace add bcmyguest/oncebitten
Then install oncebitten from /plugins.
Copilot CLI
copilot plugin marketplace add bcmyguest/oncebitten
copilot plugin install oncebitten@oncebitten
Cursor
Import https://github.com/bcmyguest/oncebitten as a team marketplace (Dashboard, Settings, Plugins).
pi
pi install git:github.com/bcmyguest/oncebitten
opencode
opencode loads plugins from npm or local files only, so install the command line below, then:
oncebitten hooks install --host opencode --scope user
Do not run hooks install for a host whose plugin is installed: each event would be captured twice.
Command line
Any one of these puts oncebitten and oncebitten-checker on your PATH. None needs a Rust toolchain except the last.
uvx oncebitten --version # run once, no install (PyPI)
uv tool install oncebitten # install (PyPI)
npx oncebitten --version # run once (npm)
npm install -g oncebitten # install (npm)
curl -fsSL https://raw.githubusercontent.com/bcmyguest/oncebitten/main/install.sh | sh # macOS, Linux
irm https://raw.githubusercontent.com/bcmyguest/oncebitten/main/install.ps1 | iex # Windows PowerShell
cargo install --locked --git https://github.com/bcmyguest/oncebitten oncebitten # from source; needs a C compiler
install.sh and install.ps1 verify the release's SHA-256 before installing. Pinning, mirrors and variables: docs/install.md.
Teams
Pin one version for everyone so the gate behaves the same on every machine and in CI.
# pyproject.toml
[dependency-groups]
dev = ["oncebitten==0.1.0"]
{ "devDependencies": { "oncebitten": "0.1.0" } }
# .pre-commit-config.yaml: prebuilt binary from PyPI, no Rust toolchain
repos:
- repo: https://github.com/bcmyguest/oncebitten
rev: v0.1.0
hooks:
- id: oncebitten-gate-python
Usage
oncebitten config show # merged configuration as TOML
oncebitten config show --origin # annotate each value with its layer
oncebitten config path # configuration files it reads
oncebitten check # run active rules against changes since HEAD
oncebitten replay <rule-id> # prove a rule in an OpenShell sandbox; writes proof.json
oncebitten gate pr --base origin/main # CI gate: new violations of active block rules
oncebitten baseline update # accept today's violations in .oncebitten/baseline.json
oncebitten hooks install --host claude --scope user # capture and steer hooks; also codex, cursor, copilot, opencode, pi
oncebitten hooks uninstall --host claude --scope user
oncebitten evidence list # mistake clusters seen in 2+ sessions, or stated once
oncebitten evidence reject <id> --reason "one-off"
oncebitten stats [--since <days>] [--json] # read-only funnel: signals to clusters to drafts to decisions
Rules: docs/rules.md. Example rules: examples/. Gate, proofs and baseline: docs/gate.md. Agent-facing summary: llms.txt.
Funnel counts per mistake class: docs/stats.md.
Hooks record prompts and tool outcomes locally: docs/capture.md lists what each host reports and how each was verified. docs/evidence.md covers clustering and rejections.
Steer rules cover lessons git cannot see, such as running sudo: they inform or deny the agent at the tool call. docs/steer.md lists what each host supports.
Settings and their precedence: docs/configuration.md.
Gate
# .pre-commit-config.yaml
repos:
- repo: https://github.com/bcmyguest/oncebitten
rev: <commit or tag>
hooks:
- id: oncebitten-gate-python # prebuilt wheel; or oncebitten-gate (builds from source), oncebitten-gate-system (installed binary)
pre-commit install --hook-type pre-push
oncebitten rules sync # writes .oncebitten/rules.lock; commit it
The gate needs pre-commit 3.2.0 or later, prek 0.1.5 or later, or uv's uvx to run either. CI templates for GitHub Actions, GitLab CI and Azure Pipelines: templates/. In CI, run oncebitten rules sync --frozen before the gate.
Development
Build and test with cargo test; CI also runs cargo fmt --check and cargo clippy --all-targets -- -D warnings on Linux, macOS and Windows. The build order and open steps live in PLAN.md.
This repository gates itself with the shipped rust-no-unwrap example, enabled in .oncebitten/config.toml. It has no baseline: the gate fails on any non-test .unwrap() in the crate, and test code is exempt.
License
Apache-2.0. See LICENSE.
Metadata
Release files for oncebitten 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 39.6 MB
Release files / oncebitten-0.1.0-py3-none-win_amd64.whl
| Download URL | oncebitten-0.1.0-py3-none-win_amd64.whl |
|---|---|
| Size | 8.2 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
834c5abd373baa216b5db45ab99e59bfe4752914b323f5ce441763e34bd2c479
|
|
BLAKE2b-256 checksum How to use checksums |
a46c8617405a19320a172e8b2c61454f6af0e4eae3d9a5ab1a7c5c8f8c34ac61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / oncebitten-0.1.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.musllinux_1_2_x86_64.whl
| Download URL | oncebitten-0.1.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.musllinux_1_2_x86_64.whl |
|---|---|
| Size | 8.4 MB |
| Tags | Linux glibc 2.17+ x86-64 Linux musl 1.2+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
287735381a541297a120fe31c3acf52b9fb7353a0c283d48a0cc627b5e21a1ee
|
|
BLAKE2b-256 checksum How to use checksums |
afa69e4650e38424a5c5d3ed6784198d98fbc845ef2c3dd32b13c3492e346aa1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / oncebitten-0.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.musllinux_1_2_aarch64.whl
| Download URL | oncebitten-0.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.musllinux_1_2_aarch64.whl |
|---|---|
| Size | 8.0 MB |
| Tags | Linux glibc 2.17+ ARM64 Linux musl 1.2+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
45477ac7911d9a956288f8bc1db6a13fa7c4738776d7bcf86413edec7e9c8134
|
|
BLAKE2b-256 checksum How to use checksums |
b5613b593bda19f2460368f0978f11faf6c6a5527bb4cdd6596eccd8016ea822
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / oncebitten-0.1.0-py3-none-macosx_11_0_arm64.whl
| Download URL | oncebitten-0.1.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 7.4 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a127fbc1a52bb1862951fbf1f4e5a13e720b12643826544e3ac225c77e1b6de9
|
|
BLAKE2b-256 checksum How to use checksums |
acfa15adc74e0d734ce4f9032ca159277ace7d76f3c450414ffc28b007c949df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / oncebitten-0.1.0-py3-none-macosx_10_12_x86_64.whl
| Download URL | oncebitten-0.1.0-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 7.6 MB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
bbc301fa4add82b690dcc38107545e0a23adbe2c58f6d0df09a2cc1f4bf1f0be
|
|
BLAKE2b-256 checksum How to use checksums |
96e63785d5e2d904c504390e0f3d4cfeb18a3d0fe1d336567b6f9a328c690765
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logSecurity for oncebitten 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 5 files in this release have been uploaded with provenance metadata.
Attestation for oncebitten-0.1.0-py3-none-win_amd64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.