claude code master
TrendsEcosystemTipsHotDigest

Built for Claude Code enthusiasts

Claude Code Tips

Discover 30 curated tips, tricks, and best practices

30

Total Tips

30

Showing

6

Categories

Category:
workflows

Use Task Agent for Complex Multi-File Searches

When exploring unfamiliar codebases, use the Task tool with subagent_type=Explore instead of running Glob/Grep directly. This specialized agent handles complex searches more efficiently.

// Instead of multiple Glob/Grep commands:
// Use: "Where are API errors handled?"
// Claude will use Task(Explore) automatically
by Claude Team
245
setup

Configure Custom Hooks for Your Workflow

Set up user-prompt-submit-hook to automatically lint, format, or test code before Claude commits. This ensures code quality on every change.

// In settings.json:
{
  "hooks": {
    "user-prompt-submit": "npm run lint && npm run format"
  }
}
by DevOps Mike
189
productivity

Parallel Tool Calls Save Time

When requesting multiple independent operations, Claude can execute them in parallel. Ask for multiple things at once instead of sequentially.

// Good: "Read utils.ts and config.ts in parallel"
// Bad: "Read utils.ts" then "Read config.ts"
by Speed Runner
312
workflows

Use TodoWrite for Complex Tasks

Claude uses TodoWrite to track multi-step tasks. You can see progress in real-time as tasks move from pending → in_progress → completed.

by TaskMaster
276
advanced

Enable Code Review Agent Proactively

The code-reviewer agent runs automatically after significant code changes. It catches bugs, security issues, and suggests improvements.

// Claude automatically invokes:
// Task(code-reviewer) after Write/Edit operations
by Security Sam
198
debugging

Debug with Strategic Logging

Instead of adding console.logs everywhere, ask Claude to "add strategic debug logging" - it places logs at key decision points.

by Debug Dan
234
mcp

Install MCP Servers for Extended Capabilities

Model Context Protocol servers add new tools to Claude Code. Install filesystem, database, or API MCP servers for specialized tasks.

// Install filesystem MCP:
npm install @modelcontextprotocol/server-filesystem
// Configure in claude_desktop_config.json
by MCP Maven
167
workflows

Use Glob for File Pattern Matching

Find files by pattern with Glob tool. Much faster than bash find commands and returns results sorted by modification time.

// Find all TypeScript files in src:
Glob: "src/**/*.ts"
// Find all test files:
Glob: "**/*.test.tsx"
by Pattern Pro
289
workflows

Grep with Context Lines

Use -A, -B, -C flags with Grep to show lines before/after matches. Essential for understanding code context.

// Show 3 lines before and after:
Grep: pattern="handleError" -C=3 output_mode="content"
by Context King
201
workflows

Git Commit Messages Follow Convention

Claude automatically formats commit messages with emoji attribution and co-author tags. Messages focus on "why" over "what".

# Example commit message:
Add user authentication with JWT tokens

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
by Git Guru
156
workflows

Read Files Before Editing

Always read a file before editing. Claude must see current content to make accurate changes. This prevents merge conflicts.

by Edit Eddie
342
advanced

Use Heredoc for Multi-line Strings in Bash

When running git commands with long messages, use heredoc syntax for proper formatting and quotes.

git commit -m "$(cat <<'EOF'
Your commit message here.

🤖 Generated with Claude Code
EOF
)"
by Bash Boss
178
workflows

Chain Bash Commands with && for Dependencies

Use && to chain dependent commands. If one fails, the rest won't run. Use ; only when you don't care about failures.

# Good (stops on failure):
npm install && npm run build && npm test
# Bad (runs all regardless):
npm install; npm run build; npm test
by Chain Champion
267
productivity

WebFetch for Documentation

Use WebFetch to grab latest docs from official sites. Claude can read and summarize documentation pages instantly.

// Fetch Next.js docs:
WebFetch: url="https://nextjs.org/docs" prompt="Explain App Router"
by Doc Reader
223
debugging

Debugging Agent for Root Cause Analysis

The debugger agent specializes in finding root causes. It analyzes errors, checks recent changes, and suggests fixes.

by Bug Hunter
195
workflows

Ask Questions with AskUserQuestion

When Claude needs clarification, it uses AskUserQuestion with multiple choice options. You can always select "Other" for custom input.

by Question Quinn
145
productivity

Use Specialized Tools Over Bash

Prefer Read over cat, Edit over sed, Write over echo. Specialized tools have better permissions and error handling.

// Good: Read file_path="/path/to/file"
// Bad: Bash: "cat /path/to/file"
by Tool Time
298
workflows

Plan Mode for Implementation Tasks

Use ExitPlanMode after planning implementation steps. This ensures clear roadmap before coding begins.

by Plan Pat
172
advanced

Notebook Editing for Jupyter

Claude can edit Jupyter notebooks with NotebookEdit. Modify cells by ID or index, insert new cells, or delete existing ones.

NotebookEdit: {
  notebook_path: "/path/to/notebook.ipynb",
  cell_id: "abc123",
  new_source: "print('Hello')"
}
by Notebook Ninja
134
advanced

Background Bash for Long-Running Tasks

Run long commands in background with run_in_background: true. Use BashOutput to check progress later.

// Start background process:
Bash: command="npm run build" run_in_background=true
// Check output later:
BashOutput: bash_id="shell-123"
by Background Bob
187
debugging

Quote File Paths with Spaces

Always wrap file paths containing spaces in double quotes for Bash commands. This prevents path parsing errors.

// Good:
cd "My Documents/Projects"
// Bad:
cd My Documents/Projects
by Path Master
256
workflows

Multiline Grep for Cross-Line Patterns

Enable multiline mode in Grep to search patterns that span multiple lines. Essential for finding multi-line code blocks.

Grep: {
  pattern: "interface\\{[\\s\\S]*?field",
  multiline: true
}
by Grep Genius
168
workflows

Create Pull Requests with gh CLI

Claude uses gh pr create for pull requests. It analyzes all commits (not just latest) and generates comprehensive summaries.

gh pr create --title "Feature" --body "$(cat <<'EOF'
## Summary
- Added feature X
- Fixed bug Y

🤖 Generated with Claude Code
EOF
)"
by PR Pro
209
productivity

Task Agent Types for Different Jobs

Choose the right agent: general-purpose for complex tasks, Explore for codebase navigation, coding-advisor for questions, debugger for bugs.

by Agent Alex
191
debugging

Avoid Interactive Git Commands

Never use git commands with -i flag (like git rebase -i or git add -i). Interactive commands are not supported.

by Git Guide
143
workflows

Limit Grep Output with head_limit

Use head_limit parameter to show only first N results. Works across all output modes: content, files_with_matches, count.

Grep: {
  pattern: "import",
  output_mode: "files_with_matches",
  head_limit: 10
}
by Limit Larry
174
productivity

WebSearch for Current Information

Use WebSearch to find latest news, documentation updates, or current trends. Only available in the US.

by Search Sue
228
advanced

Skills for Specialized Tasks

Use Skill tool to invoke specialized capabilities like PDF processing or Excel manipulation. Skills provide domain expertise.

// Invoke PDF skill:
Skill: command="pdf"
// Invoke Excel skill:
Skill: command="xlsx"
by Skill Master
152
setup

SlashCommand for Custom Workflows

Create custom slash commands in .claude/commands/ directory. Define frequently used workflows as reusable commands.

// .claude/commands/test.md
Run all tests with coverage and generate report
```bash
npm run test:coverage
```
by Command Carl
186
workflows

Never Skip Git Hooks

Claude never uses --no-verify or --no-gpg-sign unless explicitly requested. Git hooks ensure code quality and security.

by Hook Hero
215