trailmem

trailmem is a skill for Claude Code, Codex from amitnexTech/trailmem. It costs 69 tokens per session (1,237 once invoked), scanned A, original, MIT.

A guide for Trailmem, a local memory system that stores linked information in SQLite and provides tools for saving and recalling it.

In plain words
What is it for?
Use it when querying, displaying, editing, archiving, or storing persistent project memories with Trailmem.
Why use it?
It explains when to load existing project knowledge, how to scope memories, and what durable information to save between sessions.

Skill for Claude CodeCodex

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

Good fit Use it when querying, displaying, editing, archiving, or storing persistent project memories with Trailmem.

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

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 trailmem

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/amitnextech/trailmem/skill"><img src="https://agentmods.dev/badge/skills/amitnextech/trailmem/skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,237 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.00069 $0.01237
Opus 5.5 $0.00028 $0.00495
Sonnet 5.5 $0.00014 $0.00247
Haiku 4.5 $0.00007 $0.00124

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

Security

Grade A, and why

trailmem 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 1mo 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.

trailmem/skill/SKILL.md · 94 lines

How it starts

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

trailmem — tool usage

Local-first, graph-linked persistent memory (MCP server, SQLite). Six tools. This skill is the usage reference — never read trailmem's source code to figure out a parameter; everything an agent needs is here or in the tool docstrings.

Session workflow

  1. Start: if a trailmem briefing (pinned rules / recent activity block) is already in your context, do NOT call trailmem_welcome — a hook injected it. Otherwise call it once.
  2. During: query before assuming (trailmem_query), read in full with trailmem_show before editing.
  3. End: store this session's durable decisions/lessons/tasks with trailmem_store. Never store filler or session noise.

Parameter rules (the ones agents get wrong)

  • project — OMIT it. The server auto-fills the absolute path from its working directory. Pass "global" only for cross-project memories (tool preferences, workflow rules). Pass an absolute path only to target a different project. Bare names like "myproject" are rejected.
  • agent_type — OMIT it. Attribution comes from TRAILMEM_AGENT_TYPE pinned in the host's MCP config entry. Pass it explicitly only if store rejects with "agent_type could not be determined".
  • session_id — OMIT it on integrated hosts. For an unsupported host, set TRAILMEM_SESSION_ID or pass its stable session ID explicitly. Never use a PID; without a real ID TrailMem intentionally runs stateless.
  • session_context — host adapters may inject this versioned object into every TrailMem call. Do not construct or modify it manually. When present it is authoritative for agent, session, and project; legacy identity arguments cannot override it.
  • code_files / doc_files — BOTH are REQUIRED, comma-separated paths: code_files = source/config files the memory touches, doc_files = docs/spec pages. Pass the literal 'none' when the memory genuinely touches no files of that kind — an omitted field is rejected. List the files you actually edited this session; don't lazily write 'none'.
  • content — English only. 50+ chars. Detailed prose beats terse bullets.
  • title — 3–60 chars.
  • event_type — required on store:
    • decision — rules, tool choices, structure, enforced behavior
    • lesson — bugs/mistakes learned (include root cause)
    • error_pattern — things that failed and how they fail
    • task — pending work
    • constraint — hard rules (auto-surfaced in every welcome — use sparingly)
    • user_preference — personal choices only. Singleton: exactly one active global record exists — never store a new one, merge into the existing record via trailmem_edit (a new store returns blocked_singleton with the existing id; force=true does not bypass it)
    • session_summary, memory — summaries / plain facts

Read the full file on GitHub · 94 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. 1mo ago First seen · 94 lines · 69 tokens per session scan A adcdb4b09e44

Subscribe to this mod's changes

trailmem is a skill published in the GitHub repository amitnexTech/trailmem (1 stars, last pushed 2mo ago), licensed MIT. It adds 69 tokens to every session and 1,237 once invoked, about $0.0003 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-31.

Related

Other skills, from other repositories

shodh-memory

Persistent memory system for AI agents. Use this skill to remember context across conversations, recall relevant information, and build long-term knowledge. Activate when you need to store decisions, learnings, errors, or context that should persist beyond the current session.

varun29ankuS/shodh-memory · 53 tokens

engraphis-memory

Give the agent durable, scoped, explainable memory across sessions and repositories through the Engraphis MCP tools. Use when you learn a convention, decision, bug cause/fix, or user preference worth keeping; when prior context would help before you answer or act (to avoid re-asking or re-deriving); when asked "why is…

Coding-Dev-Tools/engraphis · 134 tokens

curate

Power-user audit of Wenlan's pending surfaces: accept or dismiss pending revisions (conflicts/merges), or audit pending captures (not yet confirmed). Most users want /brief for revisions; that handles the daily flow. Use /wenlan curate only for explicit deep-walk audits after bulk imports, or to walk the full queue…

wenlan-app/wenlan · 106 tokens

pages

Browse, open, or print distilled pages, reusing the wenlan pages CLI for the actual open (one implementation on your PATH, no setup). /wenlan pages opens the page when one matches, or shows a small native picker when 2-4 match. /wenlan pages --print reads the page here instead of opening an editor. /wenlan pages lists…

wenlan-app/wenlan · 105 tokens

remnic-memory-workflow

Shared memory workflow for Claude Code agents connected to Remnic — recall before acting, observe during work, remember at the end. Trigger phrases include "what do you remember about", "save this for later", "any context from last time".

joshuaswarren/remnic · 54 tokens

remnic-recall

Search Remnic memories by natural-language query. Trigger phrases include "what do you remember about", "recall anything on", "have we discussed".

joshuaswarren/remnic · 35 tokens