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 shennawardana23/skillme --skill agent-drift-and-re-anchoringgit clone --depth 1 https://github.com/shennawardana23/skillmeWrote 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/shennawardana23/skillme/agent-drift-and-re-anchoring)<a href="https://agentmods.dev/skills/shennawardana23/skillme/agent-drift-and-re-anchoring"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/agent-drift-and-re-anchoring/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/shennawardana23/skillme/agent-drift-and-re-anchoring"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/agent-drift-and-re-anchoring.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.00082 | $0.01520 |
| Opus 5.5 | $0.00033 | $0.00608 |
| Sonnet 5.5 | $0.00016 | $0.00304 |
| Haiku 4.5 | $0.00008 | $0.00152 |
Grade A, and why
agent-drift-and-re-anchoring 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 3mo 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 — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent Drift and Re-Anchoring
A long-running agent doesn't fail by crashing — it fails by quietly stopping being the agent that started the task. This skill names the distinct ways that happens ("drift" is the general term; there is no single fix) and the specific, mechanism-matched mitigation for each, because a bigger context window delays when drift becomes visible but does not prevent any of it.
The six drift mechanisms
Treat these as distinct failure modes needing distinct fixes, not one generic "agent got confused" bucket:
- Goal drift — the agent starts pursuing a plausible-sounding side quest instead of the original ask (asked to fix a flaky test, ends up refactoring the whole test harness). Mitigation: periodic re-anchoring — explicitly restate the original objective and check the current action against it, especially before a costly or hard-to-reverse step.
- Context drift — reasoning quality on unchanged information degrades as the context window fills; content near the middle/start becomes functionally less influential even though it's still technically present. Mitigation: active compression/pruning of stale detail, not just relying on a larger window to "fit everything."
- Stale context — the agent reasons over an old snapshot of something that has since changed (a file edited by another process, a decision the user has since revised) without re-checking it's still current. Mitigation: externalize state that can change into a durable, re-readable store, and re-read it at decision points rather than trusting a cached mental model of it.
- Role drift — a system prompt or initial framing loses influence over a long conversation as more recent content dominates. Mitigation: periodically re-inject the system prompt (or a condensed form of it) near the end of a long context, not just at the start.
- Tool-use drift — the agent over-relies on one tool whose output is immediately visible and self-reinforcing (e.g., calling search repeatedly) while under-using a tool whose output is easy to lose track of once buried in history. Mitigation: explicit per-tool call budgets, and summarizing a tool's output before continuing rather than letting raw output pile up unprocessed.
- Plan decay — the agent keeps executing steps of a plan that an earlier step has already made obsolete, because the plan was treated as a fixed script rather than a living hypothesis. Mitigation: treat the plan as mutable state re-evaluated at checkpoints, not as an execution log to be marched through regardless of what's been learned since.
What ships with it
1 file 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.
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.
- 3mo ago First seen · 125 lines · 82 tokens per session scan A 2ba4daf00e34
agent-drift-and-re-anchoring is a skill published in the GitHub repository shennawardana23/skillme (4 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 82 tokens to every session and 1,520 once invoked, about $0.0003 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-08-31.
agent-drift-and-re-anchoring compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| agent-drift-and-re-anchoringshennawardana23/skillme | Skill | 4 | 1mo ago | Apache-2.0 | A | 82 | Claude Code |
| persistent-memorymthines/agent-skills | Skill | 22 | yesterday | MIT | A | 67 | Claude Code |
| opencode-memorycarson2222/skills | Skill | 111 | 5mo ago | Apache-2.0 | A | 77 | Claude Code, Codex |
| project-scaffoldHadi99K/AGENT_SKILLS | Skill | 3 | 1mo ago | MIT | A | 75 | Claude Code, Codex |
| team-summaryHadi99K/AGENT_SKILLS | Skill | 3 | 1mo ago | MIT | A | 57 | Claude Code, Codex |
| learn-from-experienceshibing624/skills | Skill | 20 | 4mo ago | none | A | 123 | Claude Code, Codex |
| memory-integrationtroykelly/claude-skills | Skill | 12 | 10mo ago | none | A | 28 | Claude Code |