Classify files
classify_filesClassify files into your custom labels using a decision model, returning grouped results with calibrated confidence. Use it to triage tests, configs, and dead code, or sort documents by topic.
Instructions
Classify every file in the given paths into your labels with a decision model (one very cheap request per file, calibrated confidence). Returns files grouped by label. Good for triage: tests/configs/dead code, sorting documents by topic, flagging files about X. Label descriptions after a colon noticeably improve accuracy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Override the OpenRouter decision model for this call, e.g. cloudflare/clef (see list_models) | |
| paths | Yes | Files and/or directories to read (absolute or relative to the project root) | |
| format | No | Output format (default grouped) | |
| labels | Yes | Label names, optionally with a description after a colon, e.g. ["bug: describes a defect", "feature", "question"] | |
| dry_run | No | Only list which files would be scanned and the estimated tokens; no API call | |
| exclude | No | Extra globs to skip, e.g. ["**/*.test.ts"] | |
| include | No | Glob patterns inside directories, e.g. ["**/*.ts", "docs/**/*.md"]. Default: all text files | |
| multi_label | No | Allow several labels per file (default false) | |
| instructions | No | Extra classification criteria | |
| respect_gitignore | No | Skip files ignored by the directory's .gitignore (default true) | |
| max_chars_per_file | No | Truncate each file to this many chars, keeping head and tail (default 12000; capped to the model's context) |