Mastering Claude Code: Pro Tips from a Developer’s Experience
Hey there! I’m Greg, a developer who, over the past few months, has made Claude Code my go-to tool for writing code. In this post, I’ll share some valuable pro tips to help you get the most out of Claude Code, inspired primarily by a fantastic post from Boris Churnney, the creator of Claude Code at Anthropic.
Whether you’re new to Claude Code or looking to deepen your expertise, these insights will speed up your workflow, improve your code quality, and help you manage your projects more efficiently.
1. CLI Basics & Command Line Arguments
Claude Code operates as a powerful command-line interface (CLI) tool. If you’re familiar with bash-based CLIs, you’ll feel right at home.
- Pass command line arguments to run on startup.
- Use
-pto run Claude Code in headless mode. - Chain Claude Code with other CLI tools or pipe data into it.
- Run multiple instances simultaneously — Claude Code can even launch sub-agents for complex tasks.
This flexibility makes Claude Code a versatile tool that fits neatly into your existing development workflows.
2. Using Images & Screenshots Effectively
Images are a surprisingly powerful part of your interaction with Claude Code:
- Drag and drop images directly into the terminal on macOS.
- Use
Shift + Command + Control + 4to take a screenshot and paste it into Claude Code withControl + V(note: it’s Control, not Command). - Use images for mockups—design your UI, paste the mockup, then ask Claude Code to build the interface.
- Use screenshots as a feedback loop: generate code, screenshot the output, then feed it back to Claude for iterative improvement.
For automation, try integrating Puppeteer to programmatically take screenshots of your app and save them locally—a huge time saver.
3. Automating with Puppeteer & MCP Servers
Claude Code can act as both an MCP (Multi-Computer Protocol) server and client, enabling seamless integration with various tools and APIs.
- Use Puppeteer MCP server locally to automate browsing and screenshots.
- Connect Claude Code to databases like Postgres via MCP servers.
- Use MCP servers that wrap APIs for real-time data fetching.
- Some dev tools (e.g., Cloudflare) provide MCP servers with up-to-date documentation, which Claude Code can leverage to build against the latest docs.
This architecture opens up powerful ways to keep your code in sync with external data and live documentation.
4. Fetching URLs & Leveraging Documentation
Claude Code can fetch and parse URLs, which unlocks real-world knowledge for your coding projects.
For example, Greg built a game for his daughter by feeding Claude Code the rules from unorules.com instead of relying on generic training data. This ensures accuracy and relevance in the generated logic.
5. claude.md: Your Project’s Instruction Manual
One of the most important tools to customize your Claude Code experience is the claude.md file.
- It’s a prompt loaded with every request, containing project-specific instructions like bash commands, style guides, linting rules, test commands, and repo etiquette.
- Initialize it automatically with
/initin Claude Code, which scans your project and creates a baseline. - Add instructions on the fly using the hash sign (
#). - Use global
claude.mdfiles in your home directory for cross-project defaults, and subdirectory-specificclaude.mdfiles for finer control. - Regularly refactor your
claude.mdto keep it concise and relevant—avoid redundant or irrelevant information. - Use Anthropic’s prompt optimizer tool to improve your
claude.mdfiles’ effectiveness.
This file acts like a "living guidebook" for Claude Code, tailoring its behavior to your exact needs.
6. Slash Commands for Reusable Prompt Templates
Slash commands are prompt templates stored in the cloud/commands folder. They let you:
- Create reusable commands for common tasks like refactoring, linting, or reviewing pull requests.
- Pass command line arguments that get interpolated into the prompt template, making these commands dynamic and context-aware.
This feature saves time and standardizes workflows across your projects.
7. UI Tips: Navigating Claude Code Smoothly
- Use
Tabto autocomplete files and directories—Claude Code performs better with specific file context. - Don’t hesitate to hit
Escapeto interrupt Claude when it goes off track. - Use the undo function to revert the last action and guide Claude back on course.
Interrupting Claude early saves time and frustration, keeping your sessions productive.
8. Version Control: Your Safety Net
One common failure mode is Claude Code becoming too ambitious and making breaking changes.
To avoid this:
- Use version control religiously.
- Ask Claude Code to commit after every major change, and let it write your commit messages—they’re often impressively clear and descriptive.
- Revert often and don’t hesitate to clear conversation history to start fresh with more precise instructions.
- Install the GitHub CLI for seamless integration, or use the GitHub MCP server as an alternative.
- Let Claude Code help with PR creation and code reviews.
Version control keeps your projects stable and your workflow safe.
9. Managing Context & Conversation History
Claude Code manages context with an auto-compacting feature that trims conversation history to stay within token limits.
Tips for managing this:
- Keep an eye on the auto-compact indicator.
- Compact at natural breakpoints, such as after commits or task completions.
- Consider clearing history entirely to work with a fresh context.
- Use scratchpads or GitHub issues as external memory tools to supplement Claude’s context.
- Monitor token usage carefully if paying per token.
Using these strategies will help maintain Claude Code’s responsiveness and accuracy.
10. Managing Costs Efficiently
Claude Code can be expensive, so cost management is crucial.
- Upgrade to Claude Max plans ($100 or $200 tiers) to get bundled token usage and better value.
- Use Cloud Code’s open telemetry support to track usage and costs across teams.
- Integrate with tools like Data Dog to build dashboards monitoring token consumption.
- For detailed cost management, check out Martin AMP’s blog post linked below.
In Greg’s experience, moving to a $100 Claude Max plan made the cost manageable and worthwhile.
Final Thoughts
Claude Code is a powerful and flexible coding assistant when used effectively. From CLI tricks to advanced MCP server integrations, image-based workflows, and cost management, the tips above should help you harness the full potential of Claude Code.
If you want to dive deeper, make sure to read Boris Churnney’s original post and explore the additional resources linked below.
Happy coding!
Useful Links
- Boris Churnney’s Claude Code Pro Tips [Link]
- Anthropic Prompt Optimizer Tool [Link]
- Martin AMP’s Cost Management Blog Post [Link]
Feel free to leave your questions or share your own Claude Code tips in the comments!