# Path set classify

`path-set-classify` · version 1.0.0 · File paths (lexical) · free, no key needed

Classify an array of file paths by file extension, depth histogram, and path format.

**Use when you need to: classify paths · path set classify · file extension breakdown.**

## Supported

- classify paths
- path set classify
- file extension breakdown
- path depth histogram

## Not supported

- stat file
- filesystem access
- detect file type by content

## Behavior

- by_extension: map from lowercased extension (including dot) to count, empty string for no extension. by_depth: map from depth integer (0=root-level file) to count. by_format: count of paths detected as posix vs windows. no_extension: paths with no file extension.

## Input

- `paths` (array of string, required): min items 0; max items 10000
- `format` (one of "posix", "windows", "auto", optional)

## Output

- `total` (integer, optional)
- `by_extension` (object, optional)
- `by_depth` (object, optional)
- `by_format` (object, optional)
- `no_extension` (integer, optional)
- `format` (string, optional)

## Limits

- max paths: 10000
- max path bytes: 4096

## Example

Request input:

```json
{
  "paths": [
    "src/a.ts",
    "src/b.ts",
    "test/c.spec.ts",
    "README.md",
    "Makefile"
  ]
}
```

Response:

```json
{
  "result": {
    "total": 5,
    "by_extension": {
      ".ts": 3,
      ".md": 1,
      "": 1
    },
    "by_depth": {
      "0": 2,
      "1": 3
    },
    "by_format": {
      "posix": 5,
      "windows": 0
    },
    "no_extension": 1,
    "format": "auto"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "path-set-classify",
  "version": "1.0.0",
  "input": {
    "paths": [
      "src/a.ts",
      "src/b.ts",
      "test/c.spec.ts",
      "README.md",
      "Makefile"
    ]
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/path-set-classify/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"paths":["src/a.ts","src/b.ts","test/c.spec.ts","README.md","Makefile"]}'
```

The machine-readable contract is at [/v1/tools/path-set-classify/versions/1.0.0](/v1/tools/path-set-classify/versions/1.0.0).

### CLI

```sh
node cli.mjs run path-set-classify 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Path lexical parse](/tools/path-lexical-parse): Decompose a file path into its lexical components without accessing the filesystem.
- [Path set dedupe](/tools/path-set-dedupe): Deduplicate an array of paths based on lexical equivalence while preserving first or last seen order.
- [Path set difference](/tools/path-set-difference): Compute the set difference (A \ B) of two path collections using lexical path equivalence.
- [Path set glob filter](/tools/path-set-glob-filter): Filter an array of paths against glob patterns with inclusion and exclusion rules lexically without filesystem access.
- [Path set hierarchy tree](/tools/path-set-hierarchy-tree): Transform a flat array of file paths into a nested deterministic directory tree structure.
- [Path set ignore filter](/tools/path-set-ignore-filter): Filter paths against gitignore-style rule lines (negation, comments, directory trailing slashes) lexically.
