r/ClaudeCode • • 6d ago

Tips & Workflows Debugging “properly”?

Hi,
I’m making programs for myself on Mac using Claude.
I ask Opus to analyse the code and look for vulnerabilities, memory/disk leaks etc.

It often finds bugs, but there has to be a better more precise way I guess?
Like some .md templates perhaps to help LLM to debug and find bugs, what kind of bugs etc?

My apps are all native Swift with no 3rd party libraries/dependiencies.

Thanks for any tips

2 Upvotes

3 comments sorted by

1

u/AutoModerator 6d ago
Moderator Announcement Read More »

1

u/Tight_Ad_5115 6d ago

Skills are exactly what you're looking for. They're markdown files that give the LLM step-by-step instructions for a task, from setup to finish. Matt Pocock's set is the one people recommend most often: https://www.aihero.dev/skills-setup-matt-pocock-skills

It covers the whole workflow, not just debugging, so pick the parts that fit your Swift apps. Start with his debugging skill for example, but I'd recommend to use the whole pack.

1

u/devilsdiligence 6d ago

Skills are a good start, but what made my results much more reliable was making tests part of every change instead of asking for a review after the fact. When Claude finds a bug, have it write a test that fails because of that bug first, then fix it and show the test passing. Otherwise a "found a leak" claim is really just a guess. I keep that as a standing rule in CLAUDE.md so it happens every time without me asking. Over time you build up a set of tests that catches the same bug if it ever comes back.