Ralphing to lose weight
Introduction to being a fatass in finance and tech.
- One of my 2026 resolutions, well not resolutions, but theme for the year is to pick up healthier habits for me and my girlfriend. I'm an active person, I play football regularly and I go on and off to the gym. However, the gym wasn't a habit of mine, I only went when I had the time.
- The main problem for me is Nutrition. I am an anxious person that loves to get dopamine from food. I also love going out for dinner to try new places. The combination of those made me not be in "good" shape: 29 BMI is... not ideal. However, I wasn't out of shape, I can play a whole match of football and can run a 5k with no problem. So the goal is just to keep up with the healthier habits.
- For me, the problem is nutrition. I know how the thermodynamics works: Less calories in than you burn in a day = Lose fat. (roughly). However, I'm bad at tracking macros. So I wanted to make that easier by abusing Claude Code and creating a simple web app where I can prompt an LLM to analyze a picture of my food and estimate macros. It might be a dumb idea, but monkey sees calorie number, monkey freaks the fuck out of eating a piece of kinder bueno.

- The thing is that I always worked as a pseudo data analyst in finance. I'm a jack of all trades but a master of none. Need someone to evaluate and backtest a strategy? No problem. Need someone to try to implement a FIX parser for an exchange? Sure, I'll try. Need to automate all of the backoffice tasks of our firm? No problem chief. Need to analyze a zero coupon ARS bond curve? SURE THING BOSS. However, I'm not the best at any of these things, I'm not a good programmer, I'm not a good analyst and I'm not a good trader. However, I am resourceful and I think I can keep up to date with everything faster than any of my peers.
- So, to keep up, I need to familiarize myself with using Claude Code and implementing an idea from scratch. I need to fully understand Skills, Agents, the whole shebang.
Ralph and Claude
So, I put my hands to the task, but I didn't want just to follow a dumb script on how to run a Ralph Loop, i wanted to create it form scratch. I booted up Claude Code and this is the way I tried to make it work:
In plan mode, I tasked it to infer what steps and prerequisites would I need to take to create an App that takes a picture, infers in some way the food in the picture, can deduce its macros and store it into a database for tracking. (this is not taking into account any details about the front-end, back-end, bell-end, etc).

After dealing with it for a bit, I tasked it to break down the plan in small tasks that could be developed separately in order, with its proper tests, so Claude could read a simple task, develop it and test it in a short amount of context window.
Claude then returned a file named "PRD.json" with 41 tasks, each one with a description, tests and a flag named "done" set to False if the task had been done. Also, in the metadata, it tracked the number of the last successful task.
I then prompted Claude to create a new file, named "prompt_reading.md" that instructed Claude to:
- Read "PRD.json"
- Fetch the last successful task
- Jump to the next one
- Do that task
- Evaluate its tests.
- If successful, update the "done" flag and update the number of the last realized task.
- Exit CC
Claude instructed me to get the API Keys of:
- The Anthropic API for the recognition of the food and the deduction of the calories: It would prompt the LLM for its best guess and an estimate of the calories.
- The Supabase API Keys: Supabase would be the database chosen to log the info. I think it chose it because of the online support, so for a small use app we didn't have to deal with self-hosting a Postgres or Mongo database. This would have been a really useful skill to learn now, I think I could have pulled it off quite easily because of past experience, but some part of me wanted to use Supabase to see what the fuss was about.
For context, I never specified what stack to use. Claude was free to determine the tools, languages and libraries: It decided on:
- Next.js for the backend
- React for the front end
- Tailwind for the CSS layout
To be honest, I have never actually written a single JavaScript line in my life, so I wasn't sure what to expect, I just trusted the process.
Token overconsumption fears: Losing weight at what cost?
- My biggest fear was overdoing the token consumption. I only had the 20 USD Claude Pro plan, and I knew that I would need to use the Anthropic API with pay-as-you-use token consumption. I loaded the API with 15 bucks just to not be charged every time and have a more stable control to test the App.
- And so it began: I opened Claude Code, and told it "Read @prompt_reading.md and follow its instructions."
- Because it was my first time developing a project like this, I didn't want to automatically approve everything, so I just sat down there watching as CC opened the file, read the instructions, and proceeded to do the first one, asked me every step of the way to allow it permissions, update the task log and exit.
- That was a little bit mesmerizing, I was assembling lego blocks to create a real world solution, just that it wasn't me who was doing it, I was just a mere supervisor that knew what the end product should look like. So then, I repeated the process... and again... and again. For every task, a new session was opened with a small context window, so CC never had any problem with the codebase and sloppy code. After I think like 10 or 11 tasks, I hit my token limit for the day. The thing about the Pro plan is that I can't find a historic token consumption to check when and how I hit those limits. I was using Opus 4.5, so I had 200k context window, but I don't know what the allowance is. Anthropic should really put a better detailed dashboard for the set-plans.
- The next day, to avoid doing all this hassle, I prompted CC to create a bash script that:
- Opened up CC
- Read the @prompt_reading.md file
- Execute the tasks described
- If a parameter named --count was greater than 1, repeat until met.
- To the instructions I added a flag named "--danger" that if true, it would automatically approve everything in the session for CC. I never ran it, but if true, maybe I could have just walked away from the computer and the app would have been finished (token management aside).
- Then, I ran the script and watched as the App was created bit by bit.
And so... the Shittiest food macros tracking was born!

Is it ugly? Yes! Is the layout awful? Yes! Is the color palette really unaesthetic? Yes! Does it work? Yes! Well, kinda.

I uploaded the picture of a beautiful Amatriciana Pasta bowl that I ate. I think it is vastly underconsidering the calories, but it gives you a confidence interval. I need to be able to tell it what things to take into account in particular with the dish, because I can edit the quantities if I scroll of every ingredient, but maybe I should indicate it with what oil was it cooked with, etc.
As for the cost: The request to the API consumed 1.737 Tokens. I used Sonnet 4.5 for these evaluations. Maybe Haiku could have worked, but I wanted to try a better model to get a grip on how the API worked.

So, with Sonnet 4.5 priced at 3.75$/MTok, the cost of the request was: 0.006 USD. If you use it for 4 meals a day, 30 days a month, the cost per person should be 0.78 USD per month per user!
Conclusions and way forwards.
The main thing is that the app worked! I just need to:
- Switch the database to a local Postgres one
- Add a way to re-reach the API to correct the food log with modifications
- Redo the layout to make it more pretty
- Investigate how to deploy it! I wanted to try Vercel, but that's for next version.
So I hope that my journey to weight loss can inspire someone to develop faster and better apps. I could build a useful (for me) tool, anyone can do it.