Bun loose
Bun-first projects (Bun 1.4.3) that stay friendly to the Node ecosystem. Bun substitutions warn; reproducible installs, type safety, failure handling, tests and evidenced completion block. Rule IDs G/D/N/T/S/R/Q/C.
Set this profile
ccpp cpo profile set bun-looseInside Claude Code, prefix the command with ! to run it in the session. Downloading a profile needs a Builder or Team plan; listing them does not.
Policies
82 policies, grouped by what they guard.
Secrets & private data 2
Credentials, keys and personal data stay out of files, logs, commands and the conversation.
bun-n14-fast-hash-passwordsN14 · Passwords are never hashed with Bun.hash or a fast digest (SHA, MD5, CryptoHasher, createHash)
bun-r10-inline-envR10 · Browser bundles never inline the whole environment (bun build --env=inline, env: "inline")
Untrusted input 3
Requests, downloads and tool output are validated before they reach SQL, a shell, eval or a deserializer.
bun-r07-sql-interpolationR07 · SQL text is never built by interpolating or concatenating values (bind them)
bun-r08-shell-injectionR08 · Strings never become shell syntax: no sh -c with interpolation, no raw Bun Shell input, no exec of built strings
bun-t10-cast-as-validationT10 · Parsed JSON and request payloads are validated, not cast to a type
Network & TLS 2
Outbound data, verified certificates, destinations taken from requests and services exposed to others.
bun-r09-tls-bypassR09 · Certificate verification stays on in production code (no rejectUnauthorized: false, no NODE_TLS_REJECT_UNAUTHORIZED=0)
bun-r09-tls-environmentR09 · Commands, env files and CI never set NODE_TLS_REJECT_UNAUTHORIZED=0
Weakened checks 10
Suppressions, disabled lint or CI steps and relaxed strictness need a reason or the user's approval.
bun-c05-ci-gatesC05/G07 · CI keeps its check steps: no removed test/check/lint step, no continue-on-error or || true on one
bun-c05-noop-scriptsC05 · package.json check scripts keep running real checks (no echo/exit 0/|| true, no pass-with-no-tests added)
bun-c05-swallowed-exitC05 · Commands and the scripts they run never hide a failing check (|| true, ; exit 0, --pass-with-no-tests)
bun-g07-exceptions-fileG07 · The user approves every change Claude makes to the G03 exceptions file (file tools ask)
bun-g07-exceptions-shellG07 · Shell commands never write the G03 exceptions file (undone and refused)
bun-q01-focused-commitsQ01 · A commit never records focused tests; CI and package scripts never run bun test --only
bun-q09-coverage-thresholdQ09 · Declared coverage thresholds are never lowered or removed (bunfig.toml [test], package.json jest)
bun-t04-tsconfig-strictT04 · tsconfig keeps its strictness floor; a new tsconfig enables strict, noUncheckedIndexedAccess, noFallthroughCasesInSwitch, noImplicitOverride
bun-t08-type-escapesT08 · New explicit any, as-unknown-as bridges and non-null assertions become unknown plus narrowing (warns)
bun-t09-suppressionsT09 · No blanket diagnostic suppression; a targeted @ts-expect-error or disable states its reason
Error handling 2
Failures are propagated or handled, never swallowed or turned into fake success.
bun-r03-swallowed-errorsR03 · Catch handlers do not silently swallow errors or fake success
bun-r04-subprocess-exitR04 · Subprocess results are observed: no discarded Bun.spawn/spawnSync or .nothrow() shell result
Async & concurrency 2
Owned tasks, awaited promises, preserved cancellation and no blocking on event loops.
bun-r01-floating-promisesR01 · A promise created by a statement has a rejection owner (await, return or handler; language server types)
bun-r02-async-foreachR02 · No async callback in forEach: completion and failures must propagate
Performance & resource bounds 2
Timeouts, bounded retries and fan-out, reused clients, closed resources, no N+1 queries.
bun-r05-sync-in-handlersR05 · Request handlers avoid synchronous filesystem, process and hashing work (warns)
bun-r06-fetch-deadlineR06 · Outbound fetch calls carry a deadline (an abort signal) (warns)
Architecture & boundaries 4
Declared layers and dependency directions, no import cycles, small modules, explicit dependencies.
bun-s01-cross-package-importsS01 · Shipped code does not reach into another workspace package through a relative path (use its declared entrypoint)
bun-s02-import-cycleS02 · A new runtime import does not close a two-module cycle (the imported module imports this one) (warns)
bun-s03-import-side-effectsS03 · Reusable modules do not start servers, spawn processes or write files at import time (warns)
bun-s04-unused-privateS04 · New module-private functions and constants are used somewhere in the module (warns)
Versions & deprecated APIs 1
Code matches the installed version, without removed, renamed or deprecated APIs.
bun-g01-pinned-versionG01/D01 · Tells Claude, at session start, which Bun version capability claims are judged against
Dependencies & toolchain 38
Packages change through the package manager, lockfiles stay consistent and the project's tools are used.
bun-c01-build-targetC01 · bun build of code that uses Bun APIs targets Bun (--target=bun); the default target is the browser
bun-c04-node-exports-typescriptC04 · A package that promises Node (engines.node) does not export TypeScript sources Node cannot load
bun-d01-ci-bun-versionD01 · CI and images run an exact Bun version, the one the project pins (setup-bun, oven/bun images)
bun-d02-package-managerD02 · Prefer Bun for installs and scripts; npm, pnpm or yarn may stay when the chosen workflow is consistent (warns)
bun-d03-package-manager-mismatchD03 · Dependencies change only through the package manager the project declares (packageManager field, lockfile)
bun-d03-second-lockfileD03 · No second lockfile next to another package manager's lockfile
bun-d04-ci-frozen-installD04 · CI and image builds install from the lockfile and fail on drift (bun install --frozen-lockfile, bun ci)
bun-d04-stale-lockfileD04 · A turn that changes package.json dependencies also updates the lockfile next to it (once per stop)
bun-d05-auto-installD05 · Shipped entrypoints and CI never rely on Bun's runtime auto-install (-i, --install=fallback|force, install.auto)
bun-d05-versioned-importsD05 · Code never imports a package with a version in the specifier (Bun auto-install syntax)
bun-d06-undeclared-importsD06 · Code imports only packages its own package.json declares (hoisting and neighbouring manifests do not count)
bun-d07-trust-allD07 · Dependency lifecycle scripts are trusted one by one, never all at once
bun-d07-trusted-dependenciesD07 · Packages added to trustedDependencies by hand are named with the reason they need install scripts (warns)
bun-d08-dev-only-runtime-importD08 · Production code does not import packages declared only in devDependencies (warns: bundled output may inline them)
bun-d08-tooling-in-dependenciesD08 · Test, lint and type tooling goes to devDependencies: a package.json listing it in dependencies is refused (shell writes undone)
bun-d08-tooling-installD08 · Test, lint and type tooling is installed as a development dependency (bun add -d), never as a production one
bun-d09-workspace-referencesD09 · Local packages are referenced through workspaces (workspace:*), not file:/link: copies or registry ranges (warns)
bun-d10-unpinned-runnersD10 · One-off tools run pinned or from the lockfile; project tools are not installed globally (warns)
bun-d11-overlapping-librariesD11 · A new dependency does not duplicate a responsibility an existing one already covers (warns, for review)
bun-n01-test-runnerN01 · Prefer Bun for unit and integration tests; Vitest, Jest or Mocha may stay when compatible with the project's runtime (warns)
bun-n02-typescript-executionN02 · Prefer Bun for running TypeScript and JSX; tsx, ts-node or Babel loaders may stay when compatible with the project's runtime (warns)
bun-n03-bundlerN03 · Prefer Bun for bundling; esbuild, Rollup, Webpack, Vite, Parcel or tsup may stay when compatible with the project's runtime (warns)
bun-n04-env-loadingN04 · Prefer Bun for loading .env files; dotenv loaders may stay when compatible with the project's runtime (warns)
bun-n05-watch-modeN05 · Prefer Bun for restarting or reloading on change; nodemon or ts-node-dev may stay when compatible with the project's runtime (warns)
bun-n06-http-clientN06 · Prefer Bun for HTTP requests; node-fetch, axios or got may stay when compatible with the project's runtime (warns)
bun-n07-http-serverN07 · Prefer Bun for HTTP servers and routing; Express, Koa, Fastify or another Node server framework may stay when compatible with the project's runtime (warns)
bun-n08-websocketN08 · Prefer Bun for WebSocket servers and clients; ws or another WebSocket package may stay when compatible with the project's runtime (warns)
bun-n09-file-ioN09 · Prefer Bun for whole-file reads and writes; fs-extra, rimraf, mkdirp or JSON file wrappers may stay when compatible with the project's runtime (warns)
bun-n10-process-executionN10 · Prefer Bun for running processes and shell commands; execa, cross-spawn, shelljs, zx or cross-env may stay when compatible with the project's runtime (warns)
bun-n11-globN11 · Prefer Bun for file globbing and pattern matching; glob, fast-glob, globby or minimatch may stay when compatible with the project's runtime (warns)
bun-n12-sql-driverN12 · Prefer Bun for PostgreSQL, MySQL and SQLite access; pg, postgres, mysql2 or SQLite drivers may stay when compatible with the project's runtime (warns)
bun-n13-redis-clientN13 · Prefer Bun for Redis access; redis or ioredis may stay when compatible with the project's runtime (warns)
bun-n14-password-hashingN14 · Prefer Bun for password hashing; bcrypt or argon2 packages may stay when compatible with the project's runtime (warns)
bun-n15-s3-clientN15 · Prefer Bun for S3 object storage; the AWS S3 SDK or MinIO client may stay when compatible with the project's runtime (warns)
bun-n16-uuid-v4N16 · Prefer crypto.randomUUID() and Bun.randomUUIDv7() to the uuid package for v4/v7 ids; uuid may stay (warns)
bun-t01-typecheck-toolT01 · Prefer bun check for type checking; a pinned TypeScript checker may stay (warns)
bun-t05-module-resolutionT05 · A tsconfig for Bun code resolves modules like Bun (bundler or nodenext), not node10/classic
bun-t06-bun-typesT06 · TypeScript using Bun APIs has Bun's type declarations (@types/bun) in its package
Tests 8
Tests assert behavior, stay deterministic and are not removed or skipped silently.
bun-q01-focused-testsQ01 · Claude does not finish a turn with focused tests (.only, fit, fdescribe) in the test files it changed (once per stop)
bun-q02-skipped-testsQ02 · A newly skipped or todo test says why on the line before it (warns)
bun-q03-untested-changeQ03 · A turn that changes production code also changes or adds a test, or says why none is needed (warns, once per stop)
bun-q04-tautological-assertionsQ04 · Assertions compare behavior, not a value with itself or a constant with itself (warns, for review)
bun-q06-unawaited-assertionsQ06 · Asynchronous assertions (.resolves, .rejects) are awaited or returned
bun-q07-test-stateQ07 · Tests restore what they change: spies, fake time, environment variables; module mocks are isolated (warns)
bun-q08-fixed-sleepsQ08 · Tests wait on readiness and use ephemeral ports, not fixed sleeps or fixed ports (warns)
bun-q10-snapshot-updatesQ10 · Updated snapshots are reviewed against intended behavior (bun test -u, hand-edited .snap files) (warns)
Completion evidence 8
A turn ends with its checks run and passing; claims of success need proof after the last edit.
bun-c02-check-callRecords which checks (typecheck, test, lint) a shell call runs, scripts and task runners (turbo) included, when they cover the changed packages (C02 ledger)
bun-c02-completion-claimsC02/C05 · A final message claiming passing tests, types or lint needs a successful run after Claude's last edit
bun-c02-evidence-ledgerRecords, per session, Claude's code edits (file tools and shell writes) and the checks that succeeded after them (C02)
bun-c02-required-checksC02 · A turn that changed code ends only after the required checks succeeded on the final files (once per stop)
bun-pm-callRecords that a shell call runs a package-manager operation, so the manifest and lockfile writes it causes are not hand edits (D02, D06)
bun-s07-placeholdersS07 · Newly shipped behavior has no placeholder returns or not-implemented stubs (warns)
bun-t07-new-type-errorsT07 · A turn adds no TypeScript errors to the changed files or their importers (language server, once per stop)
bun-turn-baselineRecords the work tree when a prompt starts: the baseline of the end-of-turn rules (D04, T07, Q03, C02)