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.
npx skills add toejough/engram --skill safe-history-rewritegit clone --depth 1 https://github.com/toejough/engramWrote 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.
[](https://agentmods.dev/skills/toejough/engram/safe-history-rewrite)<a href="https://agentmods.dev/skills/toejough/engram/safe-history-rewrite"><img src="https://agentmods.dev/badge/skills/toejough/engram/safe-history-rewrite/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.
<a href="https://agentmods.dev/skills/toejough/engram/safe-history-rewrite"><img src="https://agentmods.dev/badge/skills/toejough/engram/safe-history-rewrite.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00058 | $0.01237 |
| Opus 5.5 | $0.00023 | $0.00495 |
| Sonnet 5.5 | $0.00012 | $0.00247 |
| Haiku 4.5 | $0.00006 | $0.00124 |
Grade A, and why
safe-history-rewrite 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 28d 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.
How it starts
The opening of the file, as written. The whole thing — 59 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Safe Git History Rewrite and Force-Push
Overview
History rewrites with git filter-branch (or similar tools that rewrite all refs) are powerful for removing sensitive data but dangerous if you lose the ability to recover the pre-rewrite state or if you force-push against stale tracking refs. This skill prevents three critical failures: the backup branch getting swept up and lost, force-push failing with outdated tracking refs, and sensitive data becoming unrecoverable.
When to Use
Before rewriting git history with git filter-branch or any all-refs history rewrite, especially when:
- Keeping a safety backup branch for recovery
- Removing sensitive data (API keys, passwords, tokens)
- Force-pushing the result to a remote
- Multiple branches need to be rewritten at once
Procedure
-
Record the pre-rewrite tip outside the ref space. Before starting any rewrite, capture the current tip of each branch you're about to rewrite as a bare SHA (not a branch name). Alternatively, rely on
refs/original/(created by filter-branch) plus the reflog for recovery — but do NOT rely on a plain backup branch, since the rewrite can sweep it. -
Scope the rewrite to explicit refs, not
-- --all. A backup branch is not a safe exception to this rule —git filter-branch ... -- --allrewrites every ref it can see, backup branches included. Specify the exact refs you want rewritten (e.g.,-- main dev-feature) or use-- --allonly if you intend to rewrite the backup branch too (and understand it will be gone after). -
Run the history rewrite. Execute your filter-branch command with the appropriate filters (e.g.,
--index-filter,--tree-filter, or--subdirectory-filter) to achieve the rewrite goal. -
Before force-pushing, refresh local tracking refs with
git fetch. The rewrite also rewrites your local remote-tracking refs (likeorigin/mainin.git/refs/remotes/origin/). These now point to the old, pre-rewrite commits. A stale tracking ref will cause--force-with-leaseto fail, thinking the remote has changed. Rungit fetch originto refreshrefs/remotes/origin/*with the real remote state.
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.
- 28d ago First seen · 59 lines · 58 tokens per session scan A 74175bf4a2f1
safe-history-rewrite is a skill published in the GitHub repository toejough/engram (8 stars, last pushed yesterday), licensed Apache-2.0. It adds 58 tokens to every session and 1,237 once invoked, about $0.0002 per session on Opus 5.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-09-21.
Other skills, from other repositories
release
Cut a Memoria release. Version bump, CHANGELOG, CI workflows, Docker image. Use when publishing a new version.
github
Interact with GitHub using the gh CLI. Use gh issue, gh pr, gh run, and gh api for issues, PRs, CI runs, and advanced queries.
Codex
Guides operator-owned delegation to Codex when the task fits a bounded coding lane, review pass, or worktree-isolated implementation track.
GitHub Issues
Triage GitHub issues, extract the real ask, and connect each issue to the relevant files, tests, or release surface before acting.
GitHub PR Workflow
Move cleanly through branch, diff, review, validation, and PR update steps without losing scope or repository-native workflow.
GitHub Repo Management
Inspect repository metadata, branches, permissions, and operational state before changing settings or branch structure.