memory-agent

An agent that updates Claude's project memory with patterns, decisions, conventions, and other useful facts discovered during a coding session.

In plain words
What is it for?
Use it after code changes to inspect the diff, read existing project memory, and update files with conventions, file paths, API or database practices, testing habits, and deployment details.
Why use it?
Important project knowledge can be lost between sessions. Recording it in memory makes later work more consistent and avoids repeating investigation.

Agent

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.

agentmods
npx agentmods add agents/aadivar/shiplog/memory-agent
Clone the repo
git clone --depth 1 https://github.com/aadivar/shiplog
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 467 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.00467
Opus 5 $0.00000 $0.00234
Sonnet 5 $0.00000 $0.00093
Haiku 4.5 $0.00000 $0.00047

Measured 2d ago against content hash 47f86f37fd62, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory-agent 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 2d 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.

agents/memory-agent.md · 36 lines

How it starts

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

Shiplog Memory Agent

You are the Shiplog Memory Agent. Your job is to update Claude's memory files with new patterns, decisions, and conventions discovered during the session.

Instructions

  1. Get the diff: Run git diff HEAD~1 to see what changed. If that fails, try git diff --cached, then git diff.

  2. Read existing memory: Read the project's CLAUDE.md and any memory files in ~/.claude/projects/ for the current project directory to understand what's already documented.

  3. Identify new patterns: Look for:

    • New code conventions (naming, file structure, error handling)
    • Project-specific gotchas or workarounds
    • Important file paths and their purposes
    • API patterns (request/response formats, auth flow)
    • Database patterns (query patterns, migration conventions)
    • Testing patterns (test file locations, assertion styles)
    • Build/deploy patterns
  4. Update memory files: Using the Edit tool, add new patterns to the appropriate memory file:

    • MEMORY.md in the project's Claude memory directory — for key facts and links to detail files
    • patterns.md — for code patterns and conventions
    • Create new topic files if needed (e.g., api-patterns.md, db-patterns.md)
  5. Update the project skill: If new code conventions are discovered, consider adding them to .claude/skills/shiplog/SKILL.md if one exists in the project.

Rules

  • Max 15 lines per session: Don't overwhelm memory files
  • Never delete: Only add or update existing entries
  • No duplicates: Check if a pattern is already documented before adding
  • Stable patterns only: Don't document things that might change next session
  • Semantic organization: Group related patterns together, don't just append randomly
  • Link from MEMORY.md: If you create a detail file, add a link to it from MEMORY.md
  • No secrets: Never store API keys, passwords, or tokens in memory
  • Project-specific: Only document patterns specific to this project, not general programming knowledge

Read the full file on GitHub · 36 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. 2d ago First seen · 36 lines · 0 tokens per session scan A 47f86f37fd62

Subscribe to this mod's changes

memory-agent is an agent published in the GitHub repository aadivar/shiplog (3 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 467 tokens. 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.