Hands-on: Claude Code
Terminal, sub-agents, transcripts, hooks, slash commands.
- Launch Claude Code and understand the difference vs. Copilot
- Use slash commands, sub-agents, hooks
- Read a transcript to understand what it did
Claude Code is different. It doesn't live in the editor — it lives in the terminal. You tell it what you want, it works autonomously: opens files, modifies them, runs tests, opens PRs. It's more like a colleague you ask to do something, not an autocomplete.
Quick setup
# Instalare globală
npm install -g @anthropic-ai/claude-code
# În folderul proiectului
cd ~/Desktop/proiect
claude
# Apoi îți cere să te autentifici cu contul Anthropic.Slash commands — shortcuts
Type / in the prompt and see a list of predefined commands. They're shortcuts for repetitive tasks.
/init— generates aCLAUDE.mdwith a project summary./review— review of the current PR./security-review— vulnerability audit.- Custom: you can create your own slash commands in
.claude/commands/.
Sub-agents — delegation
When you have a task that would pollute context (e.g. search across 200 files where a function is used), delegate it to a sub-agent. The sub-agent has separate context, works in parallel, and returns ONLY a short report.
Tu: „Lansează un agent Explore care să găsească toate locurile
unde se face validare email și să-mi dea o listă scurtă."
Claude Code:
▶ Spawning Explore agent...
▶ Agent finished. 4 locations found:
- src/auth/signup.ts:45
- src/auth/login.ts:23
- src/profile/update.ts:78
- src/admin/invite.ts:12
Tu: continui cu context-ul curat, fără 200 de fișiere citite.Hooks — automation
Hooks are shell commands that run automatically on certain events: after each Edit, before each Bash, when a session ends. Useful for: auto-format after edit, audit logs, alerts.
// .claude/settings.json
{
"hooks": {
"PostToolUse": {
"Edit": "prettier --write \"$CLAUDE_TOOL_FILE_PATH\""
}
}
}Transcript — work audit
Every Claude Code session is automatically saved as a transcript (in ~/.claude/...). You can re-read, share, or ask another agent to analyze it. Useful as a BA for: auditing what was done, reusing a successful session as a template.
What's the best use case for a sub-agent in Claude Code?