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.3.0"]
{ "devDependencies": { "oncebitten": "0.3.0" } }
# .pre-commit-config.yaml: prebuilt binary from PyPI, no Rust toolchain
repos:
  - repo: https://github.com/bcmyguest/oncebitten
    rev: v0.3.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.3.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.3.0
File Actions
oncebitten-0.3.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for oncebitten-0.3.0-py3-none-win_amd64.whl
oncebitten-0.3.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.3.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.musllinux_1_2_x86_64.whl
oncebitten-0.3.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.3.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.musllinux_1_2_aarch64.whl
oncebitten-0.3.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for oncebitten-0.3.0-py3-none-macosx_11_0_arm64.whl
oncebitten-0.3.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for oncebitten-0.3.0-py3-none-macosx_10_12_x86_64.whl

Total release size: 39.8 MB

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

Download URL oncebitten-0.3.0-py3-none-win_amd64.whl
Size 8.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
df1b1fe81a9a908f82e81d7aef2ce42ac7f70429eb1a958006a9a58d54ca7cb0
BLAKE2b-256 checksum
How to use checksums
32da8cdf8d0e0199b91e1bb9e267afac3ee2827fd2b9d96a2867b19f5d61d65d
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.3.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.musllinux_1_2_x86_64.whl

Download URL oncebitten-0.3.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
d3f97519bf9000c761819bcc80767a5e8e9d927f31311895bfabe13d3b7a64fd
BLAKE2b-256 checksum
How to use checksums
4798d4902ad5d8e657e352c771d2b57e1a2f84b53daa25088e2b771a506dfcb8
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.3.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.musllinux_1_2_aarch64.whl

Download URL oncebitten-0.3.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
2cb0526c35b7788e599aaea7bd2764b9c99366d4172b1ef8bdc5a51969eb066a
BLAKE2b-256 checksum
How to use checksums
104419979cb5d603fb976e6abac4fd291234ade581b5f1f50058f548ded561a2
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.3.0-py3-none-macosx_11_0_arm64.whl

Download URL oncebitten-0.3.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
de981cf00be9e29fcfbe58d78f6bf1a4afc861961fc1db721e0bdb632f50f36c
BLAKE2b-256 checksum
How to use checksums
89c5f27ca0e55216aa6672def0617e93bd536001030a8b0ca8585ebe32e6cbbf
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.3.0-py3-none-macosx_10_12_x86_64.whl

Download URL oncebitten-0.3.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
5f5a304d52c58b90e40a6c88178a45fcac6e29f14c57829069d5f5aed7c6e527
BLAKE2b-256 checksum
How to use checksums
db8a2c54afd75d98d75147bb709c7543ee79b9e16ffcbf1a2ce62239e1daaa86
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.3.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.3.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