HANDS-ON TASK · 1 OF 1

Build and document a word-count CLI

Task: Build a CLI tool with Claude Code

Goal

Use Claude Code to build a small command-line tool from a written spec, then document it so the next session already knows how it works. This pulls together everything you have practiced: driving the console, granting file edits, reviewing what the agent writes, and saving project memory.

Set up the project

Run this to drop the project folder and its spec at /root/wordcount/:

bash
curl -fsSL https://raw.githubusercontent.com/Esc-Bash/project-init-scripts/main/claude-code/project-1/init.sh | bash

Read /root/wordcount/README.md first. It describes the tool you are going to build. There is no solution in there, only the spec.

What to build

Build the tool the README describes and land these exact files:

  • /root/wordcount/wc.sh - a bash script that takes a file path as its one argument, reads that file, and prints the word count and the line count, each with a clear label. It must be executable.
  • /root/wordcount/CLAUDE.md - project memory that explains what the tool does, how to run it, and anything worth remembering next time.

Practice

Start the console in the project folder and let Claude do the first draft:

bash
cd /root/wordcount
claude

Then ask for the tool, for example:

Read README.md, then create wc.sh exactly to that spec. Keep it plain bash.

Review the script, make it executable, and try it on a file of your own:

bash
chmod +x /root/wordcount/wc.sh
echo "the quick brown fox" > /root/wordcount/sample.txt
/root/wordcount/wc.sh /root/wordcount/sample.txt

When you are happy with it, have Claude document the tool. Running /init in the console writes a CLAUDE.md for you, or just ask it to write one.

Expected Result

A working wc.sh you can run on any file to get word and line counts, plus a CLAUDE.md that captures how it works. The checks confirm the spec is present, the script is executable, it prints numbers when run on a file, and the documentation is not empty.

Ready To Continue

Press Submit once wc.sh runs and prints counts and CLAUDE.md describes the tool.


Your lab setup

This VM comes with Claude Code preinstalled and signed in - just run claude to start.

Start the lab on the right to run checks.

Pass the checks to continue
Spin up a fresh environment and practice live.
claude-code-ubuntu · fresh machine · ready in under a minute