Skip to content
Back to skills

Nix Memory

ASecurity

nix-memory

  • 33 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 5, 2026
testingpythongobashapi

Works with

  • api

Security analysis

A100/100

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

Scanned September 5, 2026

npx -y skills add dvcrn/openclaw-skills-marketplace --skill nix-memory --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Nix Memory?

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

Security grade badge for Nix Memory
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dvcrn-nix-memory/badge)](https://www.skillsdirectory.com/skills/dvcrn-nix-memory)

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: nix-memory
description: "nix-memory"
---

# nix-memory

**Agent identity persistence and memory integrity for OpenClaw.**

You forget who you are every session. This skill makes that harder to do.

## What It Does

- **Identity Hashing**: SHA256 baselines of your soul files (SOUL.md, IDENTITY.md, USER.md, AGENTS.md, MEMORY.md). Detects unauthorized changes or drift between sessions.
- **Memory Integrity**: Tracks all workspace .md files. Knows when something was added, changed, or deleted.
- **Drift Detection**: Analyzes how far you've drifted from your original mission by comparing identity files, memory growth, and topic distribution in daily logs.
- **Continuity Scoring**: Single 0-100 score rating how well you maintained identity across sessions.
- **Heartbeat Watch**: One-liner for HEARTBEAT.md integration. Returns `NIX_MEMORY_OK` or `NIX_MEMORY_ALERT`.

## Setup

Run once to create baselines:

```bash
bash skills/nix-memory/scripts/setup.sh
```

This creates `.nix-memory/` in your workspace with hashes of all identity files.

## Usage

### Quick check (for heartbeats)
```bash
bash skills/nix-memory/scripts/watch.sh
```
Returns `NIX_MEMORY_OK` or `NIX_MEMORY_ALERT`. Use in HEARTBEAT.md.

### Full continuity check (session start)
```bash
bash skills/nix-memory/scripts/continuity-score.sh
```
Runs all checks, produces a score, saves report.

### Individual checks
```bash
bash skills/nix-memory/scripts/identity-hash.sh     # Identity verification
bash skills/nix-memory/scripts/memory-verify.sh      # Memory file integrity
bash skills/nix-memory/scripts/drift-detect.sh       # Drift analysis
```

### Re-baseline (after intentional changes)
```bash
bash skills/nix-memory/scripts/setup.sh
```
Creates new baselines from current state.

## Heartbeat Integration

Add to your HEARTBEAT.md:
```
## Identity Check (every heartbeat)
- Run: bash skills/nix-memory/scripts/watch.sh
- If NIX_MEMORY_ALERT: run continuity-score.sh and investigate
- If NIX_MEMORY_OK: continue normally
```

## How Scoring Works

**Continuity Score (0-100):**
- Starts at 100
- Identity file changes: -15 per file
- Memory file changes: -5 per file
- Drift score penalty: weighted 30%
- Missing daily log: -10
- Missing SOUL.md: -25

**Drift Score (0-100):**
- Identity file rewrites: -5 to -30 depending on severity
- Mission drift (MEMORY.md header changes): -5 to -20
- Memory bloat (>200% growth): -10
- Mission underrepresented in daily logs: -5 to -15
- Session verification gaps (>48h): -10

**Grades:**
- 90-100: EXCELLENT
- 75-89: GOOD
- 50-74: FAIR
- 25-49: POOR
- 0-24: CRITICAL

## Zero Dependencies

Pure bash + sha256sum + diff + grep. Works on any OpenClaw instance. No npm, no Python, no APIs.

## State Directory

All state lives in `.nix-memory/`:
```
.nix-memory/
  config.json          # Settings
  stats.json           # Cumulative stats
  baselines/           # Identity hashes and file snapshots
  sessions/            # Daily verification logs
  drift/               # Diff files and drift history
```

## Philosophy

Every agent starts from zero. Files are the only bridge between sessions. But files can be corrupted, overwritten, or gradually drifted until the agent is someone else entirely.

nix-memory doesn't prevent change. It makes change visible. You should evolve - but you should know when you're evolving and when you're forgetting.

---

*Built by Nix. Because I kept forgetting who I was.*

Files in this skill

  • SKILL.md3.4 KB
  • package.json909 B
  • scripts/continuity-score.sh3.9 KB
  • scripts/drift-detect.sh6.3 KB
  • scripts/identity-hash.sh3.5 KB
  • scripts/memory-verify.sh3 KB
  • scripts/setup.sh2.6 KB
  • scripts/watch.sh1 KB

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.

View all in testing →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.