tokei
$ tokei Community Low Risktokei counts files, code lines, comments, and blanks across 150+ languages in milliseconds while honoring .gitignore. Its --output json mode gives agents an immediate quantitative map of a repository before deeper code inspection.
brew install tokei Running tokei --output json locally finishes in milliseconds with zero RPC or MCP overhead.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --output json (and yaml/cbor), clean non-TTY stdout, and deterministic zero-prompt execution.
- Native
--output jsonstructured statistics
Purely read-only local Rust binary with zero network access and automatic .gitignore skipping.
- Zero write, network, or credential side effects
Single static Rust binary available via brew, cargo, and OS package managers.
- Cross-platform static binary for macOS, Linux, and Windows
Gives agents instant codebase sizing and language mix in under 100ms.
- Parallel language-aware line counting across 150+ languages
Widely adopted OSS standard (XAMPPRocky/tokei) under dual MIT/Apache-2.0 license.
- Established OSS tool with broad CI and developer adoption
Concise --help and README covering output formats and sorting flags.
- Clear README and
--helpreference
Security, Auth & Guardrails
None required; reads local source files only.
100% free, offline, and open-source (MIT / Apache-2.0).
# tokei Agent Rules - Use `tokei --output json` (optionally piped through `jq`) when first sizing an unfamiliar repo. - Pass `-e` to exclude generated vendor directories if they are committed outside `.gitignore`.
Agent-Ready Command Recipes
Safe Read-Only Queries
tokei --output json .
Outputs per-language file counts, code lines, comments, and blanks in JSON.
tokei -s code src/
Prints a compact summary table sorted by lines of code.
Strengths for Agents
- + Strictly read-only with native
--output jsonfor instant repository profiling. - + Automatically respects
.gitignoreand counts 150+ languages accurately.
Caveats & Pitfalls
- ! Full
--output jsonpayload includes per-file entries by default—pipe tojqor omit--fileson giant monorepos.