Scope Inference

Automatic scope detection from file paths using various strategies.

Hunknote automatically detects scope from your staged files.

Strategies

Auto (Default)

Tries all strategies and uses the best match.

hunknote --scope-strategy auto

Monorepo

Detects scope from monorepo directory structures.

packages/auth/src/login.py → scope: auth
apps/web/components/Button.js → scope: web

Recognized roots: packages/, apps/, libs/, modules/, services/

hunknote --scope-strategy monorepo

Path-Prefix

Uses the most common path segment.

api/routes.py → scope: api
api/models.py → scope: api
hunknote --scope-strategy path-prefix

Mapping

Uses explicit path-to-scope configuration.

scope:
  strategy: mapping
  mapping:
    "src/api/": api
    "src/web/": ui
hunknote --scope-strategy mapping

None

Disables scope inference.

hunknote --scope-strategy none
# or
hunknote --no-scope

Precedence

Scope is determined in order (first wins):

  1. --scope <value> CLI flag
  2. --no-scope CLI flag
  3. LLM suggested scope
  4. Heuristics-based inference
  5. No scope

Debug

hunknote --debug

Shows: strategy used, inferred scope, confidence, final scope.