stale-gate-janitor

stale-gate-janitor is a skill for Claude Code, Codex from dailyaiagents-cpu/dailyai-os. It costs 41 tokens per session (1,442 once invoked), scanned A, original, MIT.

An automated housekeeping task for approval-gate records. It expires pending gates past their expiration time and archives gates older than seven days.

In plain words
What is it for?
Run it daily to maintain the data/approval-gates/ folder and send a Telegram message only when something changes. It also supports a dry-run mode for checking what would happen.
Why use it?
Old or resolved records can clutter audits and force people to filter out irrelevant entries manually.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: built for openclaw.

Good fit Run it daily to maintain the data/approval-gates/ folder and send a Telegram message only when something changes. It also supports a dry-run mode for checking what would happen.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dailyaiagents-cpu/dailyai-os/stale-gate-janitor
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.

Any agent
npx skills add dailyaiagents-cpu/dailyai-os --skill stale-gate-janitor
Clone the repo
git clone --depth 1 https://github.com/dailyaiagents-cpu/dailyai-os

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for stale-gate-janitor

README.md
[![agentmods](https://agentmods.dev/badge/skills/dailyaiagents-cpu/dailyai-os/stale-gate-janitor/github.svg)](https://agentmods.dev/skills/dailyaiagents-cpu/dailyai-os/stale-gate-janitor)
Your own site
<a href="https://agentmods.dev/skills/dailyaiagents-cpu/dailyai-os/stale-gate-janitor"><img src="https://agentmods.dev/badge/skills/dailyaiagents-cpu/dailyai-os/stale-gate-janitor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for stale-gate-janitor

Your own site · 80×15
<a href="https://agentmods.dev/skills/dailyaiagents-cpu/dailyai-os/stale-gate-janitor"><img src="https://agentmods.dev/badge/skills/dailyaiagents-cpu/dailyai-os/stale-gate-janitor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,442 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00041 $0.01442
Opus 5 $0.00020 $0.00721
Sonnet 5 $0.00008 $0.00288
Haiku 4.5 $0.00004 $0.00144

Measured 12d ago against content hash 855428eb9967, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

stale-gate-janitor scanned grade A with 1 finding 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 12d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (run.sh, test.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

subprocess.run(args, timeout=10, check=False)
skills/stale-gate-janitor/SKILL.md · 146 lines

How it starts

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

stale-gate-janitor

Why this exists

Active approval-gates dir accumulates resolved + expired entries that audit reads (hermes-daily-audit) keep tripping on. Today's session (2026-04-29) caught 3 stale Apr-28 gates Cooper had to mentally filter every morning. This skill removes that toll.

Inputs

{
  "dry_run": false,
  "test_telegram_chat_id": null
}

dry_run=true walks + classifies but doesn't write or Telegram.

test_telegram_chat_id (env var TELEGRAM_TEST_CHAT_ID) — if set, sends summary to that chat instead of Cooper's. Used by self-test to avoid pinging Cooper during ops verification.

Procedure

Step 1 — Walk + classify

import json, datetime, pathlib, shutil, os, subprocess
home = pathlib.Path.home()
repo = home / "Dev/daily-ai-agent-os"
gates_dir = repo / "data/approval-gates"
archive_root = gates_dir / "archive"
now = datetime.datetime.now(datetime.timezone.utc)

if not gates_dir.exists():
    print("[stale-gate-janitor] no approval-gates dir; nothing to do")
    raise SystemExit(0)

ARCHIVE_AGE_S = 7 * 86400

expired_now = []
archived = []
errors = []

# Pass 1 — expire stale-pending gates
for p in gates_dir.glob("*.json"):
    if p.parent != gates_dir:  # skip archive subdir
        continue
    try:
        g = json.loads(p.read_text())
    except Exception as e:
        errors.append({"file": str(p), "err": f"parse: {e}"})
        continue
    if g.get("status") in (None, "pending", "open"):
        ex_iso = g.get("expires_at", "")
        try:
            ex_dt = datetime.datetime.fromisoformat(ex_iso.replace("Z", "+00:00")) if ex_iso else None
        except Exception:
            ex_dt = None
        if ex_dt and ex_dt < now:
            g["status"] = "expired"
            g["expired_at"] = now.isoformat()
            g["expired_by"] = "stale-gate-janitor"
            p.write_text(json.dumps(g, indent=2))
            expired_now.append(g.get("id", p.stem))

# Pass 2 — archive >7d files
for p in list(gates_dir.glob("*.json")):
    if p.parent != gates_dir:
        continue
    age_s = now.timestamp() - p.stat().st_mtime
    if age_s <= ARCHIVE_AGE_S:
        continue
    try:
        g = json.loads(p.read_text())
        ts = g.get("created_at") or g.get("expires_at") or now.isoformat()
        ym = ts[:7]  # YYYY-MM
    except Exception:
        ym = now.strftime("%Y-%m")
    bucket = archive_root / ym
    bucket.mkdir(parents=True, exist_ok=True)
    target = bucket / p.name
    shutil.move(str(p), str(target))
    archived.append(p.stem)

print(f"[stale-gate-janitor] expired={len(expired_now)} archived={len(archived)} errors={len(errors)}")

Read the full file on GitHub · 146 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 146 lines · 41 tokens per session scan A 855428eb9967

Subscribe to this mod's changes

stale-gate-janitor is a skill published in the GitHub repository dailyaiagents-cpu/dailyai-os (0 stars, last pushed 4mo ago), licensed MIT. It adds 41 tokens to every session and 1,442 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

recipe-create-meet-space

Create a Google Meet meeting space and share the join link.

googleworkspace/cli · 18 tokens

atmos-config

Atmos root configuration: atmos.yaml discovery, precedence, deep merging, basepath, imports, minimal bootstrap, and routing to narrower Atmos skills.

cloudposse/atmos · 31 tokens

workthreads

SpecStory Workthreads - a weekly work-thread rollup across a team's repos from SpecStory coding histories (any agent - Claude Code, Codex, Cursor, Gemini, and more). It groups the window's sessions into threads of work per project and labels each new / open / recently closed, so a lead sees what shipped, what is still…

specstoryai/getspecstory · 126 tokens

story-readiness

Validate that a story file is implementation-ready. Checks for embedded GDD requirements, ADR references, engine notes, clear acceptance criteria, and no open design questions. Produces READY / NEEDS WORK / BLOCKED verdict with specific gaps. Use when user says 'is this story ready', 'can I start on this story', 'is…

Donchitos/Claude-Code-Game-Studios · 77 tokens

projects

List all managed projects with status, branch, open PRs, and open issue counts — portfolio-level view.

me2resh/apexyard · 24 tokens

magpie-security-issue-import-from-md

Open one or more tracking issues from a markdown file containing a batch of security findings. Each finding becomes one tracker landing in the Needs triage board column. The file itself is the full report — there is no inbound reporter to reply to and no PR to inspect.

apache/magpie · 73 tokens