Claude Code setup guide + best commands
Claude Code is Anthropic's AI coding agent for your terminal. It reads your project, edits files, runs commands and handles git, and you just tell it what you want in plain English.
1. Install (2 minutes)
curl -fsSL https://claude.ai/install.sh | bash
irm https://claude.ai/install.ps1 | iex
Run this in PowerShell. Git for Windows is recommended.
npm install -g @anthropic-ai/claude-code@latest
Requires Node.js 22 or later. Don't use sudo.
2. First run
cd your-project claude
Log in when asked. Then type /init: Claude scans your project and writes a CLAUDE.md file with your stack, commands and conventions. It reads this file at the start of every session, so it's the single best thing you can do on day one.
3. Commands worth memorizing
| Command | What it does |
|---|---|
/init | Creates CLAUDE.md, the project's memory |
/clear | Fresh conversation. Use it when switching tasks |
/compact | Summarizes a long chat to free up context |
/context | Shows what's filling up the context window |
/model | Switch models |
/rewind | Undo back to an earlier point (code and chat) |
/resume | Pick up a past session |
/memory | Edit what Claude remembers (CLAUDE.md) |
/permissions | Choose which tools and commands are pre-approved |
/review | Code review of your changes |
/usage | See your usage and cost |
/mcp | Manage connected MCP servers |
4. Shortcuts
| Key | What it does |
|---|---|
Shift+Tab | Cycle modes, including plan mode (Claude plans first and edits only after you approve) |
Esc | Stop Claude mid-task |
Esc Esc | With an empty prompt: open the rewind menu |
@ | Reference a file, e.g. @src/app.ts |
! | Run a shell command directly, e.g. !npm test |
Ctrl+V / Alt+V | Paste a screenshot (macOS/Linux / Windows), or drag and drop an image |
5. Run it from scripts
claude -p "explain this repo" | One-shot answer, then exit, great for scripts |
claude -c | Continue your last conversation |
claude --resume | Choose a past session to resume |
claude update | Update to the latest version |
6. Give it superpowers with MCP
MCP servers connect Claude Code to other tools. Two favorites:
๐ญ Playwright: control a real browser
Claude can open your app, click around, fill forms and check that things actually work.
claude mcp add playwright -- npx @playwright/mcp@latest
๐ Context7: up-to-date library docs
Pulls current documentation for the libraries you use, so Claude doesn't write code for an old API version.
claude mcp add --transport http context7 https://mcp.context7.com/mcp
Check context7.com for the latest setup options.
See what's connected with claude mcp list.
7. Prompts that get better results
1 Plan before coding
2 Let it verify its own work
3 Learn a new codebase fast
8. Level up later
Subagents: specialized helpers with their own context window that report back a summary, keeping your main chat clean.
Skills: a SKILL.md file in .claude/skills/<name>/ with instructions Claude uses when relevant, or that you call with /name.
Hooks: shell commands that run automatically at set moments, e.g. a formatter after every edit.
Official docs: code.claude.com/docs
Saved you some time? โก
Like and save the post so you have this guide when you need it.
๐ Share the post to your story and tag me to get the bonus pack in your DMs.
Back to Instagram