Skip to main content

Tool Attribution

A Memanto session belongs to an agent, but the calls inside it come from a tool — Claude Code, Cursor, Codex CLI, an MCP client, or a plain shell. Attribution is what records which tool made each call, so a session can show who took part in it and the dashboard can show which tools are connected right now. This is machine-facing plumbing. Nothing here changes what a person types by hand.

How Memanto identifies the caller

Identity is resolved in this order, best first:
  1. The tool names itself. --tool on reads, --source on writes, or the X-Memanto-Client header over HTTP. Exact.
  2. MEMANTO_CLIENT in the environment. Set by a wrapper that knows who it is.
  3. MCP clientInfo. Read from the initialize handshake, so an MCP client is identified without any flag.
  4. Environment markers. Variables a tool happens to leave behind (CLAUDECODE, CURSOR_TRACE_ID, and similar). Reliable when present, absent for some tools.
  5. Unidentified. Recorded as unknown rather than guessed at.
Detection is deliberately conservative: a marker has to be specific to one tool before Memanto maps it. Attributing a call to the wrong tool is worse than attributing it to nobody, because the Connections view reads these labels back as fact.

Declaring the tool

recall and answer carry no --source, so they take --tool:
--tool is hidden from --help because it exists for agents, not people. It accepts any slug; values are normalized to lowercase (Claude Code becomes claude-code), and the connect slugs are the canonical set.
Running memanto connect <agent> writes a skill and instruction file that already carry that agent’s own slug on every example command, so a connected tool identifies itself without any extra setup. If you connected before this shipped, re-run memanto connect <agent> to pick it up.

What gets recorded

Each memory operation appends one line to a local activity log at ~/.memanto/activity/events-YYYY-MM-DD.jsonl:
It records the operation and a count — never memory content. Files older than 30 days are pruned automatically. Logging is best effort: a failure to write this line never fails the memory operation behind it.

Where it shows up

The dashboard Connections page reads this log:
  • Connected tools — a diagram of each tool joined to Memanto. A tool that touched memory in the last 5 minutes shows as live.
  • Sessions — one row per Memanto session, with the logos of every tool that took part, plus writes and reads. Opening a row shows the session’s full event timeline, so you can see one tool write a memory and another read it back later in the same session.
Two localhost-only endpoints back that view: Both are restricted to loopback callers, like the rest of the dashboard API.
A session with no identified tool shows as no tool identified rather than being hidden. That usually means the caller was a bare shell, or a tool that has not been connected yet.