Docs

Frugal Self-Improvement

Agenties can learn from repeated friction, but the improvement loop must be cheaper than the problem it fixes. The current system is passive, local, heuristic-first, and on demand. It does not run a model in the background to analyze itself.

How it works

StepMechanismCost
1Append cheap local signals to JSONL.One file append.
2Aggregate by signal type and key.One bounded local file read.
3Return exactly one improvement proposal.No model call.
4Annotate deterministic ROI.Pure function.
5User decides whether to create real work.Human approval.

Signal file

Path
.agenties/self-improvement/signals.jsonl

Signals are append-only records. They are intentionally small so Agenties can track patterns without loading session history or large logs.

Signal typeExample keyMeaning
repeated_taskdeployThe same task keeps coming back.
firewall_blockbatched-workA spawn firewall block happened repeatedly.
high_cost_tasklarge-reviewA task type tends to cost too much.
permission_repeatBashThe same permission prompt appears often.
journal_missingtask-closeA significant task finished without durable context.
test_failure_patternchatIpc.testThe same test failure pattern repeats.

MCP tools

ToolUse
append_improvement_signalAppend one signal. Pure local write; no model invocation.
suggest_improvementRead aggregated candidates and return one ROI-annotated proposal.
Example
append_improvement_signal({
  type: "firewall_block",
  key: "batched-work",
  metadata: { source: "spawn-firewall" }
})

suggest_improvement({ windowDays: 7, threshold: 3 })

Proposal shape

suggest_improvement returns at most one proposal: the highest-count candidate above threshold.

Response shape
{
  deferred: false,
  proposal: {
    type: "firewall_block",
    key: "batched-work",
    count: 3,
    text: "Recurring firewall block...",
    estimatedCost: "low",
    expectedBenefit: "Fewer spawn blocks...",
    risk: "low",
    validation: "Confirm no firewall blocks for this key in the next 7 days.",
    estimatedTokenSaving: 1500,
    estimatedRoiUsd: null,
    estimatedRoiNote: "USD ROI omitted - token price varies by model and plan."
  }
}

Budget gate

The tool gates on activeRunPressure, not old historical usage. Historical project usage is advisory only for this tool because the analysis is a zero-model local file read.

Warning:Do not block local self-improvement reads because the project has old high cache-read history. Block only when there is real active pressure, such as too many recent spawns or running agents.

Automatic signals

Agenties currently emits firewall_block signals from spawn firewall paths:

KeyMeaning
prompt-too-largeThe prompt exceeded the spawn firewall size guard.
batched-workThe task looked like multiple issues combined.
usage-highThe usage firewall blocked a spawn.