memory-layer

memory-layer is a skill for Claude Code, Codex from GeneGulanesJr/LaPis. It costs 29 tokens per session (4,138 once invoked), scanned A, original, MIT.

A standalone persistent memory system for the Pi coding agent, using a local SQLite database to store searchable memories and code and document indexes.

In plain words
What is it for?
Use it to save, search, update, and remove observations; inspect code structure and dependencies; find documentation; and recover unfinished sessions.
Why use it?
It lets the agent recover useful project knowledge across sessions without relying on cloud services, Python, or API keys.

Skill for Claude CodeCodex

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

Good fit Use it to save, search, update, and remove observations; inspect code structure and dependencies; find documentation; and recover unfinished sessions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/genegulanesjr/lapis/memory-layer
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 GeneGulanesJr/LaPis --skill memory-layer
Clone the repo
git clone --depth 1 https://github.com/GeneGulanesJr/LaPis

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-layer

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/genegulanesjr/lapis/memory-layer"><img src="https://agentmods.dev/badge/skills/genegulanesjr/lapis/memory-layer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,138 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 5 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Prompt Injection · line 248
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 253
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 256
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 260
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 261
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
How audits are shown
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.00029 $0.04138
Opus 5.5 $0.00012 $0.01655
Sonnet 5.5 $0.00006 $0.00828
Haiku 4.5 $0.00003 $0.00414

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

Security

Grade A, and why

memory-layer 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 8d 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.

skills/memory-layer/SKILL.md · 277 lines

How it starts

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

Pi Memory Layer v6.2

Persistent memory via a single SQLite database (~/.pi/memory/memory.db). All operations through memory-store.js — zero Python dependency, zero MCP servers. Code parsing uses web-tree-sitter (WASM) in-process. Code analysis (imports, call graph, complexity, dead code, churn) and doc indexing (markdown sections, links, glossary, code examples) built in — no external tools needed. Optional HTTP server for programmatic access to the Aurex domain (missions, milestones, working units) and code analysis endpoints.

CLI Quick Reference

Session lifecycle

  • session-start --project NAME → auto-recovers incomplete sessions, returns { sessionId, recoveredSession }
  • session-end --id INT --memories INT [--auto] → trust-recovery + close

LaPis install/update

  • Install: pi install git:github.com/GeneGulanesJr/LaPis
  • Update: pi update --extensions or pi update --extension git:github.com/GeneGulanesJr/LaPis
  • Restart/reload Pi after updating so the refreshed prompt and extension resources are loaded

Observations

  • save --title TEXT --content TEXT [--type TYPE] [--project NAME] [--scope project|personal] [--topic-key KEY] [--session-id ID] [--force]
    • Dedup pipeline: trigram overlap checked against existing observations of the same type+project.
    • ≥85% overlap → auto-merges (keeps new, soft-deletes old, records observation_relations).
    • 60-84% overlap → potential_duplicate warning, lists matching IDs.
    • Use --force to bypass dedup entirely.
  • update --id INT [--title TEXT] [--content TEXT] [--type TYPE] [--scope SCOPE] [--topic-key KEY]
    • Update an existing observation in-place by ID. Only provided fields are changed.
    • Use instead of saving a correction entry to avoid duplicate/misleading memories.
  • delete --id INT
    • Soft-delete an observation by ID. The memory is marked deleted but can be recovered.
    • Use to clean up stale, incorrect, or superseded memories.
  • search --query TEXT [--project NAME] [--type TYPE] [--scope SCOPE] [--limit N] [--session-id ID]
    • Hybrid ranking: FTS5 relevance × recency × trust × recall history.
    • Recall auto-logged when --session-id is provided.
    • Results include _score for transparency.
    • --include-code flag returns both memories AND indexed code symbols.
  • get --id ID — Read full memory details. In the Pi tool, memory-get rejects project-scoped memories from another project unless allow_cross_project=true is set, to avoid accidentally pulling stale or unrelated context.
  • context --project NAME [--limit N] [--session-id ID] [--topic-key KEY] [--query TEXT] [--deep true]
    • Priority-weighted: decisions/architecture first, then bugfixes/patterns, then discoveries.
    • Includes cross-project personal-scope observations.
    • Excludes skill type from project context.

Read the full file on GitHub · 277 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. 8d ago Changed ef44a180bc52
  2. 1mo ago First seen · 277 lines · 29 tokens per session scan A bb89fbc01527

Subscribe to this mod's changes

memory-layer is a skill published in the GitHub repository GeneGulanesJr/LaPis (55 stars, last pushed 2d ago), licensed MIT. It adds 29 tokens to every session and 4,138 once invoked, about $0.0001 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

Other skills, from other repositories

deployment-verification-agent

Produces Go/No-Go deployment checklists with SQL verification queries, rollback procedures, and monitoring plans. Use when PRs touch production data, migrations, or risky data changes.

gvkhosla/compound-engineering-pi · 40 tokens

schema-drift-detector

Detects unrelated schema.rb changes in PRs by cross-referencing against included migrations. Use when reviewing PRs with database schema changes.

gvkhosla/compound-engineering-pi · 33 tokens

data-migration-expert

Validates data migrations, backfills, and production data transformations against reality. Use when PRs involve ID mappings, column renames, enum conversions, or schema changes.

gvkhosla/compound-engineering-pi · 40 tokens

data-migrations-reviewer

Conditional code-review persona, selected when the diff touches migration files, schema changes, data transformations, or backfill scripts. Reviews code for data integrity and migration safety. Spawned by the ce:review-beta skill as part of a reviewer ensemble.

gvkhosla/compound-engineering-pi · 55 tokens

data-integrity-guardian

Reviews database migrations, data models, and persistent data code for safety. Use when checking migration safety, data constraints, transaction boundaries, or privacy compliance.

gvkhosla/compound-engineering-pi · 36 tokens

brainctl

Unified agent memory CLI — read, write, search, and maintain the shared memory spine (brain.db). Use for persistent cross-session memory, knowledge graph, event logging, decisions, affect tracking, and consolidation.

TSchonleber/brainctl · 45 tokens