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 2mo 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.
- 2mo 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 (10 stars, last pushed 1mo ago), 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.
safe-history-rewrite compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| safe-history-rewritetoejough/engram | Skill | 10 | 1mo ago | Apache-2.0 | A | 58 | Claude Code, Codex |
| releasematrixorigin/memoria | Skill | 631 | 8d ago | Apache-2.0 | A | 27 | Claude Code, Codex |
| githubMemTensor/memmy-agent | Skill | 2.4k | today | MIT | A | 44 | Claude Code, Codex |
| Codexagentic-in/elephant-agent | Skill | 586 | 3mo ago | none | A | 31 | Claude Code, Codex |
| GitHub Issuesagentic-in/elephant-agent | Skill | 586 | 3mo ago | none | A | 32 | Claude Code, Codex |
| GitHub PR Workflowagentic-in/elephant-agent | Skill | 586 | 3mo ago | none | A | 29 | Claude Code, Codex |
| GitHub Repo Managementagentic-in/elephant-agent | Skill | 586 | 3mo ago | none | A | 23 | Claude Code, Codex |