# Source file token estimation

The bundled scripts inventory source-like files, estimate tokens with a bytes-divided-by-four proxy, and model line-chunk scenarios. Results separate production, test, and debug files so recommendations reflect their different roles.

Package version: 0.1.0-beta.7.

Included with [Faye Coding Assistant](/plugins/faye-coding-assistant/).

## When to use

Use this when you explicitly want approximate file-context measurements or split scenarios.

## What to provide

- The repository or bounded directory to scan.
- Optional minimum file size, chunk sizes, and an explicit destination if you want a saved report.

## Expected results

- File, package, and category totals with stated assumptions and exclusions.
- Hypothetical split comparisons and guidance on which large files warrant closer examination.

## Example requests

### Try this request

#### Codex

```
$source-file-token-estimation Estimate large source and test files in this repository and compare 200-, 400-, and 700-line split scenarios. Return the report here without writing files.
```

#### Grok

```
/source-file-token-estimation Estimate large source and test files in this repository and compare 200-, 400-, and 700-line split scenarios. Return the report here without writing files.
```

#### Antigravity

```
/source-file-token-estimation Estimate large source and test files in this repository and compare 200-, 400-, and 700-line split scenarios. Return the report here without writing files.
```

## Requirements

- An explicit request for source-file token estimation.
- Node.js for the dependency-free scripts; Git improves discovery by respecting ignore rules.

## Scope and limitations

- The estimates do not measure actual Codex usage, billing, cost, or which files the model reads.
- Split scenarios do not establish runtime or build-speed gains.
- Analysis is read-only; saving a report requires an explicit output path.

## Related guides and supporting files

- [Source footprint analyst](/agents/faye-coding-assistant/source-file-token-estimator/) — Defines a read-only role for explicit file inventories and approximate token-footprint scenarios.
- [Faye Coding Assistant](/plugins/faye-coding-assistant/) — Understand repositories, plan and implement changes, diagnose failures, and review code with clear evidence.
- [Shared file analysis](/scripts/faye-coding-assistant/common-workspace-analysis-cc37385f/) — Computes file categories, line counts, aggregates, and hypothetical split costs.
- [File analysis options](/scripts/faye-coding-assistant/analysis-options-64a2f205/) — Parses and validates shared size thresholds and chunk-size options.
- [Source file discovery](/scripts/faye-coding-assistant/workspace-discovery-5b1d0b26/) — Selects candidate source-like files for the inventory and token estimation workflows.
- [Source footprint report command](/scripts/faye-coding-assistant/source-file-token-estimate-752cfe6e/) — Produces approximate token totals and hypothetical line-chunk comparisons for large source-like files.
- [Workspace file inventory command](/scripts/faye-coding-assistant/workspace-file-inventory-ac1f6451/) — Lists the large source-like files and metadata used by token-footprint analysis.

## Technical source

[Open original source](/marketplace/plugins/faye-coding-assistant/skills/source-file-token-estimation/SKILL.md)

Source path: plugins/faye-coding-assistant/skills/source-file-token-estimation
