01
SHELL // TERMINAL BASICS
Where am I
pwdPrint current folder path
lsList visible files in current folder
ls -laList all files including hidden, with permissions and sizes
Move around
cd "path with spaces"Change folder — quote paths with spaces or special chars
cd ~Go to your home folder (/Users/macbookpro)
cd -Jump back to the previous folder
open .Open current folder in Finder
File ops
mkdir "Folder Name"Create a folder
cp file.txt dest/Copy file to destination
rm file.txtDelete file. No trash. Permanently gone.
rm -rf folderDelete folder and everything inside it. Triple-check the path.
cat file.txtPrint file contents to terminal
head -20 file.txtShow first 20 lines
tail -20 file.txtShow last 20 lines
Survival
↑ / ↓Recall previous commands
TabAutocomplete file paths and commands
Ctrl + CCancel the running command
Ctrl + LClear the terminal screen (or type clear)
02
CLAUDE // SESSION CONTROL
Start a session
claudeStart a normal interactive session in the current folder
claude --versionCheck the installed Claude Code version (need 2.1.51+ for Remote Control)
claude --remote-controlInteractive session, also drivable from web and mobile
claude --rc "Zacisze"Same as above with a custom session title shown in claude.ai/code
Server mode (multi-session)
claude remote-controlRun as a background server that can host many sessions on demand
claude remote-control --spawn=same-dirForce every spawned session into the current folder. Default — but worth being explicit.
claude remote-control --spawn=worktreeDO NOT USE. Creates a fresh git worktree per session — the exact behavior you're escaping.
Resume / end
/resumeInside a session: pick a previous session to continue
/exitEnd the current session
Always launch from your project root. If pwd shows anything under .claude/worktrees/ → stop, cd back to project root, restart.
03
CLAUDE // SLASH COMMANDS
Status & info
/helpList every slash command available
/statusShow login account, plan, and connection state
/contextHow much of the context window is used
/usageToday's token usage vs your plan limit
/extra-usageDetailed usage breakdown
/recapQuick summary of the session so far
Context management
/compactSummarize the conversation to free up context. Use mid-task when context fills up.
/clearWipe conversation context entirely. Drastic. Use only between unrelated tasks.
Session control
/remote-control "Name"Enable Remote Control on an already-running session
/rc "Name"Short form of above
/rename "New Title"Rename the current session
/mobileQR code to download the Claude mobile app
/configOpen the settings UI (enable Remote Control by default here)
/reload-pluginsReload skills and plugins without restarting
/mcpList and manage connected MCP servers
/pluginManage skills, plugins, and marketplaces
04
CLAUDE // AUTH
From terminal (no session)
claude auth loginSign in via claude.ai browser flow
claude auth logoutSign out completely from this device
Inside a session
/statusSee who you're signed in as and your plan
/loginSign in (opens claude.ai in your browser)
/logoutSign out of the current account
If Remote Control won't connect
echo $ANTHROPIC_API_KEYCheck whether an API key is set. If anything prints, that's why remote breaks.
unset ANTHROPIC_API_KEYRemove the API key from this terminal session
nano ~/.zshrcRemove or comment out any export ANTHROPIC_API_KEY=... line if it persists across terminals
05
CLAUDE // SKILLS & PLUGINS
Manage from inside Claude
/pluginOpen the plugin manager UI
/plugin marketplace add anthropics/skillsAdd the official Anthropic skills marketplace
/plugin install frontend-design@anthropic-agent-skillsInstall the frontend design skill (recommended for your project)
/plugin install skill-creator@anthropic-agent-skillsInstall the skill-builder skill (use it to create custom skills)
/plugin install document-skills@anthropic-agent-skillsBundle: docx + pdf + pptx + xlsx
From the shell
ls ~/.claude/skillsList user-level skills (available in every project)
ls .claude/skillsList project-level skills (only this project)
mkdir -p .claude/skills/my-skillScaffold a project skill folder
A skill is a folder with a SKILL.md file: YAML frontmatter (name, description) + markdown instructions. Claude auto-loads relevant skills when their description matches the task.
06
CLAUDE // TROUBLESHOOTING
Kill rogue worktrees
git worktree listShow every worktree attached to this repo
git worktree remove .claude/worktrees/<name> --forceRemove one worktree, discarding any uncommitted work in it
git worktree pruneClean up stale worktree references
rm -rf .claude/worktreesNuke the worktrees folder entirely after pruning
Stop the worktree habit
// Use the CLI, never the desktop appDesktop creates a worktree per session by design — no toggle.
// Launch only from project rootIf pwd starts with .claude/worktrees/ — exit, cd to project root, restart claude.
Reset Claude state
ls ~/.claude/projectsSee every project Claude Code thinks exists (each cwd is a separate project)
rm -rf ~/.claude/projects/<stale-path>Delete fragmented project metadata for old worktree paths
After cleanup, run git status from the project root. Expected: "On branch main, nothing to commit, working tree clean."
07
GIT // DAILY DRIVING
See what's going on
git statusWhat's changed, what's staged, what branch you're on. Run before every commit.
git diffShow line-by-line unstaged changes
git diff --stagedShow line-by-line staged changes (what will be committed)
git log --oneline -20Last 20 commits, one line each
git log --graph --oneline --allVisual graph of all commits and refs
Save and ship
git add -AStage every change (new, modified, deleted)
git add path/to/fileStage only one file
git commit -m "clear message"Commit staged changes with a message
git pushUpload commits to GitHub
git push origin mainSame, but explicit about remote and branch
Sync
git pullDownload and merge latest from GitHub (rare on solo main-only work)
git fetchCheck the remote without merging anything
git remote -vWhich GitHub repo does this folder point at
08
GIT // RESCUE OPS
Undo recent work
git reset --soft HEAD~1Undo last commit, keep changes staged
git reset HEAD~1Undo last commit, keep changes unstaged (default mode)
git reset --hard HEAD~1Undo last commit AND throw away the changes. Use carefully.
Big red button
git reset --hard origin/mainWipe every local change and match GitHub exactly. The full reset.
git clean -fdDelete untracked files and folders (use after reset --hard to remove leftover junk)
Stash work in progress
git stashTemporarily shelve uncommitted changes
git stash popReapply the most recent stash and remove it from the stack
git stash listShow all stashed sets
The safety net
git reflogLog of EVERY action git took locally. Even "lost" commits live here for ~90 days.
git reset --hard <hash>Restore to any commit hash from reflog
git checkout <hash> -- path/to/fileRestore one file from a past commit without touching the rest
Tag milestones
git tag stable-2026-05-18-content-crawlBookmark current state with a label
git push --tagsUpload tags to GitHub so they're remote-backed too
09
GH // GITHUB CLI
Setup
brew install ghInstall GitHub CLI on macOS via Homebrew
gh auth loginFirst-time setup — browser-based OAuth
gh auth statusShow which GitHub account you're signed in as
Repos
gh repo view --webOpen the current repo in your browser
gh repo clone brand-mind-ai/claude-codeClone a repo by shorthand
gh repo listList your repos
Issues
gh issue listList open issues in current repo
gh issue createCreate a new issue (interactive)
gh issue view 42 --webOpen issue #42 in browser
Pull requests (if ever needed)
gh pr listList open pull requests
gh pr view --webOpen the current branch's PR in browser
gh pr checksCI status for the current branch
Actions / deploys
gh run listRecent GitHub Actions runs
gh run watchLive-tail an in-progress Actions run
gh release create v1.0Create a release from a tag
10
NPM // NODE & ASTRO
Versions
node --versionCheck installed Node version (Astro needs 18.20.8+)
npm --versionCheck npm version
Dependencies
npm installInstall everything in package.json (run once after clone)
npm install <pkg>Add a production dependency
npm install -D <pkg>Add a dev-only dependency
npm uninstall <pkg>Remove a dependency
npm outdatedShow which deps have newer versions available
npm auditSecurity report for installed packages
npm audit fixAuto-fix vulnerabilities where safe
Astro project scripts
npm run devStart local dev server (default http://localhost:4321)
npm run buildBuild production bundle to dist/
npm run previewPreview the built bundle locally before deploy
npm run typecheckRun TypeScript type checking (must pass with 0 errors)
npm run lintRun the linter on source files
One-off tools
npx <pkg>Run any npm package once without installing it permanently
npx astro checkAstro's full check (types + content schema)
11
WRANGLER // CLOUDFLARE
Setup
npm install -g wranglerInstall Cloudflare CLI globally
wrangler --versionCheck installed version
wrangler loginOAuth flow to connect your Cloudflare account
wrangler whoamiConfirm which account you're connected to
Pages projects
wrangler pages project listList your Cloudflare Pages projects
wrangler pages project createCreate a new Pages project (interactive)
wrangler pages deploy dist --project-name=zaciszeManual deploy of the built site to a project
wrangler pages dev distLocal preview that matches Cloudflare's edge environment
wrangler pages download configPull project config (build settings, env vars) to local file
Logs & diagnostics
wrangler pages deployment list --project-name=zaciszeList recent deployments for a project
wrangler tail <project>Live-tail logs from a Pages project
Normal flow on this project: push to GitHub main → Cloudflare Pages auto-deploys. Wrangler is for manual previews, emergency redeploys, and reading logs when something breaks at the edge.