rw-book-cover

Metadata

Highlights

You can add content to your CLAUDE.md manually or press the # key to give Claude an instruction that it will automatically incorporate into the relevant CLAUDE.md. Many engineers use # frequently to document commands, files, and style guidelines while coding, then include CLAUDE.md changes in commits so team members benefit as well. (View Highlight)

c. Use custom slash commands For repeated workflows—debugging loops, log analysis, etc.—store prompt templates in Markdown files within the .claude/commands folder. These become available through the slash commands menu when you type /. You can check these commands into git to make them available for the rest of your team. Custom slash commands can include the special keyword $ARGUMENTS to pass parameters from command invocation. (View Highlight)

Putting the above content into .claude/commands/fix-github-issue.md makes it available as the /project:fix-github-issue command in Claude Code. You could then for example use /project:fix-github-issue 1234 to have Claude fix issue #1234. Similarly, you can add your own personal commands to the ~/.claude/commands folder for commands you want available in all of your sessions. (View Highlight)

a. Explore, plan, code, commit This versatile workflow suits many problems: (View Highlight)

b. Write tests, commit; code, iterate, commit This is an Anthropic-favorite workflow for changes that are easily verifiable with unit, integration, or end-to-end tests. (View Highlight)

h. Use Claude to work with Jupyter notebooks Researchers and data scientists at Anthropic use Claude Code to read and write Jupyter notebooks. Claude can interpret outputs, including images, providing a fast way to explore and interact with data. There are no required prompts or workflows, but a workflow we recommend is to have Claude Code and a .ipynb file open side-by-side in VS Code. You can also ask Claude to clean up or make aesthetic improvements to your Jupyter notebook before you show it to colleagues. Specifically telling it to make the notebook or its data visualizations “aesthetically pleasing” tends to help remind it that it’s optimizing for a human viewing experience. (View Highlight)

New highlights added 2025-07-14

Give Claude images 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. Note that this is not cmd+v like you would usually use to paste on mac and does not work remotely.) • Drag and drop images directly into the prompt input • Provide file paths for images This is particularly useful when working with design mocks as reference points for UI development, and visual charts for analysis and debugging. If you are not adding visuals to context, it can still be helpful to be clear with Claude about how important it is for the result to be visually appealing. (View Highlight)

These four tools help with course correction: • Ask Claude to make a plan before coding. Explicitly tell it not to code until you’ve confirmed its plan looks good. (View Highlight)

Use /clear to keep context focused During long sessions, Claude’s context window can fill with irrelevant conversation, file contents, and commands. This can reduce performance and sometimes distract Claude. Use the /clear command frequently between tasks to reset the context window. (View Highlight)

Use checklists and scratchpads for complex workflows For large tasks with multiple steps or requiring exhaustive solutions—like code migrations, fixing numerous lint errors, or running complex build scripts—improve performance by having Claude use a Markdown file (or even a GitHub issue!) as a checklist and working scratchpad: For example, to fix a large number of lint issues, you can do the following:

  1. Tell Claude to run the lint command and write all resulting errors (with filenames and line numbers) to a Markdown checklist
  2. Instruct Claude to address each issue one by one, fixing and verifying before checking it off and moving to the next (View Highlight)

Have one Claude write code; use another Claude to verify A simple but effective approach is to have one Claude write code while another reviews or tests it. Similar to working with multiple engineers, sometimes having separate context is beneficial:

  1. Use Claude to write code
  2. Run /clear or start a second Claude in another terminal
  3. Have the second Claude review the first Claude’s work
  4. Start another Claude (or /clear again) to read both the code and review feedback
  5. Have this Claude edit the code based on the feedback You can do something similar with tests: have one Claude write tests, then have another Claude write code to make the tests pass. You can even have your Claude instances communicate with each other by giving them separate working scratchpads and telling them which one to write to and which one to read from. This separation often yields better results than having a single Claude handle everything. (View Highlight)

b. Have multiple checkouts of your repo Rather than waiting for Claude to complete each step, something many engineers at Anthropic do is:

  1. Create 3-4 git checkouts in separate folders
  2. Open each folder in separate terminal tabs
  3. Start Claude in each folder with different tasks
  4. Cycle through to check progress and approve/deny permission requests (View Highlight)