Inspiration
I paid for four subscriptions I meant to cancel: a video service, a PDF website with a 3-day trial, a music app, and a game subscription. Each time I had seen the email or the reminder. I just thought "later" and missed it, once by a single day. Reminder apps tell you the date. Nobody follows up after you say "later".
What it does
Contract Duty (契約当番, after the duty rosters in Japanese classrooms) is an agent that keeps chasing until you decide.
- Paste a subscription email. The AI separates a real contract (free trial, auto-renewal) from a marketing email, and reads the service, price, end date and who bills you (Apple, Google Play or the company itself). You check the fields before anything is saved.
- It plans the reminders. First reminder depends on the contract (30+ day trial: 14 days before; 8–29 days: 7 days before; 3-day trial: next morning; monthly: 3 days before; yearly: 30 days before), then 3 days before, the day before and the last day. Apple asks you to cancel at least 24 hours before renewal, so Apple-billed plans get their last reminder 2 days before the end, and the cancel steps point to Apple's subscription screen, not the app's website.
- Reply like a human. "I'll deal with it this weekend", "not sure yet", "how do I cancel?", "keep it". It moves the next reminder to the day you named. Said on a Sunday, "this weekend" means next Saturday. If that day is after your last safe day, it pulls the reminder earlier and tells you why. If you don't reply, it asks again the next morning.
- "I cancelled" is not enough. It asks for the cancellation email or the text on the subscription screen. A screen that still says "Renews …" is rejected; only real proof closes the case.
- It keeps a record, and uses it. Every decision is saved: what you stopped, what got charged, how many times you said "later", and why you cancelled or kept it. If the record shows you usually say "later" twice or more, or a charge slipped through, new contracts get their first reminder 3 days earlier.
- You stay in charge. It never cancels anything or logs in anywhere.
A demo clock (Next day / Next reminder) lets you go through a whole trial in a minute.
Why an agent, not a reminder app
A reminder app does one task: notify on a date. This agent is given a goal (you decide before the money moves) and works toward it over days:
- It acts without being asked: no reply means it asks again the next morning.
- It re-plans: "this weekend" becomes Saturday, and a plan later than your last safe day is pulled earlier, with the reason.
- It checks the result instead of trusting a claim.
- It learns from your record and starts earlier with you next time.
- It knows when to stop, and every step is logged with the rule behind it.
How we built it
- A Cloudflare Worker with three endpoints: read an email, read a reply, verify proof. Each calls Llama 3.3 70B on Workers AI with a JSON schema, so the model returns fields only.
- The agent's decisions live in plain JavaScript (
agent.js): every reminder date, the last safe day, and when to stop. The model reads; code decides; the person chooses. Every step is written to an Agent log beside the chat. - Vanilla HTML/CSS/JS frontend, data kept in the browser's localStorage.
- 19 automated tests for the date rules and state changes.
Challenges we ran into
- Dates. Language models are unreliable at calendar math, so the model only labels the phrase ("weekend", "next Monday", "in 3 days") and code turns it into a date.
- Free trial vs monthly. The model first labeled a "1-month free trial, then ¥1,080/month" email as "monthly", which would have sent the first reminder far too late. I fixed the prompt and added a check in the app.
- When to stop. The tempting design is to stop when the user says "done". I made proof required, because "I'll check later" is exactly how the charge happens.
Accomplishments that we're proud of
The full loop works on the live site: email → ledger → reminder → free-text reply → rescheduled reminder → "I cancelled" → fake proof rejected → real proof accepted → case closed.
What we learned
Splitting the job made the agent both more flexible and more predictable than giving everything to the model: AI reads, code decides, the person chooses.
What's next for Contract Duty
- The record is the part no reminder app has: why people actually quit or keep a subscription. With permission, and only the reason plus the type of service (never names or emails), it could be pooled into anonymous statistics. Not built yet.
- Email forwarding so contracts arrive automatically, and push/LINE notifications instead of the demo clock.
- Testing with friends who forgot to cancel, to see whether the follow-ups actually change what they do.
AI disclosure and timing
The idea came from my own experience, and I pitched the concept (without any code) at an AI-agent ideathon on Nov 6, 2026. All code was written on Nov 15, 2026, during IceHacks. Most of the code was written with Claude Code (an AI coding assistant) under my direction. I set the rules (reminder timing, Apple's 24h rule, proof before closing, the weekend rule) and tested the flows. At runtime, the app uses Llama 3.3 70B on Cloudflare Workers AI.
Built With
- cloudflare-workers
- css3
- html5
- javascript
- llama
- workers-ai