Your course progress0 of 14 chapters

Chapter 17

Interactive Tools

Four tools that turn what we learned into something you can play with:

  • A terminal simulator, to practice commands with zero risk.
  • A config file generator, for CLAUDE.md and read blocks.
  • A prompt builder, which assembles a good prompt according to the golden rule from chapter 4.
  • A token calculator, which shows how much space your project takes up and why the habits from chapter 10 save.

Terminal simulator

Not confident yet? Practice here. This is a simulation in the browser: nothing actually runs and no file changes. Type claude to "enter", then try /help, /context, /compact, or a request in plain English. You can also click the commands below the window. The up arrow brings back earlier commands.

~/my-project

A simulated terminal. Nothing really runs, and no files change.

Start with: claude, then try /help

CLAUDE.md and read-block generator

Check what fits your project, and get two ready-made files: CLAUDE.md with the instructions, and .claude/settings.json that blocks Claude from reading sensitive files.

Tech stack

Interface

Working rules

Files Claude won't read

Instructions: CLAUDE.md
# Family Recipe Site ## Stack & commands- Next.js (App Router), TypeScript, Tailwind CSS.- Dev: npm run dev. Before finishing: npm run build. ## Interface- The UI supports right-to-left languages. Use ms/me/ps/pe instead of ml/mr/pl/pr.- Every page must work on a 375px-wide screen. ## Working rules- Answer in plain language. Briefly explain technical terms the first time.- Before a change touching more than three files, show a plan and wait for approval.- Never git push --force and never push directly to main. Commit messages in English. ## Compaction instructions- When compacting, always keep the list of files we changed and any open bugs.
Blocks: .claude/settings.json
{  "permissions": {    "deny": [      "Read(./.env)",      "Read(./.env.*)",      "Read(./secrets/**)",      "Read(./**/*.pem)",      "Read(./**/*.key)",      "Bash(git push --force *)",      "Bash(git push -f *)"    ],    "ask": [      "Bash(git push *)"    ]  }}

Why not .claudeignore? According to the official docs, that file has no effect. Read rules under deny are what actually block reading (chapter 10).

Prompt and skill builder

Choose a task, a technology, a level of detail and extras, and get a prompt ready to paste. Want it to be a standing process? Choose the SKILL.md file format, and save the file in the folder shown in the header (chapter 11).

1. Task type

2. Tech stack

3. Detail level

4. Extras

5. Format

Ready to paste into Claude Code
Build a new feature: [describe what it does and for whom].The project uses Next.js.Follow the project's existing structure and style.First explain briefly what you plan to do, then do it.Add or update automated tests, and run them.At the end, make sure everything works (npm run build) and tell me what you did.

Replace the parts in square brackets with your own details.

Token and cost calculator

What is a million tokens, in practice?

At a rough estimate of about 10 tokens per line of code, a million tokens is roughly 100,000 lines of code, or several whole books of English text. A typical context window holds a few hundred thousand tokens, and for some models a million. Sounds like a lot? Remember that with every message the whole conversation is resent (chapter 12): a file Claude read once "costs" again with every message until the end of the conversation, or until /compact or /clear.

Play with the numbers, and see what has the biggest effect:

Project size

60
120
30%
40
20%

The whole project is roughly 72K tokens. It fits entirely in a regular context window, but that doesn't mean it's worth reading all of it.

Whole project72K
Peak session context, no optimization117K

Bars are relative to a million-token window.

Total input, no optimization

3.1M

≈ $9.31

With /compact every 20 messages + file exclusion

2.2M

≈ $6.63

Savings

29%

in input tokens

Rough estimate only: about 10 tokens per line of code, 15K tokens of base context, and 2K tokens added per message. The calculator ignores prompt caching, which substantially cuts the cost of the repeated part. On a subscription, cost counts toward your usage limit rather than a separate bill. Current prices: claude.com/pricing.

What about prompt caching?

The calculator counts how many tokens are sent, but they don't all cost the same. With every message, the start of the conversation is identical to that of the previous message, and the server briefly remembers it. It reads that part from the cache, at a much lower price, and fully processes only what's new (chapter 12). So in practice the cost is lower than the calculator's number, as long as you preserve the cache: don't switch models mid-task, and compact at natural breaks.

What the calculator shows

  • "How much of the project Claude reads" is the most influential number. Specific requests with @file (chapter 4) bring it down dramatically.
  • /compact every 20 messages keeps the conversation from ballooning. In a long session, it's the difference between a conversation that costs several times more and a lean one.
  • Excluding files with Read rules under deny and with .gitignore, and not with .claudeignore, which doesn't work (chapter 10), saves reading irrelevant files.