Skip to main content

oncebitten

PyPI npm

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.

Caught: a Claude correction, a Codex revert and a failing Cursor test each count as evidence. Rule: oncebitten proposes the strongest rule that fits (a check, then an instruction, then nothing) and you approve it. Enforced: git push, CI and pull requests stop on py-utcnow: use datetime.now(UTC).

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): the claude path runs end to end against real Claude Code sessions (scripts/e2e-live.sh), codex 0.167.2 fails the hooks-off proof and is refused, and opencode has fake-host tests only; triage drafts proposed rules that wait for review in oncebitten proposals (docs/proposals.md) and proposals deliver sends an accepted rule to a pull request.

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.5.0"]
{ "devDependencies": { "oncebitten": "0.5.0" } }
# .pre-commit-config.yaml: prebuilt binary from PyPI, no Rust toolchain
repos:
  - repo: https://github.com/bcmyguest/oncebitten
    rev: v0.5.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.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for oncebitten 0.5.0
File Actions
oncebitten-0.5.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for oncebitten-0.5.0-py3-none-win_amd64.whl
oncebitten-0.5.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.musllinux_1_2_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64, Linux musl 1.2+ x86-64 Details for oncebitten-0.5.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.musllinux_1_2_x86_64.whl
oncebitten-0.5.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.musllinux_1_2_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64, Linux musl 1.2+ ARM64 Details for oncebitten-0.5.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.musllinux_1_2_aarch64.whl
oncebitten-0.5.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for oncebitten-0.5.0-py3-none-macosx_11_0_arm64.whl
oncebitten-0.5.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for oncebitten-0.5.0-py3-none-macosx_10_12_x86_64.whl

Total release size: 40.0 MB

Release files / oncebitten-0.5.0-py3-none-win_amd64.whl

Download URL oncebitten-0.5.0-py3-none-win_amd64.whl
Size 8.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
1d0be151e5aaefc59468b7119083d62bcacc5d921a324989e77c5213d1200fc5
BLAKE2b-256 checksum
How to use checksums
837e17213ff525f6f75f2ecfcea445dc225eb99c4f9202d53461b74d9b65f38b
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 18, 2026.

Transparency log

Release files / oncebitten-0.5.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.musllinux_1_2_x86_64.whl

Download URL oncebitten-0.5.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.musllinux_1_2_x86_64.whl
Size 8.5 MB
Tags Linux glibc 2.17+ x86-64 Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
504dcba13e7daf35fab5c2e4758f3895436b64867f76e9872ede31f834b6b60d
BLAKE2b-256 checksum
How to use checksums
6beffefa16874c02ee8f9847d08e14fe71bb865d3eaadfdb6ce5c44f2754e7f2
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 18, 2026.

Transparency log

Release files / oncebitten-0.5.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.musllinux_1_2_aarch64.whl

Download URL oncebitten-0.5.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.musllinux_1_2_aarch64.whl
Size 8.1 MB
Tags Linux glibc 2.17+ ARM64 Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
dd7ff4a0bfb10ad559a42f0eb17cb1156772bd08d76535ec0d5e1e3c24c47578
BLAKE2b-256 checksum
How to use checksums
97abff515094b6851cf85e952b8336aa318d36041ffe3fdf80fc33933edf3d5b
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 18, 2026.

Transparency log

Release files / oncebitten-0.5.0-py3-none-macosx_11_0_arm64.whl

Download URL oncebitten-0.5.0-py3-none-macosx_11_0_arm64.whl
Size 7.5 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
946fbce2c336b2ce3298318e95e50ae19330d7266dd1baf3730de75326c6f9e7
BLAKE2b-256 checksum
How to use checksums
e264ba08240ed45268007ff4fece479a9ce716132741c92975d638319525376d
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 18, 2026.

Transparency log

Release files / oncebitten-0.5.0-py3-none-macosx_10_12_x86_64.whl

Download URL oncebitten-0.5.0-py3-none-macosx_10_12_x86_64.whl
Size 7.7 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
bcb74d54aaff897741ffe6faa398cba1aa667238fad3556ac5dc71d743e5d6de
BLAKE2b-256 checksum
How to use checksums
429d6ec76e0d76a2d81e9fe6010dde92d570f3c1e4fbf80473b49b2cf468d037
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 18, 2026.

Transparency log

Security for oncebitten 0.5.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.

Select from 5 files

Attestation for oncebitten-0.5.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 18, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page