When you ask an AI chatbot to build a Connected Superpower app, the code it writes decides how much Hive Usage your app burns through each month. (If you're new to the Hive Usage meter, see Hive Superpowers Usage and quotas.) The chatbot will happily write a chatty, save-on-every-keystroke version of your app if you don't ask for something better. The good news is that one or two extra sentences in your prompt go a long way.
Below are the six biggest savers. Pick the ones that apply to what your app actually does, and paste them into your AI chatbot's instructions along with the rest of your app idea.
1. Save when the user finishes, not on every change
Hive Usage counts every time your app writes data. An app that saves on every key press in a text box, every drag of a slider, or every tap of a button can blast through hundreds of writes per student in a single session. Saving only when a student hits Submit, or finishes typing, is just as useful and far cheaper.
Do not call THive.save on every keystroke, slider drag, color pick, or input event. Save only on submit, on blur, or via an explicit Save action. If progressive saving is needed, debounce to at most once every 2 to 3 seconds.
For any app with sliders, text fields, or live inputs, this is usually the single biggest saving on the page.
2. Skip the save if nothing actually changed
Sometimes your app re-saves the same data without realizing it, because a screen refresh or moving between fields fires the save again. A two-line check stops that, and your students never notice the difference.
Before every THive.save(key, value) call, compare the new value to the most recently saved one using JSON.stringify. If they match, skip the save.
Apps that auto-save on screen changes often quietly do this hundreds of times a day. The guard makes that go away.
3. Pause when the tab is hidden
A Connected App left open in a background tab, or on a teacher's second monitor, keeps quietly checking for live updates the whole time. Teacher Hive automatically pauses after 15 minutes of inactivity, but stopping the moment the tab is hidden is even better.
Pause all THive.load(key, callback) subscriptions when document.visibilityState becomes 'hidden', and resume them when it returns to 'visible'. Use a single visibility listener inside THive.onReady.
This saves a lot of background reads on apps that get left open on a smartboard or in a parked browser tab.
4. Keep related data in one place
Each save counts the same whether the data is tiny or close to a megabyte. So saving five related things as one bundle is one write, while saving them as five separate items is five writes. And for anything that many students all write to, putting everyone under one shared key with each student's name as a field is dramatically cheaper than giving each student their own key.
When several related fields change together (game state, current turn, timer), save them as one object under one key, not as separate THive.save calls. For shared per-student data, use ONE key with student names as fields via THive.merge. Never use one key per student.
A class of 30 students writing into one shared key uses about 30 writes per round. The same class writing to 30 separate keys can use many times that.
5. Never upload the same file twice
File uploads carry far more weight in your Hive Usage than ordinary saves, because Teacher Hive has to actually move the file into storage. If your app accidentally re-uploads the same image on a screen refresh, undo, or back button, that one file can cost as much as many normal saves.
After THive.upload(key, file) succeeds, store the returned URL in app state and reuse it. Do not call THive.upload again for the same file on re-render, refresh, or undo. If you need a stable key per file, hash its name, size, and lastModified.
File uploads are the single most expensive ordinary action in the meter. One stray re-upload loop will eat through a month's quota faster than anything else.
6. Use AI sparingly, and remember its answers
This one only applies if your app uses the AI Superpower. AI calls are the most expensive action of all, because every call goes out to a paid AI provider on your behalf. Calling AI only when the student explicitly submits, and remembering the answer if the same question comes up again, makes a huge difference.
Only call THive.ai.chat or THive.ai.generateImage when the student explicitly submits. Cache the response keyed by the exact prompt string. If the same prompt is asked again in this session, return the cached response instead of calling the AI again.
Without this, an AI-heavy app can use up its monthly budget far sooner than the rest of your apps combined.
A few things people guess but aren't true
Using THive.saveLocal will save Hive Usage. It won't. saveLocal stores data per device instead of sharing it between students, but each call still counts as a write. Pick saveLocal because of what it does (per-device storage), not to save usage.
Bigger saves cost more. Not really. One save is one save, no matter how big the data is (up to almost a megabyte). Bundling small saves into one larger save almost always wins.
I should ask for more Hive Usage instead. If you're hitting your limit early in the month, the tips above will almost always fix it before you need to ask for more.
After you change your prompt
Edit your app with the new instructions, then watch the meter on My Settings for a few days. Most apps drop into a comfortable range within one cycle.