Skip to content

Ignore rules, redaction & budgets

Ignore rules

ctxpack combines three sources (later ones can override earlier via ! negation):

  1. Built-in defaultsnode_modules/, .git/, dist/, lockfiles, .env*, common binary asset extensions, etc. (see DEFAULT_IGNORES).
  2. Your .gitignore at the repo root (unless useGitignore: false).
  3. --ignore globs passed on the CLI (repeatable).

The matcher supports a common .gitignore subset: comments (#), negation (!), anchoring (/prefix), directories (trailing/), and * / ** globs. It's intentionally pragmatic, not a full gitignore implementation.

Secret redaction

On by default. Recognized and replaced with placeholders:

Kind Example → placeholder
Private keys -----BEGIN … PRIVATE KEY-----[REDACTED PRIVATE KEY]
JWTs eyJ….eyJ….sig[REDACTED JWT]
AWS keys AKIA…[REDACTED AWS KEY]
GitHub tokens ghp_…[REDACTED GITHUB TOKEN]
Slack tokens xoxb-…[REDACTED SLACK TOKEN]
API keys sk-…[REDACTED API KEY]
Assignments password = "…"password = "[REDACTED]"

Redaction is best-effort — always review output before sharing. Disable with --no-redact if you're fully offline and trust the destination.

Token budget

--budget <n> (or budgetTokens) includes files until the running estimate would exceed n; remaining files are reported in skippedFiles. Tokens are estimated at ~4 characters each — fast and model-agnostic, close enough for budgeting.

Binary & size handling

Files containing a null byte are treated as binary and skipped. Files larger than maxFileBytes (default 512 KB) are skipped too. Both show up in skippedFiles.