1. The problem

    Groceries and money lived apart, and Kroger's API can't read a cart back, remove an item or check out.

  2. How I used agentic coding

    Claude Code built the Kroger server around those limits: dry runs, a log of every add, caps no prompt can change. Both agents run in Claude.

  3. The outcome

    Every Monday an email rates our money green, yellow or red, with one to three moves. Grocery lists start from the week's sales.

How the household agents work

Two agents: a money check-in that runs every Monday, and a grocery planner that runs when I ask, through my own Kroger server.

Sources

  • Era Context: balances, transactions, a copy of the plan
  • Monarch: when its connection works
  • Gmail: payment confirmations and refunds

Reads, from the sources to the money check-in

  • Reads, from the sources to the money check-in

Money check-in

A scheduled task, Mondays about 8 AM

Newsletter, from the money check-in to me

email, in-app, push

  • Newsletter, email, in-app, push, from the money check-in to me

Me

My phone

I ask, from me to the grocery planner

Our OK, from me to the grocery planner

  • I ask, from me to the grocery planner
  • Our OK, from me to the grocery planner

Grocery planner

Claude in a project chat, with a runbook and a food profile

Server check, from the grocery planner to the Kroger Agent

Sale scan, from the grocery planner to the Kroger Agent

Dry run, from the grocery planner to the Kroger Agent

Add to cart, from the grocery planner to the Kroger Agent

Instacart

Occasional bulk runs; no prices for Claude

Off to the side of the grocery planner.

  • Server check, from the grocery planner to the Kroger Agent
  • Sale scan, from the grocery planner to the Kroger Agent
  • Dry run, from the grocery planner to the Kroger Agent
  • Add to cart, from the grocery planner to the Kroger Agent

Kroger Agent

My MCP server on Cloudflare

One search per staple, from the Kroger Agent to Kroger

One batched add, from the Kroger Agent to Kroger

  • One search per staple, from the Kroger Agent to Kroger
  • One batched add, from the Kroger Agent to Kroger

Kroger

Products, store prices, the cart

Instacart

Occasional bulk runs; no prices for Claude

Off to the side of the grocery planner.

What we spent in Era, from the sources to the grocery planner

What we spent in Era, from the sources to the grocery planner

Weekly allowance: designed, not wired yet, from the money check-in to the grocery planner

Weekly allowance: designed, not wired yet, from the money check-in to the grocery planner

Step 1 of 7

Monday, about 8 AM

The schedule wakes the money check-in. It reads balances, transactions and the plan through Era, Monarch when it works, and Gmail.

Step 2 of 7

The newsletter

Five areas rated green, yellow or red, and one to three moves, by email and push. It can suggest a plan change, never make one.

Step 3 of 7

When I ask

Groceries start in a project chat. The planner checks the server and asks what's at home.

Step 4 of 7

Sale scan

One search per staple at our store, deepest discounts first, each with its unit price. Every price seen is logged once a day to D1.

Step 5 of 7

Dry run, then our OK

The list is priced without touching the cart. Nothing goes further until we approve it.

Step 6 of 7

The real cart

One batched add, every line in the cart log. I check out myself in the Kroger app.

Step 7 of 7

Closing the week

The planner checks what we spent in Era against the allowance. The hand-off from the money side is designed, not wired yet.

From my household write-up and the Kroger Agent repo, as of October 12, 2026

How the household agents work

Two agents: a money check-in that runs every Monday, and a grocery planner that runs when I ask, through my own Kroger server.

Sources

  • Era Context: balances, transactions, a copy of the plan
  • Monarch: when its connection works
  • Gmail: payment confirmations and refunds

Reads, from the sources to the money check-in

  • Reads, from the sources to the money check-in

Money check-in

A scheduled task, Mondays about 8 AM

Newsletter, from the money check-in to me

email, in-app, push

  • Newsletter, email, in-app, push, from the money check-in to me

Me

My phone

I ask, from me to the grocery planner

Our OK, from me to the grocery planner

  • I ask, from me to the grocery planner
  • Our OK, from me to the grocery planner

Grocery planner

Claude in a project chat, with a runbook and a food profile

Server check, from the grocery planner to the Kroger Agent

Sale scan, from the grocery planner to the Kroger Agent

Dry run, from the grocery planner to the Kroger Agent

Add to cart, from the grocery planner to the Kroger Agent

Instacart

Occasional bulk runs; no prices for Claude

Off to the side of the grocery planner.

  • Server check, from the grocery planner to the Kroger Agent
  • Sale scan, from the grocery planner to the Kroger Agent
  • Dry run, from the grocery planner to the Kroger Agent
  • Add to cart, from the grocery planner to the Kroger Agent

Kroger Agent

My MCP server on Cloudflare

One search per staple, from the Kroger Agent to Kroger

One batched add, from the Kroger Agent to Kroger

  • One search per staple, from the Kroger Agent to Kroger
  • One batched add, from the Kroger Agent to Kroger

Kroger

Products, store prices, the cart

Instacart

Occasional bulk runs; no prices for Claude

Off to the side of the grocery planner.

What we spent in Era, from the sources to the grocery planner

What we spent in Era, from the sources to the grocery planner

Weekly allowance: designed, not wired yet, from the money check-in to the grocery planner

Weekly allowance: designed, not wired yet, from the money check-in to the grocery planner

From my household write-up and the Kroger Agent repo, as of October 12, 2026
  1. Step 1

    Monday, about 8 AM

    The schedule wakes the money check-in. It reads balances, transactions and the plan through Era, Monarch when it works, and Gmail.

  2. Step 2

    The newsletter

    Five areas rated green, yellow or red, and one to three moves, by email and push. It can suggest a plan change, never make one.

  3. Step 3

    When I ask

    Groceries start in a project chat. The planner checks the server and asks what's at home.

  4. Step 4

    Sale scan

    One search per staple at our store, deepest discounts first, each with its unit price. Every price seen is logged once a day to D1.

  5. Step 5

    Dry run, then our OK

    The list is priced without touching the cart. Nothing goes further until we approve it.

  6. Step 6

    The real cart

    One batched add, every line in the cart log. I check out myself in the Kroger app.

  7. Step 7

    Closing the week

    The planner checks what we spent in Era against the allowance. The hand-off from the money side is designed, not wired yet.

The money side

The Monday newsletter

It lands every Monday at about 8 AM.

Rebuilt from the real email's layout, with demo content.

The email, top to bottom

  1. 1The bottom line: the week in one sentence, colored by the worst area.
  2. 2Five areas, each green, yellow or red, with the reason.
  3. 3One to three moves. Suggestions only: it never changes the plan.
  4. 4Progress in percent. The real email has the numbers; this page doesn't.
  5. 5Watch list, money in motion and what's coming up, plus a monthly and a quarterly review.

1The bottom line: the week in one sentence, colored by the worst area.

The grocery side

A grocery week, start to cart

A demo plays on its own.

Kroger cart0 items$0.00
GroceriesGrocery planner

I ask for four dinners this week.

Tap anything in the app to take over.
Kroger cart0 items

Sample products and prices

Empty. Lines land here only after a dry run and our OK.

Estimated total
$0.00
Savings
$0.00

The API can't check out. I do that in the Kroger app.

Cart log

The server's record, since the cart can't be read back.

WeekItemQtyPrice

Nothing logged for 2026-W42 yet.

The cart after the demo's one batched add.

Kroger cart14 items

Sample products and prices

  1. Chicken thighs3 lb pack, Sale was $8.97×1$5.97
  2. Sweet potatoes3 lb bag, Sale was $4.49×1$2.97
  3. Carrots2 lb bag×1$1.89
  4. Ground turkey1 lb, Sale was $5.49×2$7.98
  5. Black beans15 oz can, Sale was $1.19×3$2.67
  6. Diced tomatoes28 oz can×1$1.99
  7. Bell peppers3 count×1$3.49
  8. Salmon fillets1 lb, Sale was $11.99×1$8.99
  9. Green beans12 oz bag×2$4.98
  10. Corn tortillas30 count×1$2.79
Estimated total
$43.72
Savings
$11.42

The API can't check out. I do that in the Kroger app.

Cart log2026-W42: Open

The server's record, since the cart can't be read back.

WeekItemQtyPrice
2026-W42Chicken thighs1$5.97
2026-W42Sweet potatoes1$2.97
2026-W42Carrots1$1.89
2026-W42Ground turkey2$7.98
2026-W42Black beans3$2.67
2026-W42Diced tomatoes1$1.99
2026-W42Bell peppers1$3.49
2026-W42Salmon fillets1$8.99
2026-W42Green beans2$4.98
2026-W42Corn tortillas1$2.79

What the demo shows

  1. I ask for four dinners this week.
  2. The planner checks the server, then scans 22 staples for sales, sorted by unit price.
  3. Four dinners built around the best sales.
  4. The list. One item is flagged: it can't be confirmed safe from its listing.
  5. A dry run prices the list against the week's allowance. Nothing touches the cart.
  6. I approve.
  7. One batched add. Every line lands in the cart log.
  8. I check out myself in the Kroger app.

With JavaScript and motion on, the planner plays this itself, and you can take over.

GuardrailsAs of October 12, 2026

The Kroger server

On the server, in code

Cart writes
On
A switch only I can flip
Per line
10
Of any one item
Per call
40 lines
In one add
Checkout
None
Kroger's API has no checkout, payment or coupons
Retries
Never
A cart add is sent once. If unsure, check the Kroger app.

The money check-in

In the task's instructions, not enforced by the platform

Access
Reads only
Era, Monarch when it works, and Gmail
Email
One, to me
Plus an in-app message and a push
Writes
Notes to Era only
Plan changes go out as proposals
Moves money
Never
No task moves money

The scheduled tasks run with automatic approval and have more connectors than they need. Tightening that is on the list.

11
Kroger server tools
6
scheduled money tasks

As of October 2026

What's next

Where Household management agents goes from here

A week of money check-ins so far, and one test item sent all the way to a real cart.

The plan, as of October 12, 2026

  1. 1Let the money check-in set each week's grocery allowance for the planner.
  2. 2Run the first full weekly grocery order, then put it on a schedule.
  3. 3Add nutrition data, so meal plans can do real macro math.
  4. 4Enforce the scheduled tasks' limits, not only write them down.

Deep dive

Three charts, with sources

A day's Kroger API budget

Every call is counted before it leaves, and my server stops at 95% of each daily limit.

  • Products: search and prices10,000 callsStops at 9,500
  • Cart: adds5,000 callsStops at 4,750
  • Identity: sign-in check5,000 callsStops at 4,750
  • Locations: store lookup1,600 callsStops at 1,520
  • Tokens: no published limit1,000 callsMy own cap, against a runaway refresh loop
  • One full sale scan22 calls22 starter terms, one product call each
As a table
ValueNote
Products: search and prices10,000 callsStops at 9,500
Cart: adds5,000 callsStops at 4,750
Identity: sign-in check5,000 callsStops at 4,750
Locations: store lookup1,600 callsStops at 1,520
Tokens: no published limit1,000 callsMy own cap, against a runaway refresh loop
One full sale scan22 calls22 starter terms, one product call each
  • Kroger resets each count 24 hours after the window's first call, not at midnight, so every endpoint keeps its own window.

  • The counts live in Workers KV, which has no atomic increment, so two sessions at once can undercount. The 5% margin covers that.

  • A 429 from Kroger is remembered until that window resets, so the server refuses the call itself instead of asking again.

    Habit: enforce rules in code, not only in prompts

As of October 12, 2026. Chart: kroger-agent src/kroger/api.ts (DAILY_LIMITS), src/kroger/ratelimit.ts (STOP_AT), docs/KROGER-API.md (Kroger's FAQ) and src/tools/products.ts (STARTER_SALE_TERMS). Facts: docs/KROGER-API.md, Rate limits; kroger-agent src/kroger/ratelimit.ts, markLimited.

How long things live

Kroger sets the tokens' lifetimes. I set the rest: sign-in links 15 minutes, searches 6 hours, stores a week.

  • Sign-in link15 minMy choice
  • Access token30 minSet by Kroger
  • Search results6 hMy choice
  • Store list1 weekMy choice
  • Refresh token6 monthsSet by Kroger: about 6 months, single use
As a table
ValueNote
Sign-in link15 minMy choice
Access token30 minSet by Kroger
Search results6 hMy choice
Store list1 weekMy choice
Refresh token6 monthsSet by Kroger: about 6 months, single use
  • Kroger's refresh token is single use: each refresh returns a new one, stored at once. A refused refresh re-reads storage once, since another session usually just refreshed.

  • Tokens count as expired a minute early, so one never dies in the middle of a request.

  • Prices for a cart add are never cached: the server looks up each item's current price right before it adds anything.

As of October 12, 2026. Chart: kroger-agent src/kroger/auth.ts and client.ts; docs/KROGER-API.md, OAuth (Kroger's lifetimes, confirmed); docs/DESIGN.md, Caching and limits. Facts: kroger-agent src/kroger/auth.ts, EXPIRY_MARGIN_MS; kroger-agent src/tools/cart.ts; src/kroger/client.ts.

How it judges a price

Kroger has no price history, so my server records every price it sees and compares today's with the median.

Below the medianTypicalAbove the median

A sample price, against a $4.00 median: $3.69. Below the median. 5% or more under.

Drag the marker to try another value.

  • $3.20 to $3.80: Below the median. 5% or more under
  • $3.80 to $4.20: Typical. Within 5% either way
  • $4.20 to $4.80: Above the median. 5% or more over
As a table
FromToNote
Below the median$3.20$3.805% or more under
Typical$3.80$4.20Within 5% either way
Above the median$4.20$4.805% or more over
  • The lowest price seen is called best seen instead, but only after two prices and if the price has ever moved.

  • Sizes are free text. The parser's tests read 58 of them into pounds, fluid ounces or counts and refuse 14: a wrong unit price would sort first.

  • One known miss: bakery muffins tagged 4 ct / 15 oz weigh 15 oz in all, so their unit price reads four times too low.

As of October 12, 2026. Chart: kroger-agent src/tools/products.ts, price_history (BELOW_MEDIAN and ABOVE_MEDIAN); the prices are samples. Facts: kroger-agent test/units.test.ts; kroger-agent src/kroger/units.ts; docs/KROGER-API.md.

Sources

Built with TypeScript, Cloudflare Workers, D1, KV, MCP, Scheduled tasks. The owner, October 12, 2026: the household agents write-up from the household project; The owner, October 12, 2026; kroger-agent docs/KROGER-API.md, add to cart and checkout; kroger-agent README.md, Guardrails; migrations/0001_init.sql; src/tools/cart.ts; the owner, October 12, 2026; The owner, October 12, 2026: the household agents write-up; kroger-agent README.md, sale_scan; kroger-agent src/tools/registry.ts; kroger-agent src/kroger/api.ts (DAILY_LIMITS), src/kroger/ratelimit.ts (STOP_AT), docs/KROGER-API.md (Kroger's FAQ) and src/tools/products.ts (STARTER_SALE_TERMS); kroger-agent src/kroger/ratelimit.ts; docs/KROGER-API.md, Rate limits; kroger-agent src/kroger/ratelimit.ts; kroger-agent src/kroger/ratelimit.ts, markLimited; kroger-agent src/kroger/auth.ts and client.ts; docs/KROGER-API.md, OAuth (Kroger's lifetimes, confirmed); docs/DESIGN.md, Caching and limits; kroger-agent src/kroger/auth.ts; kroger-agent src/kroger/auth.ts, EXPIRY_MARGIN_MS; kroger-agent src/tools/cart.ts; src/kroger/client.ts; kroger-agent src/tools/products.ts, price_history (BELOW_MEDIAN and ABOVE_MEDIAN); the prices are samples; kroger-agent src/tools/products.ts, price_history; kroger-agent test/units.test.ts; src/kroger/units.ts; kroger-agent src/kroger/units.ts; docs/KROGER-API.md.

Where it fits

  • From Side quests: The Kroger server copies my fantasy agent's shape: its own sign-in, guardrails in config, dry runs first.