how-it-works

how-it-works is a command for Claude Code from Reikor-Arg/inmemory. It costs 14 tokens per session (667 once invoked), scanned A, original, MIT.

A command that explains how the inmemory plugin works, including its cost and limitations, using the actual state of the installation.

In plain words
What is it for?
Use it to inspect inmemory statistics and understand how it indexes original session transcripts and recalls relevant parts automatically.
Why use it?
It addresses the loss of project context between Claude Code sessions and after context is shortened, while showing what the plugin really has stored.

Command for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: reads .claude/ paths; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the inmemory plugin — 4 skills, 12 commands, 5 hooks shipped together

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Reikor-Arg/inmemory
Claude Code
/plugin install inmemory

Made for: Claude Code.

Or install inmemory, the plugin that ships this one along with the rest of its 4 skills, 12 commands, 5 hooks.

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 how-it-works

README.md
[![agentmods](https://agentmods.dev/badge/commands/reikor-arg/inmemory/how-it-works.svg)](https://agentmods.dev/commands/reikor-arg/inmemory/how-it-works)
Your own site
<a href="https://agentmods.dev/commands/reikor-arg/inmemory/how-it-works"><img src="https://agentmods.dev/badge/commands/reikor-arg/inmemory/how-it-works.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 667 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.1 $0.00014 $0.00667
Opus 5 $0.00007 $0.00333
Sonnet 5 $0.00003 $0.00133
Haiku 4.5 $0.00001 $0.00067

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

Security

Grade A, and why

how-it-works 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 5d 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.

commands/how-it-works.md · 72 lines

How it starts

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

Explain the plugin to the user in plain language. Adapt to what they ask — if they only want to know why something was injected, answer that and stop.

Show them the real state of their own install rather than describing it in the abstract:

node "${CLAUDE_PLUGIN_ROOT}/hooks/recall.mjs" stats

The problem it solves

Claude Code forgets the project between sessions, and forgets details within one every time the context is compacted. So the same decision gets explained twice, and an approach already rejected gets proposed again — the turn where it was rejected is simply gone.

How it works

Claude Code already writes a full transcript of every session to ~/.claude/projects/. This indexes those transcripts and puts the relevant pieces back in front of the model at the moments they matter.

Nothing is summarised. The index stores the original text, so what comes back is what was actually said. That is the whole design: a summariser that misreads a session stores the misreading as fact, and replays it months later as something the user said. This can fail to find something; it cannot invent it.

Five hooks, all automatic:

  • session start — where the project left off (~110 tokens)
  • each prompt — pointers into past turns sharing uncommon words (~200)
  • reading or editing a file — earlier turns about that file (~150)
  • invoking a skill — oversized ones declined, with a pointer to the file worth reading
  • turn end — the new turn is indexed

Each injects nothing when it has nothing worth saying. A vague question costs zero.

What it costs

Nothing to write: indexing is string work, no model runs. Reading costs only the few hundred tokens actually injected. The commands (/timeline, /map, /digest, /topics, /duplicates, /standup) are computed, not generated.

What it cannot do

Say these plainly if the user's question touches them — an overstated tool gets trusted where it should not be:

  • Retrieval is lexical. Different words for the same thing, with nothing in common, will not match. It returns nothing rather than guessing.
  • It only knows what was written down. Reasoning in a thinking block, and work done outside Claude Code, are not there.
  • map is shallow. A missing symbol is a gap in the map, not proof it does not exist.
  • digest shows what was asked, not whether it worked.

Read the full file on GitHub · 72 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. 5d ago First seen · 72 lines · 14 tokens per session scan A 06a43c6ec89b

Subscribe to this mod's changes

how-it-works is a command published in the GitHub repository Reikor-Arg/inmemory (1 stars, last pushed 1mo ago), licensed MIT. It adds 14 tokens to every session and 667 once invoked, about $0.0001 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.