Identify the file path the user mentioned. If no path is given, ask for one — do not guess.
Read the file with the Read tool.
Split the content on whitespace (Unicode-aware whitespace, not just spaces). A "word" is a non-empty token between whitespace runs.
Reply with exactly one line in this shape:
<N> words in <path>
Example: 142 words in src/README.md.
Constraints
Do not output anything else — no summary, no commentary, no breakdown by line.
If the file is empty, reply 0 words in <path>.
If the file does not exist or cannot be read, reply cannot read <path> — do not fabricate a count.
1---2name: wordcount3description: Word Count4---56# Word Count78Count the words in a file the user specifies.910## Procedure11121. Identify the file path the user mentioned. If no path is given, ask for one — do not guess.132. Read the file with the Read tool.143. Split the content on whitespace (Unicode-aware whitespace, not just spaces). A "word" is a non-empty token between whitespace runs.154. Reply with exactly one line in this shape:16 ```17 <N> words in <path>18 ```19 Example: `142 words in src/README.md`.2021## Constraints2223- Do not output anything else — no summary, no commentary, no breakdown by line.24- If the file is empty, reply `0 words in <path>`.25- If the file does not exist or cannot be read, reply `cannot read <path>` — do not fabricate a count.
Run npx skillmds@latest add duthaho/wordcount in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Word Count It is listed under Docs & Writing on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
duthaho (@duthaho) published this skill. Their other Agent Skills are listed on their SkillMD profile.