My Experiments with Claude.AI

Gemini_Generated_Image_tf4xa8tf4xa8tf4x.png

Like most people I started my AI journey using ChatGPT, and then Gemini - and found them to be OK, and not really something I would use on a day-to-day basis. They were good for primary research - and that too had to be checked before you could use it - as they tended to hallucinate. I believe that has changed in recent weeks/month - but I would still not trust them with mission critical work.

What actually blew my mind was Claude.AI - I’m not bad at coding, and have been dabbling in multiple languages over the years - going all the way back to BASIC, Pascal, C, C++, JAVA - and even smatters of Python, Perl, etc. I don’t work as a programmer, and mainly dabble on personal projects. In recent years have been focusing on C++ for Arduino projects - for my electronics experiments and 3D Printing fun. Also, created an extension for Klipper (a great 3D printing firmware) called Save Variables with Kevin’s help back in 2020 - https://github.com/Klipper3d/klipper/blob/master/klippy/extras/save_variables.py .

Welcome to the Future

I had been running my blogs on Wordpress for many years - hosted on GoDaddy - and rebuilt the blogs last year. However, in recent years, GoDaddy hosting has become slower and slower - so I thought of moving to a VPS solution instead. Add to that, I had heard of static site builders like hugo and jekyll - so thought of moving on from Wordpress to a faster static site. It would include:

  1. Hugo installed on my mac brew install hugo
  2. .MD files edited on my mac using Obsidian
  3. LEMP stack (Linux, Nginx (pronounced “Engine-X”), MySQL, and PHP) on the VPS (hosted on webeyesoft)
  4. MySQL and PHP being used for only one of the blogs that I didn’t want to change to static
  5. Files rsynced from my mac to the website, whenever I make a change

All well and good, however, when I started - ran into multiple issues that required me to learn syntaxes for hugo, nginx, VPS servers - and I started looking for better options. In comes Claude.AI - I thought I’d give it a try.

Problems and Solutions

The way Claude.AI works is very simple - you give it a problem (preferably a coding one) - provide as much information as you can - and it writes code for you to solve the problem. The first prompt I gave it was:

I have a wordpress website: https://dushyant.ahuja.ws/
I want to move this to a static website using hugo, hosted on a VPS instead of the web server that I currently have. Please provide a step by step process of making this conversion

Lo and Behold - It created a full Step-by-step migration guide with the following steps (with details and code required at each step):

  1. Export and Prepare Data
    1. Export Wordpress content using the admin panel
    2. Setup the local hugo environment
  2. Create Hugo Site Structure
    1. Initialise the site
    2. Install a Theme
    3. Hugo configuration
  3. Convert the Wordpress Content
    1. Use a Hugo Exporter (the first option it provided didn’t work)
    2. Organise Files and Content clean-up
  4. Local Testing
  5. VPS Deployment
    1. Setting up the VPS (including installing nginx, certbot)
    2. Configuring Nginx (with the nginx configuration file)
    3. Enable SSL
    4. Deploying the Hugo site
  6. Update DNS
  7. Setup Automation (this is something I’ve not done till now)

Here is the full solution that Claude.AI provided: https://claude.ai/public/artifacts/df04046f-144e-4819-860c-f3312119ed1c

Please note, this was v1 and did not work fully.

Iterations

Next came various iterations where I found more problems, and Claude.AI provided updated steps and code to help me debug the issues and deploy the site as I wanted it. This included:

  1. Customizing the site to look similar to my existing site Can you suggest a theme, or alternatively develop a theme that looks like my current site - Claude.AI provided multiple options with the required code.
  2. Though many of the options provided no longer worked as either the links had gone down, or the plugins were no longer available. The solution was to ask Claude.AI - e.g. Using the Mainroad template - I get the following error. **You don't have any posts yet!** Once you post something in any folder (section) under the **content** directory, it will appear here. Only one section (with the most posts) will be displayed on the main page by default. and Claude.AI would run through solutions, ask a few debuging questions - and help me setup the site so it works
  3. Slideshow Implementation - I'm trying to create a simple slideshow on my hugo website using: https://medium.com/@brucelim/creating-a-simple-slideshow-for-your-hugo-blog-with-fslightbox-e0bf89945cbf I've created the lightbox.html shortcode, have also created a sample page - but it comes up empty in the hugo website. Please help - and Claude.AI ran through the options, provided a solution that helped me implement slideshows within my blog
  4. Search Implementation - Since Hugo creates a static website, there is no search implementation out of the box. This is something I wanted (as I had it before in wordpress) - so back to Claude.AI - and asked Hi - I've created a hugo site with the attached toml file. I want to add a search box to the website - can you help - I was provided with options - I chose one and got the search box working
  5. Needed a separate theme for my PhotoBlog (https://photos.ahuja.ws) - and went back to Claude.AI. I had tried a few options - but none of them worked the way I wanted; and required me to change the way my files were structured. I'm creating a hugo based photoblog using the phugo theme. I have all my .md files in content/posts folder. Images are in the images/ folder. Attached are my config.toml file, one sample .md file, and the html file generated for the home page of the website. Please help get the website running - I want it to look similar (does not need to be exact) to: https://photos.ahuja.ws/ - You can suggest a different hugo theme as well if that is required. I had previously installed the https://github.com/nicokaiser/hugo-theme-gallery - but that didn't work out After a few iterations including one that said Option 2 would require me to restructure my entire site - the current site has all the md files under one folder content/posts, and all the image files under images/ - I would prefer something that lets me use this structure - Claude.AI created a whole theme for me that just worked
  6. Another problem I came up with was that my wordpress site had multiple versions of the same image (different sizes and resolutions) - but the Hugo site didn’t use them and they were just taking up space on my site. Asked Claude.AI, and it provided me with a shell file that would a) search all the .MD files, b) find files that weren’t linked, and c) move them to an unused folder. I was able to reduce my static file count from over 3,000 down to 200

Life is not perfect

This is not to say that Claude.AI comes up with the correct solution at a first go - no, no, no - you have to go through the solutions it provided, and then iterate through the problems you see, so that it updates the code for you, asks you to run multiple commands. You can see the frustrations and steps that I still went through in one of the chats: https://claude.ai/share/86df1139-a488-4157-8f8c-ceefcf26d728

Final Thoughts

Given the back and forth and the multiple iterations, was it worth it? Let’s list down the Advantages and Disadvantages:

  1. Advantages
    • Was able to deploy the site really fast
    • The site works nicely - it may be missing some features, but works well
  2. Disadvantages
    • Most of the solutions did not work the first time around, and took a lot of back and forth with Claude.AI to get solutions working
    • Many times, I went into a rabbit hole which simply didn’t work - and had to start from scratch again
    • I didn’t learn any of the syntaxes that I’ve used - Nginx configuration, Hugo templates, Shell coding - I was simply copy-pasting the solutions provided and hoping that they would work. If I need to change anything (even one line of code) - I will have to go back to an AI to make the changes.

Overall, I would say that for a hobbyist like me - it’s an easy way to try something new without gaining an understanding of the inner workings. For a professional coder - I would recommend against using Claude.AI or any other AI to code for you - specially if it’s in a language that you don’t understand. It might be good to debug a specific portion, but I don’t think it’s ready to replace good programmers right now.

Let me know what you think.

PS. Header Image generated using Gemini :-)

Latest Posts