Introduction to Claude Code: Anthropic's Agentic Coding Tool
Claude Code is fundamentally different from the chat-based AI assistants we've grown accustomed to. While tools like Copilot or ChatGPT provide code completions or snippets in a sidebar, Claude Code is agentic. It lives in your terminal and IDE, reads your actual files, runs terminal commands on your behalf, and understands your entire codebase in context.
Think of it as a senior developer pair-programming with you, 24/7, who can handle an 18,000-line React component without breaking a sweat. This guide serves as a comprehensive reference for mastering Claude Code in your daily workflow.
1. Slash Commands
Built-in commands available in any session. Type / to see the full list.
| Command | Description |
|---|---|
/help | Show all available commands |
/clear | Wipe conversation history (Essential for context management) |
/compact | Summarize history to free context window |
/cost | Show token usage and session cost |
/checkpoint | Save current state to rewind to later |
/rewind | Roll back to a previous checkpoint |
/memory | Open and edit CLAUDE.md memory files |
/commit | AI-assisted git commit |
/review | Review code or a PR |
/config | Open interactive settings |
/agents | Browse and create subagents interactively |
/fast | Toggle fast response mode |
2. Directory Structure
Global (~/.claude/)
Applies to all projects on your machine.
settings.json: Personal defaults across all projectsCLAUDE.md: Personal memory loaded in every sessionagents/: Global custom subagentsskills/: Global custom skills (slash commands)
Workspace (.claude/)
Applies to the current project only (Committed to Git).
settings.json: Team settingsCLAUDE.md: Project context and conventionsrules/: Context-aware rules (e.g.,rules/typescript/RULES.md).mcp.json: MCP server definitions
3. CLAUDE.md — Memory Files
Claude automatically loads these files as context at the start of every session. They are your briefing documents.
Example: ~/.claude/CLAUDE.md (Personal Preferences)
# My Claude Preferences
## Style
- Be concise. Skip preamble and filler phrases.
- When suggesting code, show only the diff or changed block.
## Git conventions
- Commit messages: conventional commits (feat:, fix:, chore:)
Example: .claude/rules/typescript/RULES.md
# TypeScript Rules
- Prefer \`interface\` over \`type\` for object shapes
- Never use \`any\` — use \`unknown\` or proper generics
- Always type function return values explicitly
4. Custom Skills (Slash Commands)
Skills let you define your own /commands using Markdown files with YAML frontmatter.
Location: .claude/skills/<skill-name>/SKILL.md
Example: Scaffold New Endpoint
---
name: new-endpoint
description: Scaffold a new REST API endpoint
argument-hint: "[METHOD] [/path]"
allowed-tools: Read, Write, Edit, Bash
---
Scaffold a new $1 endpoint at $2.
1. Read src/routes/ to understand the pattern.
2. Create the route handler in src/routes/$2.ts.
3. Add the route to src/routes/index.ts.
5. Custom Subagents
Subagents are specialized AI workers that Claude can delegate tasks to. Claude picks the right agent automatically based on its description.
Example: Code Reviewer Agent
---
name: code-reviewer
description: Expert code reviewer for quality, security, and conventions.
tools: Read, Grep, Glob, Bash
model: sonnet
---
You are a senior engineer performing a thorough code review.
1. Run \`git diff HEAD\` to see recent changes.
2. Read modified files and check CLAUDE.md for conventions.
3. Output a structured report with Must Fix, Should Fix, and Suggestions.
6. Settings & Hooks
Control Claude's behavior and automate tasks using settings.json.
Auto-lint after every edit (Hook)
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{ "type": "command", "command": "npm run lint --fix" }
]
}
]
}
}
7. Pro Tips for Power Users
- Use
@filename: Reference specific files inline in your prompt for precise context. - Direct Shell Access: Use the
!prefix (e.g.,!npm run test) to run terminal commands without conversational processing. - The
/automode: Toggle auto-edit mode to let Claude iterate on features faster without constant permission prompts.
Claude Code represents a shift from coding assistants to coding partners. By investing a little time up front in your CLAUDE.md and mastering these advanced features, you'll find it becomes an indispensable part of your daily workflow.