NEW: Claude Code Security — research preview →

Master Cheatsheet

Quick reference for all AI coding tools

Claude Code

CLI Flags

  • claude "task" — run a task
  • claude -p "task" — print mode: one response to stdout, then exit
  • --resume — resume a past session (-c = most recent)
  • --from-pr 42 — load PR context
  • --effort high — set reasoning effort (low to max)
  • --resume ID --fork-session — branch a session

Slash Commands

  • /plan — preview changes before execution
  • /batch — split work into parallel worktree agents
  • /loop — rerun a prompt on a recurring interval
  • /debug — enable debug logging for the session
  • /simplify — 4-agent cleanup pass (applies fixes)
  • /compact — summarize history (auto-runs near the context limit)
  • /clear — start a fresh conversation
  • /cost — show token usage & costs
  • /context — visualize context usage

Permission Modes — cycle with Shift+Tab

  • default — ask before each change
  • acceptEdits — auto-accept file edits
  • plan — show plan, no execution
  • auto — classify & decide automatically
  • bypassPermissions — unrestricted ⚠️

Anti-Patterns

  • ❌ Task without updated CLAUDE.md
  • ❌ Using /clear mid-implementation
  • ❌ Agent teams without checkpoints
  • ❌ Bypassing permissions in complex work

GitHub Copilot

Keyboard Shortcuts

  • Ctrl+Alt+I — open Chat view
  • Ctrl+Shift+I — switch to agent mode
  • Ctrl+I — inline chat in editor / terminal
  • Ctrl+Shift+Alt+L — Quick Chat
  • Tab — accept suggestion
  • Ctrl+→ — accept next word
  • Alt+] / Alt+[ — cycle suggestions
  • Esc — dismiss suggestion
  • F2 — AI-powered symbol rename

Slash Commands

  • /explain — explain selected code
  • /fix — fix code or linting error
  • /tests — generate tests
  • /doc — generate documentation
  • /new — scaffold new project / file
  • /plan — create implementation plan
  • /startDebugging — generate launch.json
  • /compact — summarize context

Context References (#)

  • #file — specific file
  • #folder — folder & its files
  • #codebase — semantic search across workspace
  • #selection — current editor selection
  • #changes — source control diff
  • #fetch — content from a URL

@-Participants

  • @github — repos, issues, PRs, code search
  • @terminal — shell commands & output
  • @vscode — settings, extensions, APIs

Cursor

Keyboard Shortcuts

  • Cmd/Ctrl+I — toggle Agent panel
  • Cmd/Ctrl+L — new chat
  • Cmd/Ctrl+K — inline edit / command bar
  • Cmd/Ctrl+Shift+L — ask about selection
  • Tab — accept Cursor Tab suggestion
  • Esc — reject / stop generation
  • Cmd/Ctrl+Shift+P — command palette
  • F12 — go to definition

@ Context Mentions

  • @filename.ts — specific file (<200 lines)
  • @src/folder/ — folder for patterns
  • @codebase — full repo index search
  • AGENTS.md — project instructions (also see Always Apply rules)
  • @web "query" — live web search
  • #Context7 — versioned library docs (MCP)

Config Files

  • .cursor/rules/*.mdc — persistent rules
  • AGENTS.md — project instructions (read by Cursor agent)
  • .cursorignore — exclude from indexing
  • .cursor/mcp.json — MCP server config

Key Workflows

  • 📌 3-file rule: edit + pattern + types
  • 📌 Start a new chat when the task changes
  • 📌 TDD + auto-run: write tests first, auto-iterate
  • 📌 Refactor incrementally — 1 step at a time
  • 📌 Commit before & after each session

Context Budget

  • Quick edit — ~2k tokens (1–2 files)
  • New feature — ~5k tokens (3-file rule)
  • Refactor — ~10k tokens
  • Architecture — ~50k tokens