DEV Community

meotism
meotism

Posted on

Claude code best Practices

Fundamental

  • Essential commands: Bash mode (cmd)
    • Make documentation
    • create todo list
    • shift+tab or /model: change model
    • Check memory: /memory
    • space key or esc: press one to interrupt, press twice to go back previous prompt in your session
  • Debugging:
    • Screenshot
    • Write test for flow or feature
    • Using TDD by Claude
  • Make Claude.md:
    • Project Overview: Appname, platform, tech stack, architecture, …
    • Getting current Date:(notes for tech stack,…)
    • Todo list
    • Development Environment
    • Common build issues & Solutions
    • Testing & debugging
    • Common mistake to avoid
    • Feature Development workflow
    • Documentation Structure
  • Message queue: mean you prompt and agent processing and you typing new prompt, they push in queue and process later but can affect previous prompt.
  • Long prompt: should push it to prompt.md stage markdown file

Intermediate

  • Using GitHub workflows:
    • Planning and thinking features
    • Use Planning mode: choose model by cmd: /mode
    • Thinking modes: “think” < “think hard” < think harder < ultra think
    • Using research: Read link docs and research how to build api … or read pdf to implement…
    • Create PRDs: features, user experience guides API, documentation and technical design docs.
  • Automatic change tracking: /changelog day
  • Github action Integration:
    • /install-github-app: you can action using by comment at push request
  • Think like product manager:
    • Clear, relevant context and constraints base on md file
    • Review code and understand everything has implemented and working to verify output at higher levels of abstraction

Master

  • Using multiple agent: Use parallel subagent to brainstorm …(and choose once)
  • Collaborate git work tree: git worktree add {address location} and prompt to created features
    • When done, ask agent to merge each of work trees in one folder and fix conflict if exist
  • Custom slash commands: 2 custom cmd
    • /changelog
    • /create-command
  • Subagents: cmd /agents to create sub agent delegate task handle
  • MCP server: database MCP - ex: mongoldb-mcp, postgres mcp, supabase
    • Interactive with browser:click on UI
    • Figma MCP

Read more on: https://code.claude.com/docs/en/cli-reference
That's it! Happy reading and happy coding!

Top comments (0)