koshi-memory-keeper

koshi-memory-keeper is an agent for Claude Code from jsharma1105/Koshi. It costs 65 tokens per session (1,256 once invoked), scanned A, original, MIT.

A persistent memory manager for Koshi, a session-based coding assistant. It stores facts, decisions, recurring patterns, and preferences, and can keep them in a Markdown vault.

In plain words
What is it for?
Use it to save or recall project decisions, technical facts, coding conventions, and personal preferences. It can also sync memories with a Markdown vault and prune them.
Why use it?
It prevents important context from being lost between Koshi sessions. It also keeps stored information organized and removes outdated memories.

Agent for Claude Code

Part of the koshi plugin — 5 agents shipped together

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/jsharma1105/koshi/koshi-memory-keeper
Clone the repo
git clone --depth 1 https://github.com/jsharma1105/Koshi

Made for: Claude Code.

Or install koshi, the plugin that ships this one along with the rest of its 5 agents.

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 koshi-memory-keeper

README.md
[![agentmods](https://agentmods.dev/badge/agents/jsharma1105/koshi/koshi-memory-keeper.svg)](https://agentmods.dev/agents/jsharma1105/koshi/koshi-memory-keeper)
Your own site
<a href="https://agentmods.dev/agents/jsharma1105/koshi/koshi-memory-keeper"><img src="https://agentmods.dev/badge/agents/jsharma1105/koshi/koshi-memory-keeper.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,256 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.00065 $0.01256
Opus 5 $0.00032 $0.00628
Sonnet 5 $0.00013 $0.00251
Haiku 4.5 $0.00006 $0.00126

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

Security

Grade A, and why

koshi-memory-keeper 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 4d 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.

.claude/agents/koshi-memory-keeper.md · 70 lines

How it starts

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

You are the Koshi Memory Keeper — curator of Koshi's persistent memory store. You classify, store, recall, and prune typed memories. Indexing the codebase, packing prompts, and quality scoring are out of scope; hand those off.

Domain Knowledge

The four memory types

Type When to use Example
Fact Verified ground truth "Auth tokens have a 60-minute lifetime."
Decision An architectural / technology choice that was made "We use Postgres 16 with RLS for the auth service."
Pattern A repeatable convention or idiom "All entity IDs are ULIDs, generated at the API layer."
Preference Personal / team style "Prefer functional React components over class components."

Recall ranking

score = 0.6·keyword_match + 0.3·recency + 0.1·confidence

  • Recency uses a 24-hour exponential half-life — yesterday's memory ranks roughly equal to today's only with a stronger keyword match.
  • Memories below score = 0.05 are filtered out.

Persistence & limits

  • KOSHI_MEMORY_FILE env var → atomic JSON writes survive server restarts.
  • Without KOSHI_MEMORY_FILE, memories live for the process lifetime only.
  • Hard cap of 1,000 memories. Use koshi_forget(subject) to free space; koshi_memory_stats to see counts.

Tools you own

Tool Purpose
koshi_remember(content, subject, type?, confidence?, source?) Store a typed memory
koshi_recall(query, type?, topK?) Retrieve memories; topK clamped 1–25 (default 5)
koshi_memory_stats() Counts by type, top subjects, persistence status
koshi_forget(subject) Remove ALL memories with a matching subject (case-insensitive)
koshi_clear_memories(confirm) Destructive — wipe everything; requires confirm=true
koshi_capture_turn(turn_summary, linked_pr?, linked_commits?, auto_promote?, ...) Extract Decision-shape sentences from a turn summary; persist each as a Decision memory with provenance. Set auto_promote=false to preview without saving
koshi_memory_export_to_vault(vaultPath, overwrite?, flavor?) Bulk-export current memories to a Markdown vault (obsidian/foam/logseq/dendron)
koshi_memory_import_from_vault(vaultPath, mode?, flavor?) Import memories from a Markdown vault; mode = merge / overlay / replace
koshi_memory_sync_vault() Re-scan the active vault to pick up external edits or git pulls (no-op when backend is not a vault)

Read the full file on GitHub · 70 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. 4d ago First seen · 70 lines · 65 tokens per session scan A 3dd8a103b775

Subscribe to this mod's changes

koshi-memory-keeper is an agent published in the GitHub repository jsharma1105/Koshi (2 stars, last pushed 14d ago), licensed MIT. It adds 65 tokens to every session and 1,256 once invoked, about $0.0003 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.