The complete developer-guide FAQ for Claude Code (Anthropic's official CLI for Claude). Install, CLAUDE.md, slash-commands, MCP servers, hooks, sub-agents, pricing, privacy, and how it compares to Cursor / Copilot / Aider.
What is Claude Code?
Claude Code is Anthropic’s official command-line interface for Claude. It’s a Node.js CLI you install with npm i -g @anthropic-ai/claude-code and run from your terminal inside any repo. Unlike the chat-window claude.ai, Claude Code reads your real source tree, edits files in place, runs your tests, executes shell commands you authorise, and ships PRs end-to-end. It’s designed to be an AI pair-programmer — you steer, Claude does the keystrokes. Built and maintained by Anthropic, the same company that makes Claude itself.
Was this helpful?
How is Claude Code different from Cursor, GitHub Copilot, or Aider?
Three key differences:
Vs. Copilot: Copilot is autocomplete-in-IDE. Claude Code is a CLI agent that plans, edits multiple files, runs tests, and commits PRs — not just inline suggestions.
Vs. Cursor: Cursor is an IDE (VS Code fork) with chat. Claude Code is editor-agnostic — works in your existing VS Code, JetBrains, Vim, or terminal. Same agent, no IDE lock-in.
Vs. Aider: Aider is similar in shape (CLI pair-programmer) but provider-neutral. Claude Code is Anthropic-native, so you get first-party access to Claude features (extended thinking, prompt caching, computer use, MCP) without a translation layer. Sub-agents and hooks are also first-party.
For Magento & Hyvä work specifically, Claude Code wins on: real codebase reads, MCP-database access, hook-gated safety, and the slash-command library.
Was this helpful?
What Claude models does Claude Code use?
By default, the latest production-tier Anthropic model — currently Claude Opus 4.7 for heavy coding tasks and Claude Sonnet 4.6 for fast routine work (May 2026). You can pin specific models with --model or set defaults in your .claude/config.json. Extended thinking mode kicks in automatically for complex tasks (architectural decisions, debugging). You can also route Claude Code via AWS Bedrock or GCP Vertex AI if your org requires cloud-vendor billing — the CLI picks up ANTHROPIC_BEDROCK_BASE_URL / ANTHROPIC_VERTEX_PROJECT_ID env vars.
Was this helpful?
How do I install Claude Code?
Three steps, ~60 seconds total:
Install the CLI:npm i -g @anthropic-ai/claude-code (requires Node.js 18+).
Authenticate: Run claude login — opens browser, signs in with your Anthropic account (Pro / Team / API). Or set ANTHROPIC_API_KEY env var if you’re using API direct.
Run it:cd into any repo, type claude, ask your first question. That’s it.
What is a CLAUDE.md file and why does every project need one?
CLAUDE.md is a Markdown file at your repo root that holds your project rules — coding standards, “never edit vendor”, “always write MFTF tests”, deploy flow, naming conventions, links to internal docs. Claude Code re-reads it at the start of every session, so your team’s rules become muscle memory for the AI. Write once, AI follows forever.
A good Magento CLAUDE.md includes: tech stack (Magento 2.4.x + Hyvä), “no vendor edits”, “plugin-over-rewrite”, “db_schema not raw SQL”, “MFTF tests required”, deploy commands, and a list of internal modules with their purpose. Sub-folders can have their own CLAUDE.md files that compose with the root one — useful for monorepos.
Was this helpful?
Are slash-commands like Cursor’s @-mentions?
Different shape, similar goal. Cursor @-mentions reference files / docs / web pages inline in chat. Claude Code slash-commands are reusable prompt templates stored as Markdown files in .claude/commands/. When you type /scaffold-module, Claude Code injects the contents of .claude/commands/scaffold-module.md as your prompt — with optional argument substitution.
Slash-commands are repeatable workflows — you write the prompt once (“scaffold a Magento module with these conventions, db_schema, registration, MFTF test stub”), then any team member runs it with one keystroke. Claude Code also supports arguments ($ARGUMENTS placeholder) and file references (@path/to/file) inside command files, so you get the best of both worlds.
Was this helpful?
What are MCP servers and why should I use them?
The Model Context Protocol (MCP) is an open standard (open-sourced by Anthropic) for connecting AI assistants to external tools and data sources. An MCP server exposes a specific resource — GitHub, Linear, Sentry, your Postgres database, your Magento DB, your design system — through a standardised interface that Claude Code can call.
You wire MCP servers in .claude/mcp.json. Once wired, Claude Code can read your GitHub issues, query your Magento DB, fetch Sentry stack traces, file Linear tickets — all without you copy-pasting context into chat. Crucially, your API keys live in MCP server config, not in your prompts — so they don’t leak into your conversation logs. Anthropic + the community ship 100+ official MCP servers; building your own is a 50-line Node script.
Was this helpful?
What are hooks in Claude Code?
Hooks are shell scripts that run before or afterClaude Code performs an action — editing a file, running a Bash command, finishing a tool call. They’re your safety net.
PreToolUse hooks can block dangerous actions: refuse to rm -rf /, refuse to push to main branch, refuse to write into vendor/, refuse to edit prod credentials. Hook returns non-zero exit, action is cancelled, you stay safe.
PostToolUse hooks auto-run lint / format / tests after every file edit. phpcs + phpstan + composer validate on every Magento file change — built into the CLI, not bolted on.
Stop hooks run when Claude finishes a session — great for auto-committing or running test suite.
Configure hooks in .claude/settings.json. They’re the difference between “cool AI demo” and “production-grade workflow.”
Was this helpful?
What are sub-agents and when should I spawn them?
Sub-agents are parallel Claude Code instances spawned by your main session, each with its own context window, working independently on a task you delegate. Useful when:
Parallel work: spawn three sub-agents to audit, build, and test in parallel — they each get a fresh context window, so a 30-min audit doesn’t blow your main session’s context.
Long-running tasks: a sub-agent can grind on “port these 80 Luma blocks to Hyvä” for an hour while you keep planning in your main session.
Specialised personas: a sub-agent with a stricter CLAUDE.md (e.g. “you are a security auditor; only output findings, never edit”) gives you focused output without polluting your main agent’s instructions.
Spawn with the Task tool. They report back to the main session when done — you get the summary, not the keystroke-by-keystroke noise.
Was this helpful?
How much does Claude Code cost — Claude Pro vs Team vs API?
Three billing options:
Claude Pro ($20/mo): unlimited Claude Code usage with model auto-routing. Best for solo devs — effectively flat-rate AI pair-programming.
Claude Team ($25/seat/mo, 5+ seats): Pro features + admin controls + shared workspace + SSO. Best for engineering teams.
Anthropic API (pay-per-token): $3/M input + $15/M output for Sonnet, $15/M + $75/M for Opus. With prompt caching enabled, repeated reads of vendor/ drop ~90% of input cost. Best for pipelined / CI / sub-agent-heavy workflows.
For most Magento dev work, Claude Pro flat rate is the right answer — you don’t want to think about per-token cost while shipping. For agentic / parallel sub-agent workflows, API with prompt caching is more economical.
Was this helpful?
Privacy — does Anthropic train models on my code?
No — not on commercial-tier inputs. Under Anthropic’s Commercial Terms of Service, customer inputs and outputs (Claude Pro, Claude Team, Anthropic API) are not used for model training. That’s contractual, not just a setting.
For zero-data-retention setups (regulated industries, NDA-heavy work), Anthropic supports a zero-data-retention mode on the API and Bedrock / Vertex routes — inputs aren’t logged at all past the live request. Free-tier claude.ai consumer use can opt-in to training (the consumer privacy notice differs), but Claude Code does not run on free-tier accounts. Net effect: your codebase stays in your VCS — nothing leaves except the API call you made.
Was this helpful?
What are the best Claude Code workflows for ecommerce dev?
Six workflows that compound massively in ecommerce dev:
Setup-patch generation: a /setup-patch slash-command that scaffolds idempotent DataPatchInterface patches with dependency wiring — for seeding configs, products, categories, FAQs.
db_schema → migration: describe the column you want, Claude Code writes db_schema.xml + db_schema_whitelist.json + a setup-patch for backfill.
Hyvä port: a /hyva-port-block command that takes a Luma block and spits out the Hyvä equivalent with Tailwind classes + Alpine.js.
MFTF + PHPUnit: features ship with tests in the same PR — non-negotiable in CLAUDE.md.
Sub-agent audit: nightly sub-agent that audits your repo against Magento Coding Standard + EQP, files Linear tickets via MCP.
SEO page builder: a slash-command that scaffolds a new Tier-1 pillar page (block + layout + template + LESS + 3 setup-patches) following your established pattern. (We use this exact one to ship our SEO landing pages.)