Syntax Video
Cursor User Tries Claude Code
- 0:00 Intro
- 0:37 Prep / Setup
- 2:09 Task 0: Generate Claude.md
- 4:59 API Credit Cost for Task 0
- 5:54 Task 0: Create Commit and PR
- 7:45 Task 1: Remove a div
- 14:59 API Credit Cost for Task 1
- 15:30 Task 2: Layout and DB Seeds / Queries
- 16:04 Discovering VS Code Integration
- 16:28 Task 2 Continued
- 19:26 Discovering Confirm Changes in VS Code
- 19:49 Task 2 Continued
- 24:44 Claude Has Trouble Reading a File...
- 26:12 Task 2 Continued
- 27:58 $5 spent milestone
- 28:05 Task 2 Continued
- 32:24 API Credit Cost for Task 2
- 32:47 Task 3: New Feature + External API Integration
- 35:28 Claude Plan Mode for Task 3
- 38:24 Claude auto accept / auto approve mode
- 39:54 Task 3 Yolo Mode
- 41:38 Task 3 Further Prompting
- 44:03 Claude Code does not have checkpoints built in
- 44:41 Task 3 Further Prompting
- 46:14 Possible Security Issue
- 46:28 Task 3 Further Prompting
- 47:58 Claude Code compact
- 48:22 Task 3 Further Prompting
- 52:41 Task 3 Yolo while I eat lunch
- 53:41 Task 3 Further Prompting
- 54:16 Task 3 Initial Success
- 54:45 Task 3 Code Review
- 57:06 Task 3 Sync / Test
- 58:38 Getting Mad at Claude
- 58:57 Task 3 Sync / Test Continued
- 59:05 API Credit Cost for Initial Task 3
- 1:01:01 Task 3 Claude is in a Loop...
- 1:01:16 Task 3 Manual Intervention
- 1:01:29 Task 3 Continued
- 1:02:09 Task 3 Manual Intervention
- 1:02:51 Task 3 Continued
- 1:03:12 CJ is Really Frustrated
- 1:03:39 Task 3 Continued
- 1:07:26 Task 3 Final Code Review / Cleanup
- 1:07:44 API Credit Cost for the rest of Task 3
- 1:08:01 Task 3 Final Code Review / Cleanup Continued
- 1:08:51 Conclusions / Opinions / Overall Impressions
- 1:12:15 Will I Replace Cursor with Claude Code?
- 1:13:19 Thanks!
Intro
In this video, I'm going to be using Claude Code for the very first time. Now, personally, I am a user of Cursor and I've used GitHub Copilot a few times, but I have never used Claude Code. And I was gifted $50 of credits from Anthropic. So, I'm going to use those credits to test out Claude. I'll be taking it through a series of challenges of increasing difficulty. And after using Claude Code and taking it through all of these different scenarios, at the end of the video, I will tell you whether or not I will replace Cursor on my day-to-day with Claude Code. If that sounds good to you, let's dive in. My name is CJ. Welcome to Syntax.
[Music] Now, I've already installed Claude. If you want to install it, you can check out their website for the command. And I read through this article, Claude Code, best practices for agent coding. This gives some tips and tricks for working with Claude. And also I installed the GitHub CLI. So whenever Claude is working, if it needs to request issues from GitHub or do various things with a GitHub repo, it can use the GitHub CLI without needing to install an MCP server. The other thing I did was set up several MCP servers for Claude to use.
Prep / Setup
So I have the sequential thinking MCP server. I've got Context7, which will let it automatically retrieve docs. I also have the Playwright MCP so it can start up the browser and interact with a website and I also have my own tool that I wrote called Duck.Go search. So anytime it needs to use the web it will use this tool instead of the built-in web search. Now with all of that I should be ready to hit the ground running. Now I am using $50 of credits that was provided to me by Anthropic. So thank you Anthropic. And you can see here in my dashboard what my current balance is. So throughout the video we'll be able to see how many credits are being used and how much each of these tasks costs. Now, it's also important to note that if you have a pro subscription to Claude, you don't need to provide an API key or tap into credits. But because these $50 of credits were provided by Anthropic, that's what I'm going to be using in this video. So, with all of that, we should be ready to go. I've done my research. I know what Claude can do.
It's going to have its best shot at working well for the task that I throw at it. And so, let's spin up Claude in my repo here. And for these initial tasks, we're actually going to be working on the syntax website. So, this is an open source GitHub repo. It's a SvelteKit app. and we'll see what Claude Code can do. So, as you can see, I've already logged in. We're ready to go. But one thing you should do when working in a new codebase, which I read in that article, is do a slashinit. And this will actually automatically create a claude.md file. And this essentially looks through your codebase, figures out code style, and all of the relevant information that a developer or an AI developer might need when working in your codebase, and then automatically creates that Claude.md file. So, we'll do this. This will give Claude the best shot at easily understanding the codebase without making too many further requests after that Claude.md file already exists.
Task 0: Generate Claude.md
Now, it's interesting that it's actually searching for cursor rules or copilot instructions, which if you're already using those tools, you might have those in your codebase. It also is searching for markdown files. And one of the things about this website is it has the show notes for every episode. So, I'm hoping that it doesn't look at those markdown files because it has nothing to do with the code. They're all just episode show notes. Now, I will say this is definitely overkill for removing a div on the website, but I'm going to throw some harder tasks at it later. So, it'll be good to have this Claude.md file. All right, let's see what it did.
So, it's got all of the commands needed to work with the codebase. Let's see if it got the text stack right. So, the front end is spelt with Svelte 5 and TypeScript. That is correct. The back end is Node.js with SvelteKit server side rendering. Yep. We're using MySQL with Prisma. That's correct. Caching with Redis. That is correct. We're deployed to Vercel and we're using Sentry.
Great work, Claude. It's got our DB schema with shows, users, guests, transcripts, videos, and user submissions. Show notes are stored as markdown files in the shows directory. So, it got that right. I thought it might get confused and think that was like documentation or something, but yeah, those are show notes. Very good. We do have AI generated content. That is correct. We're using Deepgram. Fascinating. All right. Code style. So, Pascal case for Svelte files. Snake case for variables, functions, and props.
Yes. So, this is Scott's preferred coding style. We're using Svelte 5. Beautiful. Development workflow. Adding new features. Create components in source lib. Add routes in source routes. Use Prisma for database operations. Implement caching for database queries using the cache utilities. This is looking great. Um, this is this is awesome. I think even a human coder could would benefit from this file that describes where everything is and what we're doing. Common patterns. It's got state management. Yeah, we we're using class style for Svelte 5 stores. Database queries looks good. Yeah, this is awesome. Great work. So, do I want to create CLAUDE.md? say yes. Okay, so it created that file, but now things are a little bit awkward for me. So I'm used to using cursor and it tells me like what files it changed and I can see that in my editor. This is all command line based. So I have an urge to just see what happened. And if I do a git status, you can see that it created CLAUDE.md. Uh but let's just open this with VS Code.
And I think the best way to see changes are just to look at the git log here. And we can see that CLAUDE.md was created. Okay, so that looks good. Um, maybe I'll get used to not opening up VS Code and just kind of trust Claude. But I'm actually curious how much it costs in terms of API credits to generate that cloud code. When I was setting things up earlier, I do know that when you end a Claude session, it tells you how much usage was used during that session. Um, I don't want to end this session though.
API Credit Cost for Task 0
Let me see if it can help me. Um, how many API credits have I used in this session? Maybe it can figure out what command to run here. Okay, I'm just going to kill it because it said it couldn't figure it out. So, to generate that file, it cost 92 cents. Um, it talked to the API for about 40 seconds and used two different models. So, as you can see, if you're using Claude Code with API credits, it's not going to be cheap. Now, less than a dollar is cheap in the grand scheme of things, but using other services, we're very used to like a monthly bill. So, to see the fact that it costs a dollar just for that one session is interesting. Um, okay, but let's get back into it. And now I actually want it to just check out a branch and commit these changes and then make a PR. So let's tell it to do that.
Task 0: Create Commit and PR
So let's uh check out a branch, commit your changes and submit a PR. Now like I mentioned, I installed the GitHub CLI earlier. So once it gets to create a pull request, it should be able to use the CLI to do that automatically. All right. So it's going to check out a branch called add CLAUDE.md. Wonderful name for a branch. Do I want to proceed?
I'm going to say yes and don't ask again. So uh embrace the vibe basically. All right, we have a commit message. Add Add CLAUDE.md with development guidelines for and project architecture. This file provides Claude Code with essential information about the project structure generated with Claude Code. So this is one thing I think I saw it on Reddit or something like that. The fact that every single commit is co-authored by Claude.
Um I think we can disable that in settings. I'm going to let it because we'll give credit where credit is due. But uh and I'm not going to auto approve that cuz the next time it does it, I want to make sure that I pretend that I'm the one that did all the work, I guess. Yeah. So, it's going to push to that branch. Do I want to let it run git push commands all the time? Yeah, I guess so. Again, embrace the vibe. It knows what it's doing. Yeah. So, it's going to use the GitHub CLI like I mentioned. So, it's going to create a PR with a title and a body. Let's do it.
Awesome. Let's check it out. So, if we head to the GitHub repo, check out the pull request. So add CLAUDE.md with development guidelines. Yeah, and this is what I was talking about. Look at this. Claude's a little co-author on on this commit. Um, and all this should have done is just added the MD file. Yeah, that's great. Awesome. So, it can create files. It can do all the git commands for me. It can create PRs.
That's fantastic. Um, this is like one step removed from like the cloud agent that just does all of this in the background, but I'm here providing supervision, making sure that it doesn't mess up too bad. Um, okay. So, we've got that. Let's start working on this feature which is to remove a div because on the homepage there is this extra div. We don't have our Friday show anymore for the podcast. So I want it to remove that div. So for this I'm just going to be very vague and see what it can figure out. So I'm going to give it the issue number. So I say let's check out a new branch to work on issue 2013. Use the current branch as a base because that CLAUDE.md hasn't been merged back into main yet. So, we're going to be basing all of our features off of the branch that adds cloudmd. Here we go. Okay, so it's come up with a plan. It's going to research the issue, create a new branch, implement a solution, and right now it's trying to run the GitHub CLI to view an issue. And I'm going to allow it to do that all the time. That's a non-destructive action. It literally just lists an issue from the API. Okay,
Task 1: Remove a div
so it set everything up again. My developer senses are tingling. I want to I want to see Okay, it checked out a branch. It hasn't changed anything so far, but now it's like, should we proceed? I'll just say let's do it. Yeah. So, this is the one tricky thing about this issue. Technically, we removed the text served fresh thrice weekly. So, if you look at the site, it just says served fresh twice weekly. So, we changed the text, but we didn't remove that extra div. And so, this is the thing that Claude is going to have to figure out. It's like, okay, that text isn't there anymore, but there is a div. Will it figure out that it needs to remove that div? Okay, great. I found the issue. The schedule component currently says served fresh twice weekly, but the actual schedule shows three episodes per week. Let me check the files and update them. According to the GitHub issue, they're moving to two episodes free. Let me check what the actual current schedule should be. Uh I need to understand the new schedule.
Yeah, so now it's trying to figure out which which of those divs should it remove. U but the comments indicate they didn't actually remove the Friday episode. Okay, so let me check the current schedule more carefully. Looking at the schedule, issue title, and description. Wow. So, I think it's actually going to look at like the show notes to see the fact that we haven't published a Friday episode in a while.
Fascinating. Okay, so now it's running some terminal commands, which is pretty cool. So, it's using grep, which will search text files, and it's trying to find any show notes that have the words hasty, tasty, or supper inside of them. Go for it. I don't think it will find anything. Um, yeah. So, looking in the file name, it's going to use ls now. Yeah, go for it. Yeah, I feel bad for making it work so hard because I could literally just tell it remove the Friday div.
But let's let's see if it figures it out and let's see how much it costs to figure that out. Wow. Okay, so it's going to run node with like a one-off script. So node -e allows you to run some JavaScript from the command line and just directly get the output from Node.js. So it's created an array with dates and then it's going to see what day of the week they've happened on.
This is fascinating. I have never seen cursor create like a one-off script to do a thing because like basically all it's doing is converting these timestamps which is what we have inside of the markdown into actual dates figuring out if it's Monday, Wednesday, Thursday, Friday, etc. And then it's going to make its decision based on that. That is really cool. Um, you can tell me though if you've used Cursor before and it's done something like this, but usually Cursor like wants to create new files to run them. This is just like a one-off script. Um, yeah, go for it. and it arrived at the answer, which is just to remove that last div.
Okay, so perfect. Now I understand the current schedule shows three episodes, but they actually moved to two. Uh, but I need to remove the Friday episode. Wow. I honestly like the fact that it did so much to verify which which day of the week it should remove because I feel like a lot of AIS might just hallucinate like, oh, let's remove Monday or whatever. It did a bunch of verification to figure out, okay, Friday shows don't happen anymore. Now I need to update the CSS grid layout from three columns to two columns. Love it. Oh wow. It's updating our about page as well, which makes a lot of sense. Uh because it said before it said listen in three times a week. Now it needs to say listen in two times a week. It's getting linter errors. I'm actually very curious what linter errors show up. So I'm just going to run the linter myself. Okay.
So there's a bunch of warnings. I do not want to run prettier on all of these files. That would not be good. Um what command does it want to run? Yeah. So, it's running right with just the files that it changed. That's great. Yeah, cuz one thing that could happen is if we ran prettier on all these files, there would be like 863 changes in this PR. We don't want that. So, it's going to run prettier on just those two files.
So, yeah, let's go for it. Okay, so that looks great. One thing I want to do is see if it can use the Playwright MCP to spin up a browser, visit the website, and make sure that the homepage just lists twice per week. So right now the site is running on localhost 5173. So let me just tell it uh use Playwright to visit and confirm your changes. So it's trying to run the development server.
I'm going to let it I'm going to kill the dev server which I have running in another tab and let it do its thing. Okay, it's working. It hasn't spun up a Chrome browser just yet. Hopefully we didn't brick it. Um let's see how long it takes though. I'm also curious, is the site still running? Yeah. So, it it spun up the dev server in the background. The site's still running.
Okay. Yeah. So, when you run the dev command, it like spits a bunch of stuff out. It just wanted to make sure that the dev server was actually running. Um, which it was. I It didn't need to wait 2 minutes for that, but cool. And now it's trying to use the Playwright MCP. So, I already set this up in my settings. It's going to use Playwright to navigate a browser to there. And I'm going to let it use Playwright all at once. So, yeah, spun up the browser, went to the website. Perfect. I see the changes are working correctly. Let me take a screenshot to confirm the visual changes. Oo, okay. So, it wants to take a screenshot. Yeah, go for it. The screenshot shows the scheduled section with updated layout displaying exactly two episodes. Uh, and it does. Cool. So, this is looking good. Um, it still only updated those two files. Let's tell it to add it, commit it, push it, create a PR. I will say it it's awesome to see its progress like this. So, it's it's basically coming up with a to-do list of all of the work that it's doing and it's keeping that behind the scenes, right?
That's not a file in our codebase, which typically it would be like if you're using something like Cursor. So, it's really cool to see that it keeps track of its progress in that way. Cool. I forgot to mention it, but it did it anyway. So, it says fixes 2013. And that will automatically close that issue if this one is merged in. And I forgot to remove Claude as a co-author, but that's okay. Uh, so go for it. All right. This is its PR. Update schedule, remove, update CSS grid. Wow, this is cool. Uh, create that PR. Awesome. So, if we take a look back at GitHub, should see a new PR and just those three files changed and the updates here. So, update the meta description, update the schedule.
Awesome. Okay, so that was fun. I am very impressed that it was able to find all of the context it needed to do the right thing. Like I said earlier, a lot of AI tools will just like assume. This did everything it could to make sure that it was making the right change. Now, it also could have just asked me and be like, there's three three days.
Which one should I remove instead of making a bunch of API requests? But it still figured it out. Now, I'm very curious. How much did this feature cost us? $1.73. Now, is that a lot? Maybe. I think in the grand scheme of things, if you look if you consider like the the hourly cost of a developer and they need to remove a div, it's probably less than what you're going to pay them for for their hourly cost just to remove a div.
API Credit Cost for Task 1
And I don't know, just something to consider. But like I mentioned, if you have the Claude Pro plan, you're not technically paying for all of these API credits. Uh but we can take a look at our dashboard and just see where we're at. Yeah. So we we've used a few dollars in in this session so far. Okay, let's work on another issue. This one, I think, should be a little bit more straightforward. It's not going to have to do a bunch of research to figure out what we want, but it will be a little bit trickier in that it has to figure out layout things or like missing elements. So, right now, whenever you generate the OG image for an episode, it's missing the guests. And this is a little bit cut off, but if you add JPEG on the end, you'll you'll see what it looks like. But it's missing the hosts, uh, Scott and Wes. And they used to be on there, but they're not on there anymore. So, we need to fix that. And I'm going to see if Claude can do it. So, let's spin up another session. And I just saw a hint that says use / IDE to connect to your IDE. Let's do that. All right. So, it's connected to Visual
Task 2: Layout and DB Seeds / Queries
Discovering VS Code Integration
Studio now. And it looks like if I have files open inside of VS Code, it'll know about that. So, for instance, let's just go to the this top level hooks file. It knows what file I'm inside of. And so this would let me like open up files in VS Code and then tell it to use that as context whenever it's it's doing things. But now let's work on this issue. U now I want it to get back to the branch the branch where we added CLAUDE.md and then check out a new branch to work on this specific issue. So let's craft a prompt.
Task 2 Continued
Say go back to the branch where you claude.md. Check out a new branch to work on issue. Oh, I I did the wrong issue number. How do I stop it? Stop. Okay, I think that stopped it. I I can't see the history anymore. Uh, we'll just say uh the issue number is actually 1901. Now, it checked out a branch in 901. I'm curious. Um, it completely started over. Okay, let's just rerun the prompt with the correct issue number.
Okay, so it checked out a branch. It's from the correct base. Um, it's not working on it though. Let's just say let's work on issue 1901. Okay, it's gotten confused all of a sudden. It doesn't know that that's a GitHub issue number. How How can I stop it in the middle of what it's doing? Oh, is it's right there. Escape to interrupt. Okay, escape. Okay. Uh let's say let's work on GitHub issue number 1901. That really that's that's super interesting. That really confused it. It thought it was going to find that issue in the codebase, but yeah, now it did the right thing. It's using the GitHub CLI to grab that issue and uh it'll go from there.
Okay, good to know. Got to be clear. You got to be clear in your prompts. Yeah. So, now it's just looking at uh show notes, which is fine. Okay. There is one bit of logic it's going to need to figure out. If the hosts are not listed, then it defaults to Scott and Wes. But if the hosts are listed, then use that list. That's that's actually some logic that's in the codebase. It might be able to find that. So, basically, when I join the team, I'm a guest host on the podcast every now and then.
And it looks like it's trying to launch the site, which is cool. It's using Playright. Uh, but um, we need to start up the server first, but I got cut off. U, but yeah, now if I am one of the hosts, it'll list me and either Wes or Scott. Uh, so that way the images get generated correctly. So, it's going to need to figure that out. First of all, it needs to start the server, and it's using the wrong command. So, it needs to be pnpmdev. So, I'm going to tell it to do that. Uh, use PNPM. And yes, you're allowed to do that. Oh, but it didn't run it in the background. So, is this going to just hang there once it figures out that it's not running in the background? I'm going to I'm going to tell it. There's no use waiting. Uh, make sure to run it in the background.
Yeah, that's what we need. Yep, that loads up. And I think I'll just tell it uh well, let's see. Did that kill the command? No, it didn't kill the command. So, the server is still running. I'll just say the server is running now. I don't I'm impatient, but I think this back and forth with Claude is really how it should be used. You don't want to just wait forever for it to realize that the dev server is already started up.
Okay, found the issue. It's using host username, but should use host.github. Okay, it thinks it's figured it out. Uh, open changes in Visual Studio Code. Oh, that's cool. That's another cool integration. Okay, spelt IntelliSense keeps popping up. I don't like that, but I like this. So instead of seeing the changes in the terminal, now it's actually showing them inside of VS Code.
Discovering Confirm Changes in VS Code
Uh Svelte IntelliSense is freaking out. But that's cool. I I like that cuz I'm I'm used to using VS Code and and cursor. So it's cool to see that. So that looks like a good change. Go for it. Now it's going to test it. So I think it should spin up Playwright or at least try to navigate there. Okay. Yeah. So it's showing the guest but no faces. Um now it doesn't show anyone. So it navigated to 700, 919, and then 900.
Task 2 Continued
Let's double check this. So 700, the hosts are still not visible. 900 still not visible. Okay, I actually don't see the hosts in the OG image. Are you sure? You're right. Let me look more carefully. So this is cool. It can actually see any console messages in the browser. So yeah, go for that. Let's add some debugging. And again, it opened up the changes in VS Code. It's going to show the show, the host, and the show.
Yes. Say, yeah, go for it. So, it's going to navigate there and then I think it's going to try to read from the console to see the data. Okay, I see the issue. The show.host array is empty. So, the fallback hosts are not being used. The show data doesn't have host populated. Let me check the actual data being returned. Okay, this is probably the likely change, right? So, when it gets hosts back from the database, that could be an empty array, and that's what it needs to check for. If it's an empty array, it'll use Wess and Scott as the host. So, yeah, go for that. Okay, now I can see the host faces are showing up.
The face file component is now rendering Wes and Scott. Let me take a screenshot to confirm visually. And now look, look at it. A good little bot. It's going back and removing its console logs. That's awesome. See, I do that. Excellent. The fix is working properly. Now I can see shows both Wes Bos and Scott Tolinski's faces. Shows both hosts and guests. So it confirmed it. I want to confirm it, too. Oh, there they are.
Look at them. Sweet. Uh, what I'm curious about though is does it show my face when I'm a host? Because that is a likely scenario. So, I think I was I was on a Docker episode. Yeah, Docker for developers. Okay. I noticed another bug.
The episode itself is no longer showing Scott, who was the other host on this episode. Is this the case in um in prod too? No. Okay. Now, I'm curious. Did is that a breaking change or is do I just not have certain data locally? Let's see if we look at like the latest episode. Yeah, they're listed there. Episode with a guest, they're listed there. And then this is an episode where I was a host with Wes, but he's not listed there.
Um, what's going on here? Does it look this way in prod? Yeah, so it looks good in prod. Okay, but I am curious. If we look at this episode for the OG image, it only shows me. Where did Wes and Scott go? Um, and then how is it working in prod not right now? Are there just no hosts displayed? Okay.
Okay. I I think so we we need to fix this. So basically I'll I'll give it episode 913 as an example and see if it can figure it out. Um, I'll just say let's check episode 913 where there is a different host CJ. Make sure all the hosts are displayed. And also, let me find an episode where I'm a host and there are guests. So, yeah, episode 782.
I was a host with Scott. Also, check episode 782 where CJ is a host, but there is a guest as well. Let's try to figure this out. It's going to do some more logging. Looks like it's going to do some more logging. Now, I could just auto allow this, but I like to be in the mix. I like to see what changes it's making before it continues. That also potentially prevents it using a certain number of credits or tokens because if it's making the wrong change, I'm not going to let it. It's going to take a browser snapshot. Yeah, you can do that all you want. So, it's checking 782.
No, it got that wrong. It's saying that I wasn't showing up. The main issue is Scott isn't showing up here. And then on the other one, uh Wes wasn't showing up. I now I'm curious if we're just missing that data in some of the show notes. You know what? I may be chasing an issue that it can't fix because recently Wes went through and updated every single show notes and it might be missing that information about other hosts. I'm going to have to double check that. Okay, let's do just that. So, if we look in shows, let's look at 782. The markdown file has both Scott as the host and me.
Is it just not in the database? I'm going to let it know. The markdown show notes for episode 782 show two hosts in the front matter but only one host is showing up in the OG image. Why is this?
Can you fix it? Oh, this is the other thing. It actually saw that I had highlighted these lines inside of VS Code and then in the terminal it knew exactly the three selected lines. So that's awesome. This is weird. It's having a hard time just reading this file. [Applause] Oh, check this out. The name of the file is this this character, right? It's like the apostrophe, but it's using this one whenever it's trying to cat it. That's crazy. Why can't it figure that out? Um the file name has in it but you are using make sure to use the actual file name unmatched quote. I think this is the actual weakness. It doesn't know how to use apostrophes like this special apostrophe character. Let me copy the exact file name from the ls output. No no. Okay. Try again is the right
Claude Has Trouble Reading a File...
character. Not I I won't use double quotes there. You know, I bet there's something in their system prompt or something in Claude Code that replaces like the special apostrophe character with just like the regular one that's on your keyboard. Um, [Applause] this is fascinating. I need to search the web to see if anybody else has come across this issue, but uh I did not think that this would be Claude Code's kryptonite is an apostrophe. There is an issue that was opened on June 7th and it's has a problem with accented characters, colons, and the curved apostrophe, which is what is in this file file name. User had to rename the file for the read tool. Man, that sucks.
Okay, hopefully they fix that soon. Uh, let me just help it. Let me just help it say that um this is the contents of the file. Don't try to run commands to read it anymore. Okay, now it's back to what it was trying to do earlier, man. All right, it's doing the thing again where it started a command in the background, but I don't want it to wait for it. I'll just say, uh, Prisma Studio is running now. Okay, since you have Prisma Studio open, could you check what users currently exist in the user table? If there are any users with usernames Talinsky or Wes Bos. Okay, that's good to know. That just means it's not working on my local. But when we push to prod that will have the other users in it. Okay, I'll just say the users are not there. When this is running in production, license got are there. Would that fix the issue we're seeing locally?
Task 2 Continued
So, it's going to create just a file that creates the host. Yeah. So, I'll let it do this. But really, this is fixing, I guess, a deeper issue. Like, if someone else on the team runs this locally now, they'll have the rest of the hosts in there. So, I think this should exist. might put it in scripts. Okay, I'm gonna say go for it. Yeah, I'm gonna tell it uh yeah, make sure to seed all of the fields including avatar.
What's the other one? It probably was about to figure this out, but I'm just intervening. Avatar URL and GitHub ID. All right, that is not the correct GitHub avatar URL. I don't think usually there's like a full URL. Oh, that works. Fascinating. Okay, that's good to know.
Um, are those the right GitHub IDs? And this this is not my this is not my email. Here's what I'm going to do. I'm going to say yes. So, it'll make the changes and then I'm going to tell it um okay. Well, first of all, Claude Code is letting me know that we've spent $5 during this one session, which is fine, but I want to say uh use the GitHub API to verify the email avatar URL GitHub ID.
$5 spent milestone
Task 2 Continued
Um, no, don't do this. No, don't write the code to do it. Call the GitHub API with the GH CLI and make sure the seed data matches what you find. So, yeah, now it's going to get all of our user info and add that to the seed file.
Okay, so it's got that. That's the correct email. That's my correct Twitter. Awesome. Okay, so it created those two users. It hopefully should fix the OG images. It looks like it's actually just going to run the import. After that, I want to make sure that it puts that file in a good spot and maybe runs it as part of the preheat because uh this is just at the root. That's that's not good. Actually, I'll just tell it that I'll I'll run the import or that I ran the import uh which you need to be logged in for. But locally, I can just go to /admin. So, I can go to sync all shows. That'll go through everything. Ideally, link the hosts now that they're in the database. And now if I go to episode 782, Scott is not listed. See in Prisma Studio, are there are the users there? Oh, I think it's working, but they're cached. Okay, because the data is in the database. I need to clear the cache. So now if I go to 782, there he is. Okay, so that fixed it. Um, so it doesn't have my name. And
if we look in Prisma Studio locally, my name and Twitter are missing as well. So that looks good. Let me tell it to update the script to update fields in the database, not just create new users. But the script needs to update existing users with these fields instead of just creating. So that should fix the script.
We'll put the script in the right spot, run it as part of the preheat, and then also test doing everything from scratch. Oh, it's going to delete the temporary script. No, I think that should exist. This script should be part of the DB preheat/ seed when setting up the codebase locally. Let's see if it can figure out where to put it. All right, so it's just going to update seed to create the host users. Um, the seed database function runs a SQL file. Okay, now I'm getting to a part of a codebase that I don't know as much about. Where did it add the the host? So in seed.ts TS. I see. So the seed file um only runs sometimes.
Okay. I'm going to tell it don't put it in the seed file, just put it in the preheat. Yeah. So that way preheat runs every time. It's a JavaScript file. It's not a TypeScript file. So yeah, it's going to remove it from seed.ts. We don't need that. And then it should put it in the preheat file. Okay. Now create the host users and then also call it whenever we check for data. Yeah, go for it. Why is it changing substr to substring? No, stop it. Why would you do that? Oh, is this a deprecated function?
I see. Okay, so that took a lot, but ultimately updated two files. Um, and if we look at the changes, the main fix here was to check the length of the array because before it wasn't doing that. And then we just moved the faces data into a variable. And then we also made sure when we're running locally, we create all three of the hosts if they don't exist in the database. So that looks good. Okay. Um I'll just say are we done with issue 1901? The issue is fully resolved. Great. Commit push and create a PR. Okay. So it's creating a PR. Looks good to me. And one thing I'll do as well is test this on the on the preview deploy. So part of uh PR merges is it does a preview deploy to Vercel.
So I can test these episodes and make sure that it's working in prod as well. Okay. Okay. So, if we head to the preview, let's test all these same episodes. So, if we check out 782, that has the hosts and the guest. We check out 919, that's got just Scott and Wes. If we check out 913, yeah, Wes and me because we I co-hosted that one. And then, what was 700? I think this was Wes, Scott, and Guest.
Yes. Okay. So, that fixes it. Awesome. Let's see how much fixing this issue costs in credits. We already know it cost at least $5. Yeah. So $6.34. Again, I'll let you interpret that. I think I think I could have fixed this issue faster. So maybe it would cost less if you're considering my hour hourly rate.
API Credit Cost for Task 2
Um but I think someone less familiar with the codebase would have been able solve it a lot faster using Claude code. Okay, so we've seen it can solve basic issues. It can solve more complex issues that require really digging into the codebase and querying the database. Now I want to see if it can actually implement a new feature in the codebase.
Task 3: New Feature + External API Integration
So there are two things we have on the GitHub repo. There's an issue open and also a PR that never got merged in. And the recent issue says that the link to Spotify is incorrect. And the thing is we don't have Spotify links for any of our episodes in the show notes. So we actually just link off to searching Spotify. So, if you check out, let's say for instance, the latest episode, when you click on Spotify, it literally just searches for the episode name because we don't know the actual episode URL, and it shows up. But I think sometimes that might not work as well because maybe their search isn't exactly picking up this episode name. And so, uh, this user, MS MS, opened a pull request a while ago, so sometime last year, where they wrote a tool that went out and found every single Spotify episode URL, and we didn't merge it in because it is um, potentially changing like 900 files at this point. Um, and then, you know, we got busy, didn't get a chance to do
it, but they did publish their tool. Um, and then the main issue I had with this is the tool was actually written with uh Rust, I think. Is that what? Yeah, it was written with Rust. So, you'd need to compile it to run it. Um, we could do this eventually, but since then some things have changed. So, we used to use a service called Libsyn to actually publish our podcast as an RSS feed, but now we've switched over to Megaphone, which is from Spotify itself. And so the thing I'm curious about is does Megaphone have an API that we can tap into like after an episode has been published which will give us back the Spotify URL. Now I've done some digging on this my own and I couldn't find anything exactly so I'm actually curious if Claude will be able to figure this out. It's going to need to search the web. It's going to need to pull up API documentation. It's going to need to ask me for things like my megaphone API key.
There's going to be a lot involved. So, I'm very curious to see how Claude is going to tackle this. Okay, so we started a new Claude session. Let's get back to the commit where we added cloudmd. Check out a new branch and see if we can start working on this issue. I'm not going to tell it what the feature is just yet. I want to make sure it's in a good starting state. Okay, so we're on the branch. So, I said, take a look at GitHub issue 2023. The Spotify URLs for each episode are only linking to the search results on Spotify, not directly to the Spotify episode. We recently migrated to Spotify megaphone and it might be possible to get the Spotify URL directly from the megaphone API. Let's do some research and see if this is possible. Now, one thing that I just thought of is instead of doing this as a prompt, we should actually go into plan mode because if it can actually do this, it's going to be a fairly complex change and it's going to need to, you know, create new files to call the API, associate them with show episodes, potentially update the markdown, or just add the Spotify URL in the database.
Claude Plan Mode for Task 3
There there's a lot that could go on. And the idea with plan mode is it's read only. It's not going to change any files. It's just going to come up with a plan for how it's going to implement this. And so if I pressed shift tab tab, now we're in plan mode. And that means it's read only. So it's not going to make any changes. It's just going to make a plan. So here is my prompt. Let's give it a go. It's already off to a bad start. So I do have this DuckDuckGo MCP installed. It's trying to just search the web directly. I'll just tell it uh use the GitHub CLI to get info about issue number 2023. It might have been confused because 2023 is a year number, but we'll of course correct it. Okay, now it's going to search the web. So, Spotify megaphone API podcast episodes direct Spotify URL. So, this is kind of like a search that I would have done, but it's going to need to figure out does the API expose that information.
So, I'm going to just let it list as many search results as it wants. And then there's some other tools calls it can make which are get URL contents. So, this will actually get the contents of the page for a specific URL. So, apparently it found these search results and now it wants to get the contents. So, we'll let it do that. Wow. So, it's making a lot of requests. This get URL contents is failing for a few of them.
Let's see if it has enough information. If it doesn't have enough information, I think I'll disable this tool because I do know there is a built-in tool called web fetch and it could use that instead. Okay. Research and summary plan. Key research finding. The podcast migrated to Spotify megaphone which has an API. Spotify ID integration. Megaphone tracks both internal IDs and Spotify IDs or URIs for each episode. No current integration. No existing megaphone API integration found in the codebase.
Database schema. Current show model has no Spotify URL and Spotify ID fields. Okay, here's the plan. Add a Spotify ID and Spotify URL. Research and implement Megaphone API client to fetch episode data. Create a serverside service to sync Spotify URLs from Megaphone. Add environment variables from the Megaphone API. Yep, yep, yep. Uh, implement data sync logic to populate Spotify URL for existing episodes. Update it to use the direct URLs. Okay, I think this is a good plan. And apparently it's figured out from their API documentation that it can do this. If it fails, I might just start over and maybe even disable my duck.go search MCP and let it do its own searching. But for now, let's see. Can it do it? Now, for this, I'm going to let it run free. So, I have auto updates on and auto accept. It's just going to do everything it thinks it needs to do to get this done. At some point, it's going to need a megaphone API key, so it might ask me for that. Um, but I am actually going to run this in unattended mode. I'm going to see if I can figure out how to do that. I know by reading
Claude auto accept / auto approve mode
this how-to doc, there's an unattended mode. Yeah, there's this dangerously skip permissions which bypasses all permission checks. Use it in a container without internet access. I don't know. I'm I'm going to yolo it. Um, but I don't know if I can enable this in a currently active session. So, let me just ask it. Uh, can we do for the rest of this Claude code session? Uh, here's the thing. I could restart Claude with that, but I don't want it to lose its plan. I need to see if we can close Claude, but resume a previous session.
Okay, apparently there's a d-ash continue where it will resume the previous session. So, I'm going to completely exit Claude. And then we're going to do Claude with d- continue and dangerously skip permissions. Let's see. permissions mode. Running Claude Code in bypass permissions mode. In bypass permissions mode, Claude will not ask for your approval before running potentially dangerous commands. Let's do it. So, now I'll just say continue with the plan and watch it churn cuz it's going to do everything that it it wants to do. Okay.
Yeah, I'm actually going to go ahead and uh kill this and then remove my DuckDuckGo integration to see if it can better find these docs using its own web search integration. All right, so I disabled the DuckDuckGo integration. Now I'm just going to tell it to try researching the megaphone API again. Okay, so now it's going to use its built-in web search and built-in uh web fetch. Okay, so now it was actually able to retrieve those docs, which is good. It says it has the info. Let's see what it does. It is moving. It's doing a bunch of stuff.
Task 3 Yolo Mode
This is the one spot where it's going to get hung up because pnpm dev doesn't run in the background. Yeah, it figured that out pretty quickly though, which is good. Is it running? Yeah, it's not running anymore. That's okay. It got pretty far. Now we can kind of intervene and prompt it further. So, it updated the database schema, added an API client, added an API endpoint, um, and then we can populate existing episodes.
Let's look at the code that it added. So if we look in the Prisma schema, it added Spotify ID and Spotify URL. Are those two different things? I might further prompt it. And then whenever it's listing the links for an episode, if Spotify URL exists, it'll show that. Otherwise, it will just link to the search like it was doing before. It created this file which uh syncs the episodes. So it can either sync a single episode or sync all episodes. And then this is the API client to call megaphone. It needs an API token. Yeah, it's passing in the episode ID. I think this is the one thing it's going to run into, which is the episode. We have episode numbers, but it needs to be able to link an episode number to some episode on Megaphone typically by like the title. And then let's look at our sync code. So find all the shows. If we already have both, good to go. Right now those properties don't exist because I think we need to uh regenerate the Prisma types. Yeah. So right now it's
just assuming megaphone episode ID. Okay. We we need to we need to prompt it a bit a bit more. So first of all run the command that will sync the DB changes with Prisma types. That's one thing it needs to do. Then we'll say uh update our sync to link episodes by using the title of of the episode to match the results from the megaphone API. So that should add that logic in there. Okay, it looks like it's already looking for a megaphone API token. Let's see if it asked me for that eventually.
Task 3 Further Prompting
I think so far this is what we need to do. So let's see. Okay, so it updated the syncing to take the title into account. Um, I wanted to take into account the episode number as well. You can use the episode number from the DB to match the megaphone episode as well.
I will say the megaphone API might not have the episode number populated, but the title might match or the episode index in order of publish should match the episode number as they are increasing. This is somewhat vague, but let's see if it figures it out. Okay, great idea. Let me update the sync code to also use episode numbers for matching. I'll add the episode number as another matching strategy alongside title matching. Okay, I saw when it was generating Yeah, it does index position, but our show numbers are actually zero index or zero based index. Uh, so let me tell it that so that way it doesn't add one to the index cuz we start at show number zero. Um, it thinks I'm wrong. I don't think I am. You can go to you can go to uh syntax.fm/ep episode0 and uh it takes you to the preview episode. Okay, so the episode matching logic has been corrected.
Here's the updated matching behavior. Episode number in the title now correctly handles the offset. Episode titles are typically onebased. They're not. Let's double check all the other changes. Yeah, this is the other thing I want to ask it about because Spotify ID and Spotify URL are uh two separate fields, but I think the ID is just in the URL. So, let me ask it. Do we need both Spotify ID and Spotify URL in the DB? Can we just construct the URL with the ID? Okay, it said you're absolutely right. I don't know if I am, but it's saying that I am. Hope hopefully that is the case, but let's see what it does.
Claude Code does not have checkpoints built in
Now, one thing I'm noticing about using this versus using something like Cursor is there are no checkpoints. So, I have asked it to change the code like several times now, and there's no way for me to go back to a specific code change. I can just revert all of these changes, but I can't go back specifically to like earlier whenever it made these changes.
Um, and I' I've read about this in various forums, and there are MCP tools people have created that allow it to have checkpoints. Um, so you could do that, or you could just commit often, but uh I didn't do that. So right now all of these changes it's either all or none. I can't revert to earlier. Okay.
Task 3 Further Prompting
So it is changing it to be open.spotify.com/ep episodespotify ID. I want to see if that URL actually exists. Looks like it does. So in my search history you can see all of the past uh syntax episodes and it's just episode ID. So that should work. Okay.
Uh now we want to see um if the codes will work. And I haven't even reviewed it. This is this is pure vibe coding. So we'll see that when it runs the sync and when it calls the API client, is it getting all the data that it expects? But I'm not even going to double check it. What I will do is add the API key.
So if you look at client, this creates an instance of the client and is using env.gaphone API token. So I'm just going to make sure that I have that in myv. Okay. So API key added. Let's check if it worked. Um I'll just say continue with the plan. check if this works. Cool. They can see that I added the token. Good for them. Let me test the functionality. Yeah, it's not running the server right now and it needs to figure that out, which it did. So, start the server in the background. Now try to make these requests. Okay, at this point I'm just going to tell it the app is running. So, that's one thing that's happened multiple times. It starts it in the background and then just waits forever instead of specifically waiting.
The sync works successfully. Let me check what was logged in the console and test with another episode. Good. The air handling is working. Episode 920 doesn't exist. Let me try a different episode number. Wow. Okay. So, it's it's just trying to curl the app. Let me let me just tell it to say uh use Playwright. Now, I'll let it do this. But one thing I noticed is a security issue. Like any random user shouldn't be able to sync an episode. This should be locked behind admin access. So, we'll fix that next.
Possible Security Issue
But maybe I'll ask it if this is secure and see if it can figure that out. But regardless, it should use Playwright. That way it can spin up a browser, visit the page, see if it has that URL. Here it is. Okay, so it scrolled down, it clicked here. Now it's going to try to click that Spotify URL or at least see if it exists. Clicking it. Um, now it just it still just shows up as the search result. Okay, so that's that's the the fallback behavior. So what is the one that it did sync? Uh, episode 900. Okay, so if we ourselves test out episode 900. No, because episode 900 still links to the search, not the actual ID, but it said it synced it. I'm just going to tell it to uh double check the syncing again using Playwright for all scenarios. Okay, so it's going to navigate, which it did. It's navigating again. So, it says it's working for Fallback. Great. But I I want to test it for an episode that should be synced.
Task 3 Further Prompting
Now, with Playwright open, I'm actually going to go ahead and log in as an admin. That way, it can navigate to the admin dashboard and perform these actions like clearing the cache and some of the other stuff that it needs to do. Okay, so I'm logged in. We can visit the admin section of the app and clear the cache and everything else. So okay uh you can visit to perform admin actions like clearing the cache. Awesome. So this is fantastic. It's it's clearing the cache. It's figured out how it can navigate around in the admin dashboard.
That's amazing. And it's compacting the conversation. So this is something I haven't used with Claude just yet, but after your history gets a certain length, it compacts it down so that you use less tokens. Um, so it's automatically compacting. It might lose some context, but potentially it's going to be able to compact it in a way where it doesn't lose a lot of this context of the whole conversation we've had so far.
Claude Code compact
Okay, so it compacted and now it is seeing that the episode sync didn't actually update Spotify ID in the database. So right now it's trying to run Prisma Studio. Um, but uh that's a long running task. It doesn't immediately exit. I'm I'm going to help it out. run Prisma Studio in the background and use Playright to check the the data. Okay, so now Prisma Studio is running in the background. Um, it says exploring. I'll tell it where it's at. Okay, so it can open Prisma Studio. Great. It's going to look at shows. This is fascinating. The thing is like this could even be turned into a Playwright test script. I not not for navigating Prisma Studio obviously, but that's pretty cool for like end toend testing. Yeah, there we go. Let's let's just query the database. Ah, now it's going to generate a temporary script to try and query the database.
Task 3 Further Prompting
Fascinating. Ah, it's just revealing my API token in the terminal. Um, yeah. So, this is this was a deeper issue. It it was just it just had like a random podcast ID. We probably need to have the podcast ID as an environment variable as well. Yeah. Let me see if it adds that. If it doesn't, I'll just tell it. Okay, I'm just going to tell it. Let's add an env for megaphone podcast ID. Okay, it's checking. No, because it's still just the search URL. It needs to go back and figure out if this uh megaphone podcast ID is even correct. The podcast ID might be wrong. Let me check what's happening by running a proper debug test. Yeah, this is what we need. Like make sure that you're calling the right uh the right endpoint.
Um, I'll just tell it. Yeah, we don't have a podcast ID. So, let me figure out that is and just add it to the env. Okay, so I'm now I'm giving it the correct podcast ID. Okay, it can't even make basic requests to the megaphone API. So, let me just double check that my API token is correct and that it has the right endpoints and everything else.
Okay, that was it. It needed a network ID and organization ID. There were a few more environment variables it needed to make sure it was calling the right uh megaphone endpoints. Let me tell it to uh clear the cache if it's not updated. Okay, so it's still not working. One thing I'm going to do while I'm thinking about it is just make sure that that endpoint for syncing uh isn't available to the world. It it should just be something that's only called whenever we click sync changed or new shows or sync all shows. Okay, so right now the Spotify sync endpoint is public. It should only run for admins when they click these two buttons on this page.
Right now it's doing Spotify sync separately. I'm just going to tell it uh Spotify sync should happen at the same time. Okay, it just stopped. We were getting this issue whenever trying to do MCP navigate. The tokens exceed the allowed tokens. So, I think what I'm going to do first is do a compact and then we'll try using playwright again to do the navigation and test things out because I honestly I think it's hallucinating right now because it it wasn't actually getting a response when trying to navigate to that page. Okay, so it compacted everything. There is an admin page where you can see the details about an episode and it's just a full DB dump. So I'm going to tell it to just use this because then it can see if that Spotify ID got populated. Now we're cooking. So it added that button. It tried clicking it. It got an internal error. It then is looking at the server logs. It's going to do some debugging.
Okay, so at this point it's it stopped. It g it's given up. But I think ultimately um now we can just ask it to fix this issue cuz when we go to the episode page, it doesn't have a Spotify ID. When we click sync Spotify, we get an internal error. So let's tell it to debug this issue. Oh wow, it's tapping into se sequential thinking. So this is another MCP server I set up which it hadn't used yet. Uh which basically makes it sequentially think through the process. So it might be a little bit better at trying to fix it. Nice. So now it's actually going to show the error messages on the that admin page. Okay.
So it's going to navigate there. Clicked the button. Internal error. It's trying its best. Um it keeps visiting the page, clicking the button, getting the internal error page. It wants to see the error on the same page. Um I'm going to let it keep going and I'm going to go eat lunch. So when I come back from lunch, Um hopefully it'll have fixed it.
Task 3 Yolo while I eat lunch
Um but no, it just gave up right before it was about to leave. Okay. Um I'm telling it, double check the server logs. Add debugging logs if needed. Do everything you can to fix the issue. Don't stop till the issue is fixed. Uh the issue might be with the megaphone API call. Do some debugging there as well if needed. Keep going. You can do this. All right. Now I'm going to go eat lunch and we'll see how it does uh when I get back.
[Applause] [Music] Okay, I'm still eating lunch, but I thought I would check in. It at least got to the point where it's seeing the error here, but then it didn't fix this. So, I guess I have to tell it to keep going. All right, I'm going to go keep eating lunch and uh let it do its thing.
[Applause] Okay, I'm back and it has determined there is an issue with the podcast ID. Um, I think my environment variables are correct and it was using like a hard-coded one earlier, I think. So, let's just try to restart the server or let's tell it to stop the server. So, I told it to stop the server, restart it, and then make sure that the the podcast ID coming in from the ENV is correct.
Task 3 Further Prompting
Okay, so it looks like restarting got the correct environment variable. So, now it has the right podcast ID. And let's see. Okay, now now we're cooking. So now it's going to update all of its uh codes that are calling the episodes endpoints. It worked. It works. I can see the Spotify ID. Sick. Okay. Okay. Okay. Okay. But now all of a sudden it needs to compact the conversation. But that's working. Um. Heck yeah. So episode 919. If we go here, that links directly to the episode. Heck yeah. Heck yeah. Okay, I'll let it finish compacting. Um, and then, uh, we'll test the sync with all of the episodes and see if there are any episodes that it can't find. Okay, at this point, I'm going to go manually review all of the changed files, see if I need to prompt it anymore, and then we can call this feature done. Okay, one issue I saw is earlier when it was trying to get that action working for sync Spotify on the admin page, it removed the default action, but it didn't add it back in.
Task 3 Initial Success
Task 3 Code Review
And that definitely needs to be there because that basically removed that functionality. So I'll tell it to fix that. And then the other thing is the matching episode logic is very complex. I mean it maybe it's necessarily complex. Basically it's trying to find the correct episode based on title and number. So I think I'll leave it as is and maybe we'll just get this reviewed by someone else on the team and see if they think it's too complex. Uh but for one, this is not good. Let's see if we can figure this out because it's going to need to potentially run like a git diff on that file. Yeah. Okay. Yeah. So, it did a a git log and git diff. Okay.
Much better. So, now in the synced changes here, um it just renamed it from default to update AI show note and then it added the sync Spotify note. Okay. I'm going to ask it to do one final review. It has this dev.log file, uh which was just the output of the server that I was looking against. It definitely needs to delete that. Um, I'm just going to tell it to clean things up and I'll see if it notices that. So, I told it, let's clean up everything we've changed and get ready for a commit PR.
Yeah. So, remove the debugging logs. Great. Yeah. And while it's cleaning up, I'm going to go walk upstairs. This this is my job now. I just tell it to do things and I don't have to sit at my computer and and babysit it. But I'll be back and hopefully it'll be done with the cleanup when I get back. Okay. One thing I see is whenever we import the latest shows, we're syncing all of the episodes Spotify data. We only need to sync the latest added shows. So, I'll tell it to fix that. Okay, that looks much better. Now, it is only updating and syncing the ones that just got added. So, basically, anytime we publish a new episode, there's a new markdown file, but this function will figure out what that new episode was, and then we'll know we need to go find that Spotify info once we've added that new show. Now, there are a couple of unttracked files that haven't been deleted yet. Um, I'm going to tell Claude to fix that. So hopefully it removes that devlog and then it'll entirely remove the API file for syncing Spotify because before it created an API endpoint. Now those are just part of
some server actions. Cool. It figured it out. Okay, so this is great. One more thing before we create the PR is I want to make sure that if I run this locally, uh I want to see if there are any episodes that it can't match to the API and then potentially try to fix that. All right. So, I'm telling it I want to create a one-off test script that syncs all of the episodes, but for each one, if it doesn't match or can't find a match, then create some logs and then we'll use those logs to update our matching code. Okay, so it actually fixed some things. So, it mentioned that the megaphone API is returning the episodes in reverse chronological order.
Task 3 Sync / Test
So, if we're just matching on index, that wouldn't work. So, it it wrote the code to fix that. Updated the matching code. Um, I do want to take a look at the script it created. Let's see. It just recreated a bunch of these matching functions in this file. We don't want that. We don't want that at all. We want to make sure our existing code works as is. And also, uh, we're losing context here. So, I'm going to go ahead and compact and then we'll we'll go from there. Okay, it finished compacting. I'm telling it it just recreated a bunch of code. It needs to write a test sync file that doesn't recreate the functions that already exist in the codebase. It just needs to call the sync episode number or sync all episodes. Honestly, it doesn't even need to test those functions. I I just wanted to call sync episode and pass an episode number in. Let let me let me tell it this. Yeah, stop all that. Just just basically our test script needs to just call the function, pass in an episode number, see if it matched with the API
results. Uh this is the point where I am getting very mad at Claude. It's uh this is where I wish I had checkpoints like in cursor because I'd go back to before it created this file. I'm actually just going to leave it running because I have a meeting that I I have to go to. Um so let's see if it can it can get it working. Okay, so I told it exactly what I wanted. Let's let's see what it does. Okay, it it got a little bit further. It at least is checking the ones that have Spotify IDs.
Getting Mad at Claude
Task 3 Sync / Test Continued
API Credit Cost for Initial Task 3
I'm going to go and end this session. Let's actually see how much it cost us. Wow. Okay. did not expect that. I've I've chewed through an entire month's worth of Pro, which is $20 a month uh in just this one session. Fascinating. Okay, we're going to come back to this in a second. Um but I got a meeting I had to go to. I'll be back. We'll fix this, make a PR, and then I'll I'll talk about my thoughts and conclusions and whether or not I am going to keep using Claude. Check.
Check. Okay, so I'm back. I'm gonna start Claude back up with continue, but I'm not going to do a dangerously skip permissions anymore. We're gonna we're gonna actually approve all of these changes as it goes. Um, but one thing is I we're just going to scrap these these test scripts because it was doing a lot of extra stuff. I'm going to scrap those and then just start over and figuring out how to get it to test the sync locally. Okay, we're back to where we were. I'm going to try to prompt it better and just get it to create a script that will sync all the episodes and tell me which ones it couldn't find matches for. Okay, I was much more specific in my prompt here. So, we'll see how it does. I think one of the main issues is it's writing JavaScript files and trying to import TypeScript files and Svelte specific stuff and that is an issue for it. Um, so maybe we write a TypeScript file and then use something like TSX. We'll see what it comes up with. Okay, so the file looks good.
but it's not going to be able to run it because it's trying to dynamically import this TypeScript file here. And I want it to figure out how to not do that or how to just run this file directly. Um, I know there's a tool called jiti that runs TypeScript with ESM support in Node.js. I'm going to tell it to just use that without installing it as a dependency. Okay. I'm asking it if it can use jiti and if we can just do something like DLX. Okay, I'm in a loop.
Task 3 Claude is in a Loop...
I've literally told it five times to stop recreating the functionality in this JS file. It's just having a really hard time being able to import from this file, which is a TypeScript file in a JavaScript file. Let me see if I can come up with a better approach because it's possible that sync.ts ts uh maybe doesn't need to use like the Svelte env.
Task 3 Manual Intervention
Let's see. Okay, I guided it to pull all of this out as an argument to these functions. So that way we're not directly importing env, which is a SvelteKit specific thing. So hopefully tsx will be able to run this file directly. Let's see. Something's happening. Yeah, this is a case where I kind of want to see what this script is outputting, but it's hiding it from me.
Task 3 Continued
I don't know how to see the output. I guess I'll just let it run. Okay, so the script is working. I specifically want to see when it can't find matches cuz that's something that we would want to fix. So, I'm going to just run this command directly and see what the output is. Okay, I've done some digging and I can't find some episodes. I'm curious if the API is returning everything, but I'm going to give cursor the link to the docs and see if it can figure something out accordingly because you can also filter the call to the API for like a publish date. So maybe when we're searching for an episode, we know what the publish date is. So we can add those filters. I'm going to tell uh Claude to do that when it's calling their API. So I I came up with a prompt. Basically, I'm telling it read the docs, use the query params. I I'm worried that we're not getting all of the episodes. Like, it doesn't say that it's pageionated, but I'm also curious if we add these filters in, then maybe it will return the data that we need. Odd thinks that
Task 3 Manual Intervention
Task 3 Continued
there's pageionation. I didn't see it in the docs, but let's see what it does. Okay, apparently they might be in the headers. X page, Xer page. Okay, it did its thing. Now, let's see if it can find the episode data. unexpected response format from the megaphone API, man. Okay, I will say this is probably the first time today using uh Claude where I feel frustrated like sometimes whenever I'm inside of cursor. I mean, we did technically get into some loops earlier, but it was pretty easy to get out of. Right now, it feels like we've coded ourselves into a hole. Like I thought it was using pageionation if it had it, but then it wasn't and then the docs didn't say they had it. Then they added it and then now it's not working at all. I'm frustrated. Just creating all these test files, all these scripts.
CJ is Really Frustrated
Task 3 Continued
Debug API response. Huh. The pageionation is working perfectly now. Is it? I want to see the output. I don't trust you. Okay, so it tested pageionation with a specific page and per page and then got all Okay, cool. We're on the right track now. It can do the pageionation. All right. So, it's going to delete this this uh test pageionation and debugging the response.
Okay. Now, let's test the sync Spotify script. Can it find episode 908? I think the issue now is for this. It's getting all of the episodes every time. So, I think I'll make one more update so it caches that especially if it's running it in a script. It found the Spotify ID. Okay. Cool, cool, cool, cool, cool. Let's say uh we should cache get all episodes in memory. Okay, so now it caches it. We can run this script.
It's going to try to sync them all. It'll take a second the first time because it has to actually get back all of the episodes from the megaphone API, but then after that it should just Yeah, exactly. Okay, this is what I like to see. Though to really make sure that this is working, I think I want to add a unique constraint on that column. So that way if two episodes try to have the same ID, it will fail and then we'll know for sure. So if it's unique, then it can't be null, right?
I'm going to ask Claude to figure this out for me. We need to make sure that Spotify ID is unique in the DB without adding a unique constraint. This will prevent matching against the wrong episode. Let's see what it can come up with. It's what I was afraid of. So, it found six duplicate Spotify IDs in the database.
Okay, here's one. Yeah, this is a bad match. So, I let it know about the two episodes. So, 669 and 597 were matched against the same ID. So, let's update our matching logic. See what it did. Get title similarity. Wow, we're doing some natural language processing here. Calculating the overlap. Okay, go for it. Okay. Um, I am going to reset the database. I'm going to set the Spotify ID to null on everything and then run a sync and make sure that the matching is happening in the right way. Okay. Moment of truth for the 10th time.
Let's run a sync and see if there are any collisions. You know what? We should use the publish date. Let's tell it to do that. Matching logic should use the publish date first as the best indicator for match. Okay, so that's better and should be the best indicator. Let's try again. I'll remove the Spotify ID, run the script from scratch, and see if there are any things that don't match.
Now, all of the episodes in the 7, 8, and 900s have the episode number in the title, and then before that, they don't. So, that's really where we're going to see if this is working. Fantastic. So, there was only one unmatched episode and that makes sense because that episode actually got removed, so it doesn't exist anymore. Awesome. So, the syncing is working. I think one thing I'm going to do is just like a visual test. I'm going to go through and click through some episodes and make sure that it links to the right spot and then I'll ask Claude to clean up its code and get ready for a commit. Let's review the changes. And it actually committed the code and I did not want it to. That's okay cuz we're still on a separate branch, but I do want to clean things up. But now it's going to be harder. I want it I want it to still know which files are changed so that way it'll be easier to refactor them. Um, so yeah, undo the commit but keep the change files. Okay, much better. We've got nine files changed.
This is the stuff. Great. Now I am going to prompt it to clean this stuff up. But I think I'm going to start a new session cuz right now it has all of that context and I'm not so much worried about all the work that we've done. Now given this change set, let's clean it up. Let's remove unused code, remove duplicate logic, that kind of stuff. So I'm actually going to kill this session. We can see how much it costs. Yeah. So this session cost seven $7. And if we look at our dashboard, yeah, we've only got about $17 worth of credits left. That's okay. Should be enough. We'll start a new session and connect it up to VS Code. And now let's clean up this commit. Okay, I'll help you clean up the stage changes by removing unnecessary logic, unused code, and cons consolidating duplicate logic. Let me start by examining the current changes.
Task 3 Final Code Review / Cleanup
API Credit Cost for the rest of Task 3
Task 3 Final Code Review / Cleanup Continued
Now, we have removed all of the previous context. So, it doesn't know like what it what it did and what it worked on. It's completely fresh in terms of the context. All it knows about are the changed files. But I think that's okay because now it's really just going to consolidate things as it sees it versus having all of the context of everything that we've worked on. So it found a duplicate function that it was able to refactor, which is good. Okay, it cleaned things up. I'm going to do one more manual pass over all of the files and then go ahead and make a PR with these changes. Okay, it looks good to me. It definitely is going to need a human review. So uh I'm sure Scott will be able to take a look at it soon. But let's go ahead and commit this, push it up, make a PR. All right, so that was my experience as you saw using Claude for the first time throughout the day for increasingly complex tasks. And uh what are my overall impressions? First of all, I really like the fact that Claude has built-in planning in the tool itself. Now, the only thing I can really compare this to is Cursor. And when I'm
Conclusions / Opinions / Overall Impressions
using Cursor, the only way it will follow a plan is if I tell it to generate like a plan MD file. And then I have to tell it to keep checking back to that MD file. Claude has this integrated and so it really keeps it aligned. It kind of prevents it from going down a rabbit hole too often and there was really only once where I got into a loop and you've probably experienced this before if you've ever used Cursor or GitHub Copilot where it tries to fix something and then it doesn't work and then a little bit later it just tries to fix it the same way that didn't work earlier and it's just like in a loop. uh that happened with Claude, but I was very easily able to get it out of that loop because I did some manual intervention and then it was just off to the races again. So overall, I really like that feature about Claude Code. It's probably the thing that distinguishes it the most from other AI coding tools that I've used. Now, the next thing I liked about Claude Code is the VS Code integration. Now, when I set off to use Claude Code, I had some preconceived notions, right? Because it's a CLI tool.
It's marketed as a CLI tool. And my thought was, okay, well, if it's doing all these changes from the CLI, how I am I going to be able to see what's happening like in the editor or confirm changes and they have that. So, inside of Claude Code, I just did slash IDE that hooked it up to VS Code that was running and anytime Claude wanted to make a change to a file that would pop up inside of VS Code and I could review the changes in an experience that I'm used to and then confirm it inside of the CLI. Uh, and so that was a perfect workflow for me. It's about the same as inside of Cursor whenever it shows you the changes that it's about to make before you approve them. Um, so that worked wonderfully. Now, the other thing I really liked about Claude, which I have not seen cursor do, is if Claude needed to execute some code, but maybe it didn't need to actually create a file in my codebase to do this. Like early on, it wanted to convert some timestamps into date objects to see what they actually were. and it literally just wrote a one-off script, ran that through
node, and didn't add a new script file to my codebase. And so that was really cool to see because essentially anytime it needed to do something where it would make sense to run code instead of just guessing, it did that and it didn't add a bunch of noise or extra files in the codebase. Uh this is something I haven't seen cursor do. So that was really impressive that just every now and then it would create a script like in a temp directory to test some things out and then go back to what it was doing. Now, another thing I really liked about Claude, which isn't Claude specific, but something that I actually haven't tried out in cursor, is using the Playwright MCP server. The fact that Claude could launch the browser, click on buttons to test out the feature that it just implemented, and then check the logs in the console, like all in an was super powerful. It was like just watching a dev build the thing and test the thing like I normally would do. And lastly, I'm just overall impressed with how well Claude Code just stayed in line with what I told it to do and how it it
called out to the tools that it needed to and it it just felt like a lot less intervention than I typically have to do when I'm using something like cursor. So overall, I really liked it. Now the question you've probably all been waiting for, would I replace cursor with Claude Code? And personally right now, no. uh mainly because my work pays for cursor. They don't pay for Claude Code.
Will I Replace Cursor with Claude Code?
And as we saw as I was using Claude Code, it uses a lot of API credits. Now you like I mentioned earlier, you can get the Claude Pro plan and then that won't use API credits, but you might hit some usage limits at a certain point. Um but my work is already paying for cursor. They're not paying for Claude Code. So I'm going to keep using cursor, but I'm not going to forget how good Claude was at making plans. And I have done some research into MCP servers that can basically do a similar thing to what Claude Code is doing where it has a plan and keeps track of it as it's going, but then maybe try to use that inside of Cursor because really that was the main thing that that I really liked about Claude is just it it sticks to the plan.
And um I've had a lot of experiences with cursor where it doesn't stick to the plan. So, I really like Claude Code, but right now my work isn't paying for it, and it seems a little bit cost prohibitive if you're going to be using API tokens to work with it. So, that's it for this video. Let me know down in the comments, though, if you've been using Claude Code, maybe have any tips for me, maybe you were yelling at the screen when I was doing something because I'm not super familiar with all the stuff that it's capable of. This was my first time using it. Um, and if you haven't used Claude Code, let me know if you're going to after watching this video. So, thank you so much for watching and I'll see you in the next one.
Thanks!
Quote it with credit and a link. Quoting Syntax