Use when counting lines of code, computing LOC metrics, or formatting LOC reports with tokei.
From loc-guardiannpx claudepluginhub xiaolai/claude-plugin-marketplace --plugin loc-guardianThis skill uses the workspace's default tool permissions.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
tokei (install via brew install tokei).venv, __pycache__, node_modules, .git, dist, build, *.lock, *-lock.yaml, *-lock.jsontests, test, spec, __tests__, __test__, e2e, integration-tests, test-utils, fixtures, mocks*_test.*, *.test.*, *_spec.*, *.spec.*, test_*.*js/javascript → JavaScript, ts/typescript → TypeScript, cpp/c++ → C++, py/python → Python, rb/ruby → Ruby, sh/bash/shell → Shell, rs/rust → Rust, kt/kotlin → Kotlin| Metric | Definition |
|---|---|
| Pure LOC | Code lines from production files only (no tests, no blanks, no comments) |
| Raw LOC | Total lines (code + comments + blanks) across all files |
| Test LOC | (All-files code lines) minus (production-only code lines) |
| Test:Prod ratio | Test LOC / Pure LOC, formatted as N.NN:1 |
| Comment density | comments / (code + comments) * 100, from all files |
| Blank line % | blanks / total * 100, from all files |
.claude/loc-guardian.local.md YAML frontmatter field max_pure_loc| Language | Files | Code | Comments | Blanks | Total |
|----------|------:|-----:|---------:|-------:|------:|
With a bold Total row at the bottom.
| Metric | Value |
|-------------------------------|--------|
| **Pure LOC** (prod code only) | N |
| **Raw LOC** (all files) | N |
| **Test LOC** | N |
| **Test:Prod ratio** | N.NN:1 |
| **Comment density** | N.N% |
| **Blank line %** | N.N% |
| # | File | Code |
|---|------|-----:|
Top 10 largest production files by code lines. Paths relative to project root.
| # | File | Pure LOC | Limit | Over By |
|---|------|--------:|------:|--------:|
| # | File | Pure LOC | Limit | Usage |
|---|------|--------:|------:|------:|
Always end the report with exactly this format:
**VERDICT: N over limit, M warnings | limit: L**
Where N = number of over-limit files, M = number of warning-zone files, L = configured limit. Example: **VERDICT: 3 over limit, 5 warnings | limit: 350** or **VERDICT: 0 over limit, 0 warnings | limit: 350**.
After the verdict, if no config file exists, add: *Run /loc-guardian:init to configure.*
Always append a fenced data block after the verdict for downstream consumption (even if empty):
```loc-data
OVER path/to/file.ts 482
OVER path/to/other.py 378
WARN path/to/growing.ts 310
```
One file per line: OVER|WARN <path> <pure_loc>. This block is machine-readable and used by the optimizer agent.