# File Counter

> Count files and lines of code in a project using a script. Use when the user asks for project statistics, file counts, line counts, or codebase size.

- Skill: `yinuo-136/file-counter` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add yinuo-136/file-counter`
- Raw SKILL.md: https://api.skillmd.com/api/skills/yinuo-136/file-counter/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: yinuo-136 (https://skillmd.com/u/yinuo-136)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/yinuo-136/file-counter

---


# File Counter

Count files and lines of code in a project directory.

> **Demo Purpose**: This skill demonstrates the `scripts/` directory — Agent executes the bundled Python script instead of generating code on the fly.

## When to Use

- User asks "how big is this project?"
- User wants file/line counts or codebase statistics
- User says "count files", "count lines", or "project stats"

## Instructions

Run the bundled counting script:

```bash
python scripts/count.py [target-directory]
```

If no directory is specified, it counts from the current project root.

### Options

```bash
# Count all files in current project
python scripts/count.py .

# Count only a subdirectory
python scripts/count.py src/

# Exclude certain patterns
python scripts/count.py . --exclude node_modules,.git,__pycache__
```

## Output

The script outputs a summary table like:

```
Project Statistics: ./my-project
================================
Extension   Files   Lines
----------  -----   -----
.py            12    1,540
.ts            25    3,210
.md             8      620
.json           5      180
----------  -----   -----
TOTAL          50    5,550
```

## Notes

- The script skips binary files automatically
- Hidden directories (starting with `.`) are excluded by default
- Use `--exclude` to skip additional directories

