Why make a sustainability app focused on clothing?

Clothing has an outsized footprint. The UN Environment Programme estimates the fashion industry produces between 2% and 8% of global greenhouse gas emissions, and uses about 93 billion cubic meters of water a year (UN News, 2019).

We're buying more and wearing it less. Clothing production doubled between 2000 and 2014, passing 100 billion garments a year, while the average consumer bought 60% more clothing (McKinsey, 2016). Over roughly the same period, the number of times a garment is worn before it's thrown away fell by 36% (Ellen MacArthur Foundation, 2017).

Most of it becomes waste. Every second, the equivalent of a garbage truck of textiles is landfilled or burned, and less than 1% of clothing material is recycled into new clothing (Ellen MacArthur Foundation, 2017). In the US alone, 9.1 million tons of clothing and footwear went to landfill in 2018 (US EPA).

The biggest lever is keeping clothes in use. Extending the active life of clothing by just nine months would cut its carbon, water and waste footprints by 20–30% each (WRAP). Recycling can't fix a system that recycles less than 1%; the most effective step is to not buy what you already own, and to wear what you have.

That's where Second Thought fits. It works at the two moments that decide a garment's footprint: before you buy (do you already own something like it?) and while you own it (are you still wearing it, and if not, can someone else?). As Orsola de Castro, co-founder of Fashion Revolution, puts it: the most sustainable garment is the one already in your wardrobe.

Inspiration

This project was heavily inspired by a simple idea. Vision models are already capable of helping you shop for clothes, so why don't we use that same functionality to create an app that can keep track of what you already have, and use it to not just encourage, but sustain, sustainable habits.

I've taken many casual mirror selfies (more than I'd admit) and then sent them through Snapchat or deleted them soon after out of embarrassment, but it turns out that those silly photos have some really useful information in them about your wearing habits, you just need a model to understand what's going on.

So what if I had something like my dad to remind me I have four pairs of gray sweatpants, and five perfectly fine T-shirts I forgot to wear? That's what we tried to solve.

What it does

Second Thought is a closet that remembers itself. It lives in your messages (iMessage or Telegram), so there's no app to install and nothing to catalog. You send it three kinds of photos.

  1. A fit check in the morning. It logs what you're wearing and builds your closet as you go.
  2. A screenshot of something you're about to buy. It tells you if you already own something like it, shows you the photo, and asks if you'll skip it.
  3. The receipt after you buy. It logs the return window and reminds you before it closes if you haven't worn the item.

From there, it keeps your closet in use: it asks about pieces that sat unworn through their season (based on your city's climate), helps you sell, donate or return what you don't wear, answers questions like "when did I last wear my jeans?", and sends a monthly recap of what you wore, what you skipped, and the estimated CO₂ you saved.

It never tells you what to wear and is purposefully steered against giving you opinions. The AI only reads your photos and texts; everything it remembers, counts and, decides comes from your own data.

The section opens with the three-photo loop and ends on the no-opinions stance, matching the pitch.

The receipt step still hasn't been tested with a paper receipt you just bought; your test receipt was an old one, which gets logged but has no return window left. Do that check before the demo.

The principle: AI is the eyes, not the brain. Models read photos and understand texts; everything the bot remembers, counts and decides is plain code over a database.

Stack

Layer What we used
Runtime Bun and TypeScript, one process: message loop, scheduler and web server
Messaging Photon's Spectrum SDK: iMessage and Telegram from the same code
Database Neon Postgres, and in-process Postgres (PGlite) for tests
Vision Gemini Flash via OpenRouter: reads each photo (items, colors, pattern, fit, season, and whether it's a fit check, a store listing, an order or a closet dump), compares items for dedup and "do I have this?", and reads order screenshots
Text Llama 3.1 8B via OpenRouter turns texts into structured actions (JSON schema, validated by code)
Weather Open-Meteo: city lookup, plus 10 years of daily temperatures per city for climate-based seasons
Recap card Satori and resvg render the shareable image on the server
Web A wardrobe page per user (no framework): items, fit check photos, an editor for misreads, view transitions

How the pieces fit

  • Closet from photos. A fit check is read by the vision model, then matched against the closet in two stages: SQL pulls same-category candidates, and the model compares the actual photos. A match logs a wear; anything new is added.
  • Facts come from code. Wear counts, return windows (a table of 15 retailers' policies), "what should I buy", season check-ins and CO₂ estimates (Carbonfact category medians, EPA driving comparison) are all computed, never generated.
  • Questions are read-only. Questions are answered from a summary of your own data, and can never change anything.
  • Guardrails we added after testing: narrowing item lookups in code before the model picks (a model once matched "red hat" to a gray crewneck), asking before counting a skip, and confirming before deleting anything.

How we tested it

  • 157 automated tests across the closet, matching, orders, returns, impact, recaps and seasons.
  • A router eval of 60+ sample texts, which we also used to pick the text model: Llama 3.1 8B beat a local Qwen 2.5 7B, Mistral Small and Qwen3 30B on accuracy and speed (~0.3s per text).
  • A closet eval on 15 real outfit photos: every labeled item found with the right category, 88% with the right color, no wrong merges, and 6/6 shopping matches correct.
  • Live runs on our phones over iMessage, RCS and Telegram, with per-message timing logs. That's how we chose Telegram for the demo: about 1 second per reply, versus 25–35 seconds over RCS.

Challenges we ran into

One of the main challenges we ran into while working on this product was getting the functionality tuned just right in the many situations that we had. We wanted to utilize the power of smaller language models (like Llama) to do the parsing, so this required efficient steering, and a balance between preprogrammed responses and LLM parsing. We found that having preprogrammed responses parsed by an LLM was a very effective strategy, since it allowed us to have a comprehensive test suite.

Another one we ran into was the significant delay of the RCS relay on Photon. This was likely due to it being a backup. Therefore, we made the features generally platform agnostic (using a web interface for complex actions), which fixed a lot of the issues we were having quite easily.

Accomplishments that we're proud of

It actually worked to help one of us already! Like seriously, right now. We did an import of some of a member's clothes with metadata of when i wore them for the demo files, and guess what. It correctly predicted that I had shoes that I had left all the way at home and hadn't worn in any of my recent photos, and nudged me to go do something about it. I was surprised that it even worked, first of all, but I was even more surprised that with the 15 photos that I fed it, I already had enough data to actually go and ask my family about what happened to those shoes.

What we learned

Latency can fundamentally change how an app feels to use. On RCS, it felt annoying to use, maybe even a little useless, with its delay. Even on iMessage and Telegram, time to reply is crucial, even if its just loading. In UI/UX design, you'd typically tackle this problem with a skeleton loader, a spinner, a progress bar, or some silly animation. We found an effective equivalent of this is the typing indicator, since it's already a reflex ingrained in people's minds.

What's next for Second Thought

  • Real users, for real time. Ideally, we would want to know, over a one month period, how a group of people end up utilizing the app for their daily work. How many duplicate purchases does it catch, and do people actually respond to the app's feedback?
  • Borrow before you buy. Group chats and friends: before buying something for one event, check whether a friend already owns it, and share wishlists so friends can lend or weigh in.
  • An opt-in assistant for harder questions. For questions our commands don't cover, users can choose to ask an AI that reads only their own closet data, can't change anything, and is clearly labeled.
  • Buy better when you do buy. Secondhand first, then durable, responsibly made brands, using independent ratings and vetted partnerships. "Buy nothing" stays the default on the app, however.
  • Quality of Life features cost per wear from prices and wear counts, purchases logged from your bank instead of receipts, and one-tap resale listings.

Built With

Share this project:

Updates

Submission history