captain-memo AGENTS.md

captain-memo AGENTS.md is an instructions file for Claude Code, Codex, OpenCode from kalinbogatzevski/captain-memo. It costs 809 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for Captain Memo, a local memory system for AI coding agents. It stores searchable information on the developer's machine using SQLite, vector search, and full-text search, with a worker and MCP server sharing the memory.

In plain words
What is it for?
Use them to install, test, type-check, diagnose, and work on Captain Memo while following its local-first memory and Bun-based runtime setup.
Why use it?
They explain how the project works and when agents should search or save memory, so useful project knowledge can carry across sessions and tools.

Instructions file for Claude CodeCodexOpenCode

Written for Claude Code and Codex and OpenCode: UserPromptSubmit hook event, but also the file is AGENTS.md. Also seen: mentions AGENTS.md.

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 instructions/kalinbogatzevski/captain-memo/agents-md
Clone the repo
git clone --depth 1 https://github.com/kalinbogatzevski/captain-memo

Made for: Claude Code, Codex, OpenCode.

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 captain-memo AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/kalinbogatzevski/captain-memo/agents-md.svg)](https://agentmods.dev/instructions/kalinbogatzevski/captain-memo/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/kalinbogatzevski/captain-memo/agents-md"><img src="https://agentmods.dev/badge/instructions/kalinbogatzevski/captain-memo/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 809 This file is loaded in full into every session.
When invoked 809 The same file — it is already loaded in full.
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.1 $0.00809 $0.00809
Opus 5 $0.00404 $0.00404
Sonnet 5 $0.00162 $0.00162
Haiku 4.5 $0.00081 $0.00081

Measured 6d ago against content hash 8c798cf3eb86, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

captain-memo AGENTS.md 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 6d 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.md · 73 lines

How it starts

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

AGENTS.md

Orientation for AI coding agents working on this repository. Humans want CONTRIBUTING.md.

What this project is

Captain Memo is a local-first memory layer for AI coding agents. It keeps one searchable corpus on your machine — SQLite + sqlite-vec + FTS5 — and every MCP-speaking coding tool on that machine shares it. What one tool learns, the others recall.

Two moving parts: a background worker (indexes, embeds, summarizes) and an MCP server plus hooks that the AI tool loads. Nothing calls a cloud database; retrieval is local.

Runtime

Bun ≥ 1.1.14, TypeScript. Not Node — bun runs the TypeScript source directly, so there is no build step for the worker, CLI, or hooks. The only bundling target is the distributable plugin (bun run build:plugin).

Commands

bun install
bun test                       # full suite
bun test tests/unit/           # or: bun run test:unit
bun test tests/integration/    # or: bun run test:integration
bun test tests/hooks/          # or: bun run test:hooks
bun run typecheck              # tsc --noEmit
bun src/cli/index.ts doctor    # health-check a local install

Run bun run typecheck and bun test before proposing a change. Both must be clean.

Handy during development:

bun run worker:dev             # worker with --watch, against ./.captain-memo.dev
bun run mcp:start              # the MCP server on stdio
bun bin/captain-memo <cmd>     # the CLI

Layout

Path What lives there
src/worker/ Background worker: indexing, embedding, summarizing, the tick loop
src/mcp-server.ts MCP server the AI tools connect to
src/hooks/ UserPromptSubmit / PreToolUse / Stop hook handlers
src/cli/ captain-memo CLI, including install and connect
src/services/ Embedders, summarizer providers, search, storage
src/shared/ Types and helpers used across the above
src/migration/ Data-format upgrades between versions
src/dreaming/, src/eval/ Consolidation and retrieval evaluation
tests/ unit/, integration/, hooks/

Read the full file on GitHub · 73 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. 6d ago First seen · 73 lines · 809 tokens per session scan A 8c798cf3eb86

Subscribe to this mod's changes

captain-memo AGENTS.md is an instructions file published in the GitHub repository kalinbogatzevski/captain-memo (3 stars, last pushed 2d ago), licensed Apache-2.0. It adds 809 tokens to every session, about $0.0040 per session on Opus 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.