You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blogposts/testing-claude-code/index.mdx
+14-7Lines changed: 14 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ I had to look at Gartner hype cycles a lot during my time at university, so I gu
21
21
22
22
They are exceptional for writing, translating, etc., but my opinion for using them for programming is that you definitely still need an actual intelligence to operate them and critically analyze the results. I have been using Claude and GitHub Copilot for years now and am super happy with the help that they can provide. I am just not optimistic that they will replace real programmers in the near future for big and important codebases.
23
23
24
-
But there are still people like Mark Zuckerberg stating that (AI will replace mid-level engineers soon)[https://www.forbes.com/sites/quickerbettertech/2025/01/26/business-tech-news-zuckerberg-says-ai-will-replace-mid-level-engineers-soon/]. I think it is never useful to listen to the opinion of people on matters where they invested a lot of money in. But the super optimism of also his peers like Altman and Musk seemed far from reality to me.
24
+
But there are still people like Mark Zuckerberg stating that [AI will replace mid-level engineers soon](https://www.forbes.com/sites/quickerbettertech/2025/01/26/business-tech-news-zuckerberg-says-ai-will-replace-mid-level-engineers-soon/). I think it is never useful to listen to the opinion of people on matters where they invested a lot of money in. But the super optimism of also his peers like Altman and Musk seemed far from reality to me.
25
25
26
26
## Claude Code
27
27
@@ -51,23 +51,24 @@ These are the steps it would have to do:
51
51
- Call the same react components from these Astro pages
52
52
- Migrate data fetching from GraphQL to SQLite queries
53
53
- Migrate Gatsby specifics to Astro specifics (handling images and links)
54
-
- Don't change how anything looks (just keep the same HTML)
54
+
- Don't change how anything looks (just keep the same HTML, even react components also work in Astro)
55
55
56
-
As I am undergoing the same process for this blog, I have a good understanding of the steps and the complexity of the task. And my take on this is that this is with online resources, not hard or unique to do. It is just tedious and time-consuming.
56
+
As I am undergoing the same process for this blog, I have a good understanding of the steps and the complexity of the task. And my take on this is that this is with online resources, not hard or unique to do. It is just tedious and time-consuming. So I expect Claude Code to give me a nice helping hand here.
57
57
58
-
## Getting started
58
+
## The experiment
59
59
60
-
So I created a new branch in my Git repository and launched Claude Code.
60
+
So let's get started. I created a new branch in my Git repository and launched Claude Code.
61
61
62
62
### Prompt 1
63
63
64
64
**Prompt**: "This is a f1 data analysis website written in Gatsby.js (react). Please migrate it to Astro. With Gatsby, I have used postgraphile to import data into its graphql schema. I don't want that anymore. Please use `f1db.sqlite` from the data folder, it has the same data schema and data. You can find the schema in `datamodel.sql`."
65
65
66
-
It started to do the work and nicely outputting the steps it is doing. If it wants to run a command (like grep or rm) or write to a file, it asks for permission. You can deny, allow once, or always allow for the same action/command.
67
-
68
66
**Elapsed time**: ~200s
67
+
69
68
**Cost**: ~0.9€
70
69
70
+
It started to do the work and nicely outputting the steps it is doing. If it wants to run a command (like grep or rm) or write to a file, it asks for permission. You can deny, allow once, or always allow for the same action/command.
71
+
71
72
It changed plenty of files, and I was excited to see the result. It even created `MIGRATION-README.md` with some context:
72
73
73
74
Changes Made:
@@ -88,6 +89,7 @@ The next error that greeted me was that it could not load Gatsby Image files. I
88
89
**Prompt**: "There are some issues with the usage of Gatsby image. Please make it work for Astro: require() of ES Module (error message specifics)"
89
90
90
91
**Elapsed time**: ~120s
92
+
91
93
**Cost**: ~0.3€
92
94
93
95
Now it created a script called `migrate-images.js` and told me to run it. It definitely made sense, as Astro requires you to store static assets in a different place. I ran it and still got the same error message...
@@ -97,6 +99,7 @@ Now it created a script called `migrate-images.js` and told me to run it. It def
97
99
**Prompt**: "The blog part still uses gatsby image. Can you migrate it so that it works with astro."
98
100
99
101
**Elapsed time**: ~200s
102
+
100
103
**Cost**: ~0.7€
101
104
102
105
Now it migrated the blog part of the website. I haven't noticed before that it actually did not migrate the blog yet. But still, the same error message greeted me. I took matters into my own hands and commented out the one image that is loaded from the index page.
@@ -108,6 +111,7 @@ Now I was greeted with the next error message: "It appears like Gatsby is miscon
108
111
**Prompt**: "I still can't load the index page. I get this: (copied error message). Can you look over all react components and make sure that nothing Gatsby-related is in there. If there is anything, please migrate it to work with Astro."
109
112
110
113
**Elapsed time**: ~200s
114
+
111
115
**Cost**: ~1.8€
112
116
113
117
At this point, frustration kicked in. Not only did I still get the same error message, the cost was rising, and it started to do stuff I hadn't asked it for.
@@ -124,7 +128,9 @@ I figured maybe the leftover Gatsby files and configs irritated the AI.
124
128
**Prompt**: "Can you remove old Gatsby files that are not needed anymore?"
125
129
126
130
**Elapsed time**: ~200s
131
+
127
132
**Cost**: ~1.8€
133
+
128
134
**Context**: 21% remaining
129
135
130
136
It did remove the files and also changed others. It still didn't work. I noticed that it made errors in importing another file (relative path) and manually fixed it.
@@ -144,6 +150,7 @@ Total duration (wall): 56m 53.0s
144
150
**Prompt**: "In this project, I am trying to migrate a Gatsby site to Astro. See MIGRATION-README.md for context. Much stuff changed, but a huge issue is actually getting data from the SQLite DB to the website. You generated the useAstroData.js hook file for this. Unfortunately, this won't work as the hooks run on the client where we can't and don't want to query the DB. Instead, can you move all the data loading to the Astro page files so that all the React components just get the data passed as props?"
145
151
146
152
**Elapsed time**: ~200s
153
+
147
154
**Cost**: ~0.5€
148
155
149
156
Great, a success. For the first time, the index page loaded. It looks like it succeeded in the data fetching migration.
0 commit comments