maintain

An automated maintenance workflow that finds bugs from project logs or GitHub issues and creates pull requests to address them. A pull request is a proposed code change for review before it is merged.

In plain words
What is it for?
Use it to search Kubernetes, Google Cloud, or Sentry logs for errors, file GitHub issues, and process existing issues into proposed fixes.
Why use it?
It turns reported errors into a queue of repair work, reducing the need to inspect logs and coordinate each fix manually. It can run once or on a schedule.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/randomittin/heimdall/maintain
Clone the repo
git clone --depth 1 https://github.com/randomittin/heimdall
Per session 40 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 841 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00040 $0.00841
Opus 5 $0.00020 $0.00420
Sonnet 5 $0.00008 $0.00168
Haiku 4.5 $0.00004 $0.00084

Measured 2d ago against content hash 2d3cd6f71e63, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

maintain scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/maintain.md · 81 lines

How it starts

The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Maintain — Automated Bug Detection & Fix Pipeline

Two-phase maintenance: seek then fix.

Usage

/hmd:maintain — run once (seek + fix) /hmd:maintain seek — only find bugs, raise issues /hmd:maintain fix — only fix existing issues /hmd:maintain auto — schedule recurring via /schedule

Connectors — GitHub issues are the DEFAULT trigger

The queue is connector-fed. GitHub issues are the default connector and trigger: issue_queue already normalizes them into the queue that the fixer drains. Every other source is an additional connector that files issues into the SAME queue — they do not replace GitHub issues, they feed alongside them:

  • GitHub issues (default) — a human or a bot opens an issue; it is normalized and picked by the loop. This is the primary path.
  • k8s / gcloud / Sentry logs (additional) — the seeker pulls logs, finds errors, and FILES them as issues into the same queue (labeled bug,seeker). The log-based seeker is one pluggable connector, not the only entry point.

Connectors stay pluggable: adding or removing a log source never orphans the others, and the fixer path downstream is identical regardless of which connector filed the issue.

Phase 1: Seek

Spawn a seeker agent (the log-based connector) to:

  1. Pull logs from Kubernetes pods (or local logs, docker, cloud)
  2. Analyze for errors, crashes, anomalies
  3. Deduplicate by stack trace signature
  4. File GitHub issues with full context (labeled "bug,seeker") — into the same queue that human-opened GitHub issues land in.

Phase 2: Fix

Spawn a fixer agent to:

  1. Pick open issues from the queue (default connector: gh issue list --label bug --state open, normalized by issue_queue).
  2. For each issue (oldest first):
    • Create a heimdall/* fix branch from main
    • Implement the minimal fix
    • Attest (SI-2) — evidence = recorded real exits; a proof-less fix is un-PR-able
    • Open the PR ONLY via bin/heimdall-issue-pr open (routed through the scoped bot token) — the fixer NEVER pushes a branch or opens a PR by hand, NEVER pushes to main, NEVER merges. Autonomy ends at PR-open; a human merges.
  3. Move to next issue

Read the full file on GitHub · 81 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 81 lines · 40 tokens per session scan A 2d3cd6f71e63

Subscribe to this mod's changes

maintain is a command published in the GitHub repository randomittin/heimdall (5 stars, last pushed 12d ago), licensed MIT. It adds 40 tokens to every session and 841 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.