🌐
Anthropic
anthropic.com › engineering › claude-code-best-practices
Claude Code: Best practices for agentic coding
... Claude can infer intent, but it can't read minds. Specificity leads to better alignment with expectations. Claude excels with images and diagrams through several methods: Paste screenshots (pro tip: hit cmd+ctrl+shift+4 in macOS to screenshot to clipboard and ctrl+v to paste.
🌐
Reddit
reddit.com › r/claudeai › my claude code tips for newer users
r/ClaudeAI on Reddit: My Claude Code tips for newer users
August 13, 2025 -

I recently wrote up some notes for a friend that was just getting started on Claude Code, so I decided to clean them up and post them here in case anyone takes away a few useful tidbits for themselves. There are a lot of these "Claude tips & tricks" style posts, but I enjoy reading them every time I see another one.

Fyi on me: professional software engineer for 29 years, plus another dozen or so years before that growing up coding in front of the beautiful glow of a computer screen. My AI coding has evolved starting last fall from ChatGPT copy/paste -> Github Copilot in Jetbrains -> Cursor -> Github Copilot in VS Code -> Claude Code CLI. I'm loving that most recent stop on the AI train.

Planning & Kicking off work

  • Make use of the planning mode (shift-tab twice). This is a great way to get Claude to really think things through and design out the work before it dives in. You can go back and forth with it on options (e.g. ask it for a bunch of options with pros and cons on each if you’ll be using some new tech you haven’t used before), or to make changes to design choices you don’t like, and then you work with Claude to sculpt the plan into exactly what you want before it starts. I’ve seen a much higher chance of success on the build results vs if you just gave Claude the initial prompt in regular mode where it starts coding right away. Logically, this makes sense to me. It’s the same as if you were doing that with an engineer on your team. You don’t want that engineer to run off and start coding before they’ve fully formed and vetted their plan.

  • Detailed spec to kick things off when doing bigger or delicate tasks: I find I am writing longer and longer specs the more I work with Claude, often a page or two long, with my longest being one I spent an hour writing out before feeding it to Claude. It’s rare that I will start a new task with only a few sentences.

  • Markdown format for your specs / prompts: when doing a bigger spec or something that I want to get just right, I write it in the Markdown format. It’s really nice and simple. You don’t have to overthink the format at all. #, ##, ### for organizing your thoughts into logical sections and subsections, and “-“ for lists of items. It’s pretty natural to write in Markdown, and I’ve adopted it for my own personal todo list files. I feel more confidence in prompts where I’ve organized it with Markdown because there is less ambiguity with my instructions.

  • I like to ask Claude to write its final plan (from planning mode) along with a detailed todo list into a Markdown plan document when I’m at the “I approve this plan, go ahead and implement” stage before it leaves planning mode. It’s also an opportunity to clearly state which phases/tasks from the plan you want Claude to implement until it stops. Otherwise sometimes it just does Phase 1 of the work and then waits for you to tell it to continue with Phase 2, 3, and beyond. The Markdown doc is also useful because sometimes if Claude is doing a very large build for you, it might eventually forget some of the items from the original plan that it was supposed to do, especially if you need to iterate with Claude halfway through its work in order to get one of the earlier Phases right. You can point Claude back at the Markdown doc later to remind it of the missing steps. I also typically ask Claude to update the Markdown doc as it works to update the status of which steps it completed, but I find it’s a mixed bag getting Claude to do a thorough job of updating it as it goes. But you can prompt Claude later to update the doc to reflect the state of the implemented work.

  • Mockup: a very cool thing a friend did that I'll start using was to ask Claude Code to generate a mockup of the planned UI or interface (even an interactive mockup if you want). It generates the mockup much quicker than a full build, and it gives you a chance to provide Claude feedback, make changes, and then use the mockup as part of its spec for the real build.

Configurations

  • CLAUDE.md is handy for instructions you want Claude to (nearly) always keep in mind (I say nearly, because it seems like the CLAUDE.md info slides out of context at times, unfortunately). I give it context about the overall project. I include some of the key parts of my initial spec and/or what the overall objective is with the project. I tell it the command line build and launching instructions (I’m typically having Claude write a nice clean / build / launch / deploy script for me, which I then have Claude document in the CLAUDE.md file). I tell it where the log files can be found. Over time, my CLAUDE.md gets extended with “Always do this…” or “Never do this…” comments from me as well.

  • I've found it useful to add instructions to my CLAUDE.md to help Claude keep things tidy, such as: "When Claude generates .md markdown files, it should place them in docs/ai/". Otherwise you can end up with docs sprinkled all over your project. The same goes for test scripts and other debug one-offs Claude will create.

  • .claude/commands/ is very helpful. You can write prompt-like instructions into markdown files in this directory in your project, and then it automatically creates each as a new “/“ command in your project’s Claude sessions. Example commands I use: /commit (.claude/commands/commit.md) to git add my unstaged files, draft a commit message and git commit everything. Or /bl (.claude/commands/bl.md) with instructions to do a clean build, clear the existing output log files, launch my app, and then check the results of the log file output.

  • .claude/settings.json is handy for allow-listing various commands (e.g. grep) that you want Claude to always do without asking for your approval.

  • Project vs Global commands: you can create those .claude/commands/ in your project's .claude directory, or you can create commands that will work across all of your Claude projects by putting them in your home directory's ~/.claude/commands directory.

  • /statusline: this recently added feature is quite nice. Type /statusline and Claude will help you configure what appears under your Claude Code CLI prompt box. I have mine set to show me my project name (based on the project's root working directory name), my git status along with how many files are currently modified, and the current model Claude is using, all with some nice colors and dividers. The /statusline can show you quite a bit more than that if you like. The code for the statusline ends up in ~/.claude/statusline.sh.

Prompting / Models

  • “Think” prompt keyword: Claude has some special behavior for spending more time (and tokens if you worry about that) thinking and researching and coming up with a plan or solution. "think" < "think hard" < "think harder" < "ultrathink." These are useful, I like using them. I ramp up the thinking level depending on the complexity of the task we’re planning together.

  • Opus vs Sonnet: by default Claude will start your day using Opus for everything. You can change the /model but I leave it be. If you’ve been cranking away hard on lots of parallel sessions then you’ll see Claude switch to Sonnet partway through your day for usage limit reasons. I do feel like Opus does a better job with big coding jobs, so it’s a bit of a bummer when it switches to Sonnet. But I carry on and keep working. Nothing to be done about it since I’m already on the 20x plan. Anthropic recently added this /model option: “Opus Plan Mode: Use Opus 4.1 in plan mode, Sonnet 4 otherwise” which I haven’t tried out but seems like it will be a nice balance and preserve Opus for your planning throughout the day.

  • Auto-compacting: I see a lot of fear of the auto-compact. This is when the context fills up and Claude needs to summarize the conversation and pending tasks so it can flush its context and have room to continue. It generally does a decent job, but I have seen Claude lose some sense of what it needed to do or how things worked after the auto-compact. Coding typically goes smoother if I don’t run into auto-compaction partway through a task. My approach is that after I’ve finished a major task and it’s all debugged and committed, I /clear to completely wipe the context in order to reduce the odds that my next large task will hit auto-compaction halfway through. If I’m doing lots of small tasks with Claude then I don’t worry about using /clear and instead I’m happy to keep a long running Claude session going, but I’ll trigger the /compact myself if I happen to notice I’m down to a low single-digit % remaining until auto-compaction. That said, it’s really not all that often I tripped up by auto-compaction if Claude needs to do it during a task and so I don’t stress over this too much.

Claude control

  • Esc: you can pause Claude at any time by hitting Escape. Useful if you don’t like what it’s doing or need to change anything.

  • Esc Esc: you won’t need to use this often but it’s good to know about it. I’ve used this when Claude has errored out or complained that I’ve prompted it to do something it is not allowed to do (I guess it thought I was asking for something nefarious…video game coding can have dangerous sounding trigger words). Pressing Escape twice brings up a stack of your previous prompts, and you can step back to a previous one and do a fresh prompt from that point forward.

  • Feel free to type in something for Claude while it’s in the middle of working. If you see Claude make a wrong assumption, or you want to add a task to the current work, or want to give it more debug info, you are welcome to enter it in and Claude will pick up your additional prompt shortly after and incorporate it. Very handy.

  • @: Claude is really good at finding your code files when you prompt in simple English, but I like using the @ to reference specific files in the project tree. When I want to mention a class name, I’m more likely to @ and type the class file, for two reasons: 1) it has nice tab auto-completion, 2) it makes the request very explicitly clear for Claude.

  • Ctrl-R: I don’t use this much, but it’s interesting. Hit Ctrl-R while Claude is working and you’ll see a much more verbose output of what it is doing.

  • claude -r: super useful command line option when launching Claude. This lets you rejoin an earlier Claude session. This is very handy if you rebooted or Claude crashed, or if you want to ask Claude to do a task in some earlier session where it built up very useful context on a particular topic.

Workflow

  • Git: I regularly use Claude to do my git add/commits when I’m ready to submit to my repo. It writes a nicer git commit message than I would. I don’t auto-approve Claude for doing git commands, though. I manually trigger this when I’m ready, after finishing my testing and reviewing the diffs in VS Code. Claude likes to start doing git adds and commits after every change , which is annoying because it wants to commit things I haven’t even tested yet. I’ve added instructions to my CLAUDE.md files to tell Claude not to do that, but sometimes it gets excited and wants to get back into that mode again.

  • Screenshots & logs. Drag in an image or Ctrl-V to paste an image from your clipboard. It’s always good to give Claude more actionable data to help it fix a problem. Screenshots aren’t foolproof though. There are times Claude says “the screenshot shows it has been fixed” when clearly the screenshot showed nothing of the sort. And for logs: yeah you can copy & paste output into Claude, but it’s even nicer when you let Claude know where the log files are and you tell it to check the logs itself. Let Claude add your log directories external to your project directory when it asks; this way it can check the log files itself without asking you each time.

  • Feedback loops: this is a dream setup, but it can be hard to achieve. It’s worth working with Claude on scripts and tools to do this, though. When you are trying to get Claude to fix something tricky or its having a hard time with a fix, try to get Claude set up with everything it needs to build and launch your app with the right config and command line settings and access to the output logs (or giving Claude access to an MCP tool that can take screenshots for it, like Peekaboo MCP on the Mac). And then tell Claude to do all of those things in a loop forever until it solves the problem. Claude will loop those steps, adding debug info, trying again, inspecting the output, and then repeating the cycle until it gets it. Or blows up trying. Another approach is to tell Claude to be a debug log class/helper, and direct Claude to write its debug output here and create a feedback loop with this, in order to keep Claude’s debugging a bit more partitioned from your console, logs or other outputs.

  • Cleanups: Claude can create a lot of one-off scripts and debug logging during its debugging phases, which is all perfectly fine. I've found Claude can clean all of these up quite nicely. This is another chance for a handy .claude/command where you tell Claude how you want the project tidied up prior to committing to your repo.

  • git restore: I find it important to commit my working and tested changes to git before embarking on another Claude prompt. This is good for all the normal good coding practices. But it's especially good when working with AI because I find that if I'm struggling to get good results from a new Claude prompt - and follow-up prompts are not steering Claude in the right direction - that it's often best to git restore back to the last commit and try again. Mentally, it can be tough to pull the trigger and give up on a prompt’s results because with Claude you always feel like you are one prompt away from getting the result you want. But things can get messy if you are stuck prompting Claude over and over and it’s still not delivering the result you want, and I've gotten great results from git-restoring and refining my initial prompt based on how I saw things go sideways during the last attempt. This is also a good time to /clear to wipe the bad paths from Claude’s context before you try again fresh with an improved prompt.

Handy links

  • Anthropics's Common workflows is filled with great tips: https://docs.anthropic.com/en/docs/claude-code/common-workflows

  • An easy way to check your Claude Code usage: npm install -g ccusage ( https://github.com/ryoppippi/ccusage )

Discussions

Claude Code is a Beast – Tips from 6 Months of Hardcore Use : ClaudeAI
🌐 r/ClaudeAI
Tips for developing large projects with Claude Code (wow!) : ClaudeAI
This is how you should be setting up Claude Code (discovered while researching with Claude, how meta) ... Post a comment! ... Use of this site constitutes acceptance of our User Agreement and Privacy Policy. © 2025 reddit inc. More on old.reddit.com
🌐 r/ClaudeAI
Claude Code is a Beast – Tips from a Week of Hardcore Use : ClaudeAI
Share Your Claude Code Commands! ... Post a comment! ... Use of this site constitutes acceptance of our User Agreement and Privacy Policy. © 2025 reddit inc. More on old.reddit.com
🌐 r/ClaudeAI
I am sharing my tips to use Cursor+Claude to create a REAL webapp without typing a single line of code. : ClaudeAI
Claude Code is GOOD, but man... pricey. How can I keep it low budget? ... Anthropic doesn't care about you, but not because they're evil. ... I am sharing my tips to use Cursor+Claude to create a REAL webapp without typing a single line of code.Use: Claude for software development (self.ClaudeAI) More on old.reddit.com
🌐 r/ClaudeAI
🌐
Builder.io
builder.io › blog › claude-code
How I use Claude Code (+ my best tips)
September 29, 2025 - Pro tip: use /clear often. Every time you start something new, clear the chat. You don't need all that history eating your tokens, and you definitely don't need Claude running compaction calls to summarize old conversations.
🌐
Creator Economy
creatoreconomy.so › p › 20-tips-to-master-claude-code-in-35-min-build-an-app
20 Tips to Master Claude Code in 35 Minutes (Build a Real App)
September 24, 2025 - If you just remember one tip, make it this one. The more time you spend planning, the more likely Claude will succeed. I always press shift-tab to cycle to plan mode to start. If Claude asks to start coding, just hit escape to cancel.
🌐
Sshh
blog.sshh.io › p › how-i-use-every-claude-code-feature
How I Use Every Claude Code Feature - by Shrivu Shankar
November 2, 2025 - If your CLI commands are complex and verbose, don’t write paragraphs of documentation to explain them. That’s patching a human problem. Instead, write a simple bash wrapper with a clear, intuitive API and document that. Keeping your CLAUDE.md as short as possible is a fantastic forcing function for simplifying your codebase and internal tooling.
🌐
F22 Labs
f22labs.com › blogs › 10-claude-code-productivity-tips-for-every-developer
10 Claude Code Productivity Tips For Every Developer in 2025
3 days ago - Discover 10 practical Claude Code tips to boost developer productivity in 2025, from planning workflows to testing, refactoring, and automation.
🌐
Medium
waleedk.medium.com › claude-code-top-tips-lessons-from-the-first-20-hours-246032b943b4
Claude Code Top Tips: Lessons from the First 20 Hours | by Waleed Kadous | Medium
March 7, 2025 - Ask it to do the things that would improve code quality that you previously wouldn’t have time to. Only trust it with read only commands. Use it for the whole software lifecycle.
🌐
GitHub
github.com › zed-industries › claude-code-acp
GitHub - zed-industries/claude-code-acp: Use Claude Code from any ACP client such as Zed!
4 days ago - To use Claude Code, open the Agent Panel and click "New Claude Code Thread" from the + button menu in the top-right:
Starred by 621 users
Forked by 90 users
Languages   TypeScript 98.8% | JavaScript 1.2%
Find elsewhere
🌐
GitHub
github.com › zebbern › claude-code-guide
GitHub - zebbern/claude-code-guide: Full guide on claude tips and tricks and how you can optimise your claude code the best & strive to find every command possible even hidden ones!
August 23, 2025 - ... claude "Update architecture docs to reflect new microservices." claude "Create sequence diagrams for the authentication flow." Tip: Keep durable context in CLAUDE.md at the project root.
Starred by 2.8K users
Forked by 245 users
🌐
Sid Bharath
siddharthbharath.com › home › blog › cooking with claude code: the complete guide
Cooking with Claude Code: The Complete Guide - Sid Bharath
July 8, 2025 - That’s the entire works of Shakespeare, but that doesn’t mean you shouldn’t still follow these tips to keep Claude focused. Sub-agents are an advanced way of managing context. They are specialized AI assistants with their own instructions, context windows, and tool permissions. For example, you can set up different sub-agents to review code, test code, and update documentation.
🌐
Medium
dinanjana.medium.com › mastering-the-vibe-claude-code-best-practices-that-actually-work-823371daf64c
Mastering the Vibe: Claude Code Best Practices That Actually Work | by Dinanjana Gunaratne | Medium
August 24, 2025 - The secret isn’t in the prompts — it’s in the process. Plan first, think appropriately hard, collaborate actively, and teach Claude about your specific context through .claude files.
🌐
GitHub
github.com › ykdojo › claude-code-tips
GitHub - ykdojo/claude-code-tips: 40+ tips for getting the most out of Claude Code, from basics to advanced - includes a custom status line script, cutting the system prompt in half, using Gemini CLI as Claude Code's minion, and Claude Code running itself in a container
3 weeks ago - Here are my tips for getting the most out of Claude Code, including a custom status line script, cutting the system prompt in half, using Gemini CLI as Claude Code's minion, and Claude Code running itself in a container.
Starred by 235 users
Forked by 22 users
Languages   JavaScript 51.8% | Shell 45.6% | Dockerfile 2.6%
🌐
Substack
agenticcoding.substack.com › p › 32-claude-code-tips-from-basics-to
32 Claude Code Tips: From Basics to Advanced - by YK
2 weeks ago - Here are my tips for getting the most out of Claude Code, including a custom status line script, cutting the system prompt in half, using Gemini CLI as Claude Code’s minion, and Claude Code running itself in a container.
🌐
Medium
medium.com › @joe.njenga › 15-pro-tricks-that-make-claude-code-go-x10-crazy-amateur-vs-pro-devs-e41aeeeda1ea
15 Pro Tricks That Make Claude Code Go x10 Crazy (Amateur vs Pro Devs) | by Joe Njenga | Medium
June 22, 2025 - Here’s something 99% of developers don’t know: Claude Code has a hidden reasoning mode that activates when you use specific trigger words.
🌐
Claude
claude.ai › public › artifacts › 07bcf926-dc98-4739-a2e7-eebbb3c9f999
Claude Code Pro Tips - Complete Guide
Loading · Claude Code Pro Tips - Complete Guide | Claude · Content is user-generated and unverified · Customize
🌐
Neon
neon.com › blog › our-claude-code-cheatsheet
Our Claude Code Cheatsheet - Neon
October 20, 2025 - It’s like having a room full of very opinionated engineers, each pointing out something you might have missed. For more complex setups, it’s very handy to use tools like Claude Swarm, Conductor and Sculptor, which are all very useful to ...
🌐
Pageai
pageai.pro › blog › 31-claude-code-setup-tips
33 Claude Code Setup Tips You NEED to Know
August 11, 2025 - This MCP provides current documentation and prevents Claude from outputting outdated patterns. This is a tip that the Anthropic team itself recommends. Use other models, subagents or review AIs such as CodeRabbit to double-check Claude's work.
🌐
Implicator
implicator.ai › 20-must-know-tips-for-vibe-coding-with-claude-code
20 MUST-Know Tips for Vibe Coding with Claude Code
June 28, 2025 - Master Claude Code with 20 essential tips. From planning mode to headless automation, transform your coding workflow with AI assistance.