Skip to content
Back to skills

Token Saver Memory Dedup

ASecurity

Helper skill that deduplicates token-saver memory records before persistence.

  • 40 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 6, 2026
developmentjavascriptrustgojavashelltesting

Security analysis

A100/100

Pro scans all 10 files and shows the line behind each finding

Scanned September 6, 2026

npx -y skills add oimiragieo/agent-studio --skill token-saver-memory-dedup --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Token Saver Memory Dedup?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Token Saver Memory Dedup
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/oimiragieo-token-saver-memory-dedup/badge)](https://www.skillsdirectory.com/skills/oimiragieo-token-saver-memory-dedup)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: token-saver-memory-dedup
description: Helper skill that deduplicates token-saver memory records before persistence.
version: 1.0.0
category: helper
invoked_by: skill
user_invocable: false
agents: [context-compressor]
tags: [token-saver, memory, deduplication, helper]
source: builtin
trust_score: 100
provenance_sha: 323f2531fc4f8d0f
---

# Token Saver Memory Dedup

Deduplicates memory records against existing memory files to prevent duplicate entries.

## Purpose

This skill provides the `deduplicateAgainstMemory` function that filters out memory records that already exist in the memory system:

- Compares incoming records against `patterns.json` and `gotchas.json`
- Case-insensitive matching for deduplication
- Returns statistics about total, kept, and filtered records
- Handles corrupt or missing memory files gracefully

## Usage

```javascript
const { deduplicateAgainstMemory } = require('./scripts/main.cjs');

const records = {
  patterns: [{ text: 'Use canonical transitions', timestamp: '2026-01-01', source: 'test' }],
  gotchas: [{ text: 'Avoid shell: true for spawn', timestamp: '2026-01-01', source: 'test' }],
  issues: [],
  decisions: [],
};

const { dedupedRecords, stats } = deduplicateAgainstMemory(records, '/path/to/memory');
```

## When to Use

- Before persisting memory records to avoid duplicates
- As part of the token-saver-context-compression workflow
- When syncing memory records between sessions

## Implementation

Re-exports the `deduplicateAgainstMemory` function from `token-saver-context-compression` for module resolution and testing purposes.

Files in this skill

  • SKILL.md1.6 KB
  • commands/token-saver-memory-dedup.md124 B
  • hooks/post-execute.cjs201 B
  • hooks/pre-execute.cjs307 B
  • references/research-requirements.md704 B
  • rules/token-saver-memory-dedup.md380 B
  • schemas/input.schema.json470 B
  • schemas/output.schema.json319 B
  • scripts/main.cjs1.1 KB
  • templates/implementation-template.md314 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…