agentleFS
bitsandbytes-foundationbitsandbytes-foundation/bitsandbytes/CLAUDE.md

bitsandbytes

CLAUDE.md8.5k starsChanged 3 years agoMITView on GitHub

NEVER work on a fix or feature branch inside the main ~/git/bitsandbytes checkout. Always create a worktree first: This keeps the main checkout clean and allows parallel sessions. If you are already inside a worktree directory, you do not need to create another one. Before creating a worktree, check the worktree registry for existing ones — see the Git Worktrees section in ~/.claude/CLAUDE.md. Bitsandbytes-specific naming conventions: agents/worktreeguide.md. General worktree guide: ~/git/labtools/worktree_guide.md. Before working on any issue, check whether a PR…

We split this CLAUDE.md into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    NEVER work on a fix or feature branch inside the main ~/git/bitsandbytes checkout.

    line 3
  2. Distinctive:

    Before working on any issue, check whether a PR already exists:

    line 17
  3. Distinctive:

    If a PR exists, review and build on it instead of starting from scratch.

    line 23
  4. Distinctive:

    Before pushing a PR branch, you MUST run the full pre-commit suite.

    line 27
  5. Distinctive:

    Do NOT run the full test suite — it takes 10+ minutes.

    line 37
  6. Distinctive:

    When tasked with reviewing a pull request, you MUST read these guides before starting the review:

    line 55

≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

MANDATORY: Use git worktrees for all branch work

NEVER work on a fix or feature branch inside the main ~/git/bitsandbytes checkout. Always create a worktree first:

cd ~/git/bitsandbytes
git worktree add ~/git/bnb-fix-<NUMBER> -b fix/issue-<NUMBER>
cd ~/git/bnb-fix-<NUMBER>

This keeps the main checkout clean and allows parallel sessions. If you are already inside a worktree directory, you do not need to create another one.

Before creating a worktree, check the worktree registry for existing ones — see the Git Worktrees section in ~/.claude/CLAUDE.md. Bitsandbytes-specific naming conventions: agents/worktree_guide.md. General worktree guide: ~/git/lab_tools/worktree_guide.md.

MANDATORY: Check for existing PRs before starting work

Before working on any issue, check whether a PR already exists:

gh pr list --search "issue-number OR keyword" --state open

If a PR exists, review and build on it instead of starting from scratch. Do not create duplicate work.

MANDATORY: Run linting before every pull request

Before pushing a PR branch, you MUST run the full pre-commit suite. CI will reject PRs that fail any check:

pre-commit run --all-files

This runs ruff, ruff format, typos, trailing-whitespace, clang-format, and all other CI lint hooks. Review and commit any changes it makes. Do NOT run only ruff check and ruff format — those are just 2 of 10 hooks. Full details: agents/linting_guide.md

Testing: only run relevant tests

Do NOT run the full test suite — it takes 10+ minutes. Instead, run only the tests that cover the code you changed:

pytest tests/test_relevant_file.py -v --tb=short -k "relevant_test_name"

The full suite will be run separately. Best practices and known issues: agents/testing_guide.md

Agent Dispatch (the "Dispatcher" role)

To triage open GitHub issues, generate prompt files, and launch parallel worker agents, read agents/dispatch_guide.md. If told "you're the Dispatcher" or "please read the Dispatch Guide," that's what this refers to. The dispatch workflow uses the GitHub issue tools in agents/ — see agents/github_tools_guide.md for the bitsandbytes-specific reference.

Issue maintenance and triage

To identify and close stale, duplicate, or resolved issues: agents/issue_maintenance_guide.md. Common closeable patterns (old CUDA setup, Windows pre-support, third-party app issues, etc.) are cataloged in agents/issue_patterns.md.

Pull request review

When tasked with reviewing a pull request, you MUST read these guides before starting the review:

  1. agents/pr_review_guide.md — The complete review workflow (classification, checklists, verdict format, and posting instructions). This is the primary guide; follow its steps sequentially.
  2. agents/architecture_guide.md — Codebase architecture and patterns
  3. agents/code_standards.md — Code quality expectations
  4. agents/api_surface.md — Public API catalog (for detecting breaking changes)
  5. agents/downstream_integrations.md — How Transformers, PEFT, Accelerate, TGI, and vLLM depend on bitsandbytes (for assessing downstream impact)
  6. agents/security_guide.md — Trust model and security checklist (especially for external contributor PRs)

For CUDA kernel changes, also read agents/kbit_gemm_context.md. The PR review guide references all of these at the appropriate steps.

Download now (ZIP)

Trending

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Aug 30: 0 new projectsWeek of Sep 6: 0 new projectsWeek of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projects
Aug 2026Sep 2026Oct 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about bitsandbytes-foundation/bitsandbytes

The biggest 5 of 50 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 50

Talked about on GitHub and Stack Overflow (50 times).

On GitHub · 47

42 more on GitHub

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.