Guide — 10 short reads
Guide
Installation, first sessions, prompts that hold and the two safety rules that actually cost money. No account, no check — read it and close the tab.
Setup
Getting the tools onto the machine, once.
Install Claude Code on macOSTerminal, one command, two minutes
- Open Terminal (⌘ + Space, type Terminal).
- Run
curl -fsSL https://claude.ai/install.sh | bash. - Start it with
claudeand sign in through the browser. - If the shell says
command not found, close and reopen the terminal so the PATH refreshes.
Install Claude Code on WindowsPowerShell, not cmd.exe
- Open Windows Terminal or PowerShell (Win + X → Terminal).
- Run
irm https://claude.ai/install.ps1 | iex. - Start it with
claudefrom the project folder. - In
cmd.exethe installer will not run — use PowerShell.
Install Node.js the way tools expectnvm on macOS and Linux, official installer on Windows
- macOS/Linux: install nvm, then
nvm install --lts, so versions can be switched later. - Windows: the official installer from nodejs.org, tick “Add to PATH”.
- Check with
node -vandnpm -v. - Avoid
sudo npm install -g: it writes into system folders and later breaks permissions. Use nvm or a user prefix.
Put the project in git before the agent touches itA clean diff is your undo button
git initand commit the current state.- Ask the agent for changes one task at a time.
git diffshows exactly what changed;git checkout -- .reverts everything if a run goes sideways.- Commit after each accepted change, not at the end of the day.
Usage
How to ask so the answer is usable.
First session in a folderPoint at files, not at the whole disk
cdinto the project, runclaude.- Start with: “read
src/app.tsand the README, then tell me how routing works” — a read-only task, no edits. - Only after that ask for a change, one file at a time.
- Keep the session short: a long one drifts, and every turn carries the whole history.
Prompt structure that survivesRole, inputs, constraints, format, example
- Say who the model is: “senior editor”, “backend engineer”, “QA”. It changes wording, not knowledge.
- List inputs as a block: the text, the data, the file names.
- State constraints: length, tone, what to avoid, what must stay.
- Ask for a format: a table, a JSON object, three bullets. Add one short example if the shape matters.
Put variables in one placeReuse a prompt without rewriting it
- Keep the prompt as a file with placeholders:
{{product}},{{audience}},{{tone}}. - Change only the placeholder values between runs.
- Keep the rest byte-identical: providers cache the unchanged prefix, and a stable prefix is cheaper and more consistent.
Let the agent show its workDiff first, apply second, test third
- Ask: “show the diff, do not apply yet”.
- Read the diff. If it touches files you did not mention, ask why before accepting.
- Apply, then run the project's own check — tests, build, lint — not the agent's description of them.
- If a check fails, paste the output back instead of describing it.
Safety
The two mistakes that cost real money.
Secrets never go into a promptEnv vars, .gitignore, rotate on leak
- Keep keys in environment variables (
~/.config/app.env) or the tool's own settings, never in the chat. - Add
.envto.gitignorebefore the first commit. - Pasted a key by accident? Rotate it in the provider console — chats and logs keep copies.
- Never let an agent print a key “to check it works”; check with a request instead.
Read the command before Entercurl | bash runs whatever the server sends today
- Check the domain in the URL:
claude.ai,nodejs.org, the vendor's own docs. - If a page tells you to paste an obfuscated one-liner, decode it first or skip it.
- Prefer installers that are documented publicly over commands from a chat or an ad.
- A terminal has no undo: the command runs with your user rights, not with the site's.