I used Claude Code to write a piano web app

(jcurcioconsulting.com)

21 points | by Jeremy1026 14 hours ago ago

14 comments

  • hexad74 12 hours ago

    This might not exactly be the place for it but what I struggle with regarding Claude Code is that it doesn't seem to listen to me. I will give it a specific example of code to use as a guide and it just wants to start searching the code base for similar patterns instead of just using the example that has everything it should need. I know claude.md can help but I am not having much luck with a large .NET project using internal nuget packages. I am able to get results decently well but this is a repeated problem I have and if I am not careful, it will blow through my limits.

    • eterm 11 hours ago

      This is a bit off-topic, this repo isn't even .NET.

      I work with a very large ( 280+ project ) .NET semi-monolithic semi-services code base with internal nuget packages.

      I've only a handful of times hit the limits on a team plan and even then only minutes before the window refreshes.

      I'll chime in with some of my workflow and tips when I have a more appropriate place to do so as it feels disrespectfully off-topic to elaborate further here about too much .NET specific.

      As a general tip for working with large code-bases, if you have:

        /docs
        /src
        /src/projectA
        /src/sub-projectB
        /src/sub-projectC
        /src/sub-sub-depdencyD
        /tests/
      
      etc.

      Then don't just run claude at the root directory (/).

      Run it in ./src/projectA and then use /add-dir to bring in only the depenedencies you care about for the problem you're working on.

      Or even run it in /docs and then bring in just the places where it needs.

      It will prompt to ask to read from / semi-often, but you can just deny it, either explicitly through claude.settings.local, or just through a prompt for that action.

      By carefully controlling the scope, you limit what it tries to read. If you catch it trying to read from /sub-project-B and you think it's irrelevant, you can not just deny it, but ask it why it thought it wanted to read from it, and then update your documentation (or your priors) appropriately.

      I've found the worst time for just blowing through credits / usage is when I hit a problem that's just not solvable, but more on that another time.

      • hexad74 9 hours ago

        Thank you for the tips, I only mentioned the .NET portion just because it seems to struggle with wanting to find definitions for calls against code provided by nuget packages. We are currently running a large Blazor project that has a Service class for each route in the project. When specify a specific service as an example, it seems to just get really hung up on trying to search for specific unnecessary details rather than using the complete example it has. Specifying in the prompt to only use the given example doesn't seem to matter. It keeps attempting to fire of bash commands.

        Anyways, I do appreciate the tips. I am going to attempt to not use Sonnet 4.5 for planning and see if opus does a better job of limiting scope.

    • domlebo70 11 hours ago

      Do you use plan mode? Do you link specific files as reference using @? Those two alone make a big difference for me.

      • hexad74 9 hours ago

        Yeah that is the thing that has me confused. I specify the exact files with the @ sign and it still gets caught up on wanting to run batch commands to search for specific patterns. Do you use Sonnet or Opus?

  • jonahrd 12 hours ago

    I found an interesting bug: https://webpiano.jcurcioconsulting.com/play/fvT2WvzCT1SybhNp...

    If I'm playing a quick pattern like this and holding down some bass note, depending on where the pattern starts, the middle two notes will become "synchronized" and play/get recorded at the same time. In my example, the top 4 notes work fine, but shifting down by one note causes the bug. I also switched between holding the bass not and not for demonstration. I assure you my fingers aren't doing anything different, I messed around with this for a while.

    edit: got a better recording: https://webpiano.jcurcioconsulting.com/play/b4qautCGQpQjA6wq...

    2nd edit: I thought this had to do with the "groupings" of keys but even the middle 4 that are grouped together show this behavior: https://webpiano.jcurcioconsulting.com/play/5XuIskeJNQQaiC7h...

    • Jeremy1026 11 hours ago

      Aw man, I didn't plan on digging into the database to look at note timings, but this is interesting enough to maybe take a look at.

  • SamInTheShell 6 hours ago

    Kinda scratching my head as to why this has a backend... uses ruby... needs a database. It's cool though.

  • swatcoder 12 hours ago

    > This alone gave me 90% of the finished product

    The Claude the industry needs is one that responds to that prompt with questions about scope and intent, and challenges its only-suitable-for-tutorials design ideas rather than obediently delivering a "90% finished product".

    10 years ago, this basically marks the difference between hiring some dude on Fiverr for $400 and an actual engineer or agency who might help you figure out what the heck you're trying to do and point you in some sane direction towards it.

    I appreciate this article for sharing what kind of experience people can expect from Claude right now, but it mostly demonstrates that code assistants remain most useful in the hands of experts who are careful what to ask for, and largely misleading and slop-amplifying for people who don't.

    • Jeremy1026 12 hours ago

      It'd be an interesting follow up to have one of my kids give me prompts to make the same application and see how well it does. As in, when it doesn't save and they say "it's not working." How would it react and try to problem solve.

    • rfw300 12 hours ago

      Claude Code's Plan Mode increasingly does a (small-scale) version of this - it will research your codebase and come back to you with a set of clarifying questions and design decisions before presenting its implementation plan.

    • benburleson 12 hours ago

      I've found the most useful prompt tip is to add to the end of every prompt:

      "Ask questions for clarification as needed."

      Claude will then present a list of questions I answer, either directly, or sometimes those prompt more thought or questions from myself.

      Either way, that statement helps escape the assumption that I just want some slop reaching the goal in the quickest way possible.

  • eterm 12 hours ago

    Neat, I'm in a similar state of believing the tech is currently in a state that's actually useful while also understanding why the skeptics find it infuriating instead.

    ( p.s. Tell claude that when quickly pressing keys with a mouse that there is audible clipping. This doesn't seem to happen when using the keyboard. )

    • Jeremy1026 12 hours ago

      I definitely don't think I'd be willing to hand it my day job's codebase and walk away. But I feel a lot more comfortable throwing it very specific tasks and questions, then manually vetting the results. Over time I may be a little more willing to give it bigger chunks or give a more cursory code review on what it generates.

      If I come back to it to look to add polish (and fix mobile) that'll be a prompt I'll throw at it as well.