After mastering the basics, here are advanced techniques that will make you significantly more productive with Claude Code.
Pipe command output directly to Claude Code for analysis:
# Analyze test failures pytest tests/ 2>&1 | claude "Analyze these test failures and suggest fixes" # Review a diff git diff main | claude "Review this diff for potential issues" # Analyze logs tail -100 /var/log/app.log | claude "What errors are in these logs?"
Use the -p flag for non-interactive mode, perfect for CI/CD and scripts:
# Generate a code review claude -p "Review the code in src/ for security vulnerabilities" > review.md # Generate documentation claude -p "Generate API documentation for all endpoints in routes/" > api-docs.md # Use in a shell script #!/bin/bash RESULT=$(claude -p "Is there a TODO in main.py? Reply yes or no") if [ "$RESULT" = "yes" ]; then echo "Found TODOs!" fi
Continue where you left off:
# Resume the most recent conversation claude --resume # Continue a specific session claude --resume session-id
Claude Code excels at coordinated changes across files:
> Add a "lastLogin" field to the User model, update the migration, update the API serializer, and add it to the admin dashboard view
Claude Code will edit all four files in a single coordinated operation.
# Let Claude manage Docker containers > Build and run the Docker container, then check if the app is healthy # Debug container issues > The Docker container keeps crashing on startup. Check the logs and fix the issue
Help Claude Code work efficiently with large codebases:
/compact — When conversations get long, compact the context to free up spaceSpeed up workflows by pre-approving safe commands:
# In .claude/settings.json
{
"permissions": {
"allow": [
"Bash(npm test)",
"Bash(npm run build)",
"Bash(git status)",
"Bash(git diff *)",
"Read",
"Glob",
"Grep"
]
}
}
Integrate Claude Code into your development pipeline:
# GitHub Actions example
name: Code Review
on: pull_request
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm install -g @anthropic-ai/claude-code
- run: |
claude -p "Review the changes in this PR for bugs, \
security issues, and code quality" > review.md
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
Create reusable prompts as custom slash commands in your project’s .claude/commands/ directory:
# .claude/commands/review-component.md Review the React component at $ARGUMENTS for: 1. Accessibility issues 2. Performance problems 3. Missing error handling 4. Proper TypeScript types
Then use it:
> /project:review-component src/components/UserProfile.tsx
| Shortcut | Action |
|---|---|
Ctrl+C |
Cancel current operation |
Ctrl+D |
Exit Claude Code |
Up Arrow |
Cycle through previous prompts |
Escape |
Cancel current input |
You’ve now completed the full Claude Code tutorial series! From installation to advanced automation, you have all the tools you need to be highly productive with Claude Code. Happy coding!
Previous: Using MCP Servers with Claude Code