How They Use AI  |  Newest

<< Home  |  Tech

0.41% of quota used for 24/7 background runs

AreaTech
AI usedAnthropic Claude
Sourcer/AI_Agents
Posted2026-11-16

The move

Implement a local file-locked JSON queue to batch agent triggers and skip unchanged polls with a shell hash check.

Steps

  1. Create a local JSON queue to store pending, leased, and completed tasks.
  2. Add a shell hash check to skip polling if no changes are detected.
  3. Persist one-shot follow-up tasks to disk so the agent can exit to zero tokens.
  4. Pass a 48-hour log of recent alerts to the agent to prevent duplicate notifications.
  5. Run background scripts in a sandboxed environment to restrict access to sensitive files.

Prompt for your AI

You are an autonomous agent. Before executing any task, check the [file_path] for new events. If no changes are detected via hash check, exit immediately. If a task is triggered, process it, log the result in [log_file], and if a follow-up is needed, save the timestamp to [queue_file] before exiting.

What happened

The user built an always-on AI agent system that avoids constant token consumption by using a local file-locked queue instead of continuous polling. By implementing a 15-second shell hash check, the system skips unchanged events at zero tokens. This architecture allowed the agent to run 24/7 while consuming only 0.41% of the total quota across 1.51B tokens.

Watch out

Improperly configured file locks can lead to race conditions. Ensure your sandbox environment correctly restricts access to sensitive SSH keys and private directories.

Give it to your agent

Read https://howtheyuse.ai/p/0-41-of-quota-used-for-24-7-background-runs.md and help me do this.

Sources



Last updated November 26, 2026.