memory-layer

memory-layer is a skill for Claude Code, Codex from GeneGulanesJr/LaPis. It costs 29 tokens per session (4,092 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,092 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.04092
Opus 5.5 $0.00012 $0.01637
Sonnet 5.5 $0.00006 $0.00818
Haiku 4.5 $0.00003 $0.00409

Measured 16d ago against content hash a8b34db6b573, 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 16d 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 · 275 lines

How it starts

The opening of the file, as written. The whole thing — 275 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 · 275 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. 16d ago Changed · -2 lines a8b34db6b573
  2. 1mo ago Changed ef44a180bc52
  3. 3mo 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 (59 stars, last pushed 6d ago), licensed MIT. It adds 29 tokens to every session and 4,092 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

memory-layer compared with skills from other repositories

memory-layer next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
memory-layerGeneGulanesJr/LaPisSkill596d agoMITA29Claude Code, Codex
my-pi-sqlitespences10/my-piSkill147todayMITA24Claude Code, Codex
brainctlTSchonleber/brainctlSkill781mo agoMITA45Claude Code, Codex
deployment-verification-agentgvkhosla/compound-engineering-piSkill522mo agoMITA40Claude Code, Codex
data-migration-expertgvkhosla/compound-engineering-piSkill522mo agoMITA40Claude Code, Codex
data-migrations-reviewergvkhosla/compound-engineering-piSkill522mo agoMITA55Claude Code, Codex
schema-drift-detectorgvkhosla/compound-engineering-piSkill522mo agoMITA33Claude Code, Codex