memory-informed-refactor

memory-informed-refactor is a skill for Claude Code, Codex from major7apps/pensyve. It costs 42 tokens per session (1,037 once invoked), scanned A, original, Apache-2.0.

A pre-refactor briefing helper that loads related past decisions, failures, and pitfalls from Pensyve's stored memory. Refactoring means changing code structure without changing its intended behaviour.

In plain words
What is it for?
Use it before refactoring a module to review relevant project history.
Why use it?
It helps the agent check earlier lessons before making changes, reducing the chance of repeating known mistakes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it before refactoring a module to review relevant project history.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/major7apps/pensyve/memory-informed-refactor
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 major7apps/pensyve --skill memory-informed-refactor
Clone the repo
git clone --depth 1 https://github.com/major7apps/pensyve

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 memory-informed-refactor

README.md
[![agentmods](https://agentmods.dev/badge/skills/major7apps/pensyve/memory-informed-refactor/github.svg)](https://agentmods.dev/skills/major7apps/pensyve/memory-informed-refactor)
Your own site
<a href="https://agentmods.dev/skills/major7apps/pensyve/memory-informed-refactor"><img src="https://agentmods.dev/badge/skills/major7apps/pensyve/memory-informed-refactor/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 memory-informed-refactor

Your own site · 80×15
<a href="https://agentmods.dev/skills/major7apps/pensyve/memory-informed-refactor"><img src="https://agentmods.dev/badge/skills/major7apps/pensyve/memory-informed-refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,037 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00042 $0.01037
Opus 5.5 $0.00017 $0.00415
Sonnet 5.5 $0.00008 $0.00207
Haiku 4.5 $0.00004 $0.00104

Measured 2mo ago against content hash a57dd8182b1d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

memory-informed-refactor 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.

integrations/antigravity-plugin/skills/memory-informed-refactor/SKILL.md · 104 lines

How it starts

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

Memory-Informed Refactor

Load historical context from Pensyve memory before starting a refactor. Surfaces past decisions, failed approaches, known pitfalls, and relevant patterns to avoid repeating mistakes.

When to Use

Invoke before refactoring any module, file, or component. Provides a structured briefing from memory so you start with full context.

Instructions

Step 1: Query Memory for Context

Normalize the target to a lowercase-hyphenated entity and pass it as entity to every query. Run multiple pensyve_recall queries to gather comprehensive context about the target within the shared recall budget:

  1. Direct matches: pensyve_recall with query "<target>" (limit: 5)
  2. Refactor history: pensyve_recall with query "<target> refactor" (limit: 5)
  3. Past failures: pensyve_recall with query "<target> failed" (limit: 5)
  4. Past failures (alternate): pensyve_recall with query "<target> error" (limit: 5)
  5. Design decisions: pensyve_recall with query "<target> decided" (limit: 5)
  6. Dependencies: pensyve_recall with query "<target> depends" (limit: 5)

Step 2: Inspect the Entity

Call pensyve_inspect with entity: "<target>" and limit: 20 to get up to 20 memories for that entity. The tool has no pagination, so do not describe this sample as a complete inventory.

Step 3: Compile Briefing

Organize the findings into a structured briefing. Deduplicate results that appear across multiple queries.

Refactor Briefing: <target>

Known Facts

  • List of semantic memories about the target, ordered by confidence
  • Include confidence scores

Past Decisions

  • Architecture or design decisions related to this target
  • Include the reasoning if available ("chose X because Y")

Past Outcomes

  • Previous refactoring attempts and their results
  • Bug fixes and their root causes
  • What worked and what did not

Known Pitfalls

  • Failed approaches (flagged clearly so they are not repeated)
  • Edge cases or gotchas discovered in past sessions
  • Dependencies that may be affected

Procedural Knowledge

  • Action-outcome patterns with reliability scores
  • Proven workflows related to this target

Recommendations

  • Synthesize the above into 2-5 actionable recommendations
  • Flag any conflicts or contradictions in the memory

Memory Gaps

  • Areas where no relevant memories exist
  • Suggest what to watch for during the refactor

Read the full file on GitHub · 104 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. 2mo ago Changed a57dd8182b1d
  2. 3mo ago First seen · 104 lines · 42 tokens per session scan A 06bd1a8610fc

Subscribe to this mod's changes

memory-informed-refactor is a skill published in the GitHub repository major7apps/pensyve (101 stars, last pushed today), licensed Apache-2.0. It adds 42 tokens to every session and 1,037 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-08-30.

Related

memory-informed-refactor compared with skills from other repositories

memory-informed-refactor next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
memory-informed-refactormajor7apps/pensyveSkill101todayApache-2.0A42Claude Code, Codex
lemmalogJordyZomer/lemmalogSkill3552mo agoMITA105Claude Code, Codex
ori-memoryaayoawoyemi/Ori-MnemosSkill3412mo agoApache-2.0A54Claude Code, Codex
engrama-onboardscops/engramaSkill926d agoApache-2.0A104Claude Code, Codex
read-handoffsedg-l/engram-mcpSkill201mo agoApache-2.0A36Claude Code
handoffedg-l/engram-mcpSkill201mo agoApache-2.0A47Claude Code
brain-writeinite-ai/inite-brain-serviceSkill44yesterdayAGPL-3.0A97Claude Code