You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
Opt-in usage metrics for Claude Code. memry usage enable lets Claude Code send its
OpenTelemetry metrics to the memry server you are logged in to, so the dashboard can chart token
usage and cost. It is off by default, and memry setup never turns it on.
Before asking for a token, it explains where the metrics go and what memry can and cannot
check. Claude Code decides what it sends, as documented in its monitoring guide, including
identity attributes such as your email. The memry server keeps only the token and cost data
points and discards everything else.
It requests a usage token that can only send usage metrics, then adds memry's variables to the env of Claude Code's settings.json, keeping every other setting. It sets every documented OTEL_METRICS_INCLUDE_* attribute gate to false. The settings file, which now holds that
token, is made readable only by its owner.
It stops before requesting a token when other telemetry is configured anywhere memry can see:
the shell environment, the user settings or Claude Code's managed settings files. This covers OTEL_*, the Claude Code telemetry and beta tracing variables, otelHeadersHelper, a managed policyHelper, and managed settings files that cannot be read. This is an allowlist, so
variables added by later Claude Code versions also stop it. --force only replaces conflicting
values of memry's own variables in the user settings. Per-session --settings, MDM, registry
and server-managed policies are outside what memry can see.
It refuses a non-loopback http:// server unless --insecure is given.
memry usage status reports whether metrics go to memry, as far as memry can see, and lists
anything missing or overridden. It never prints the token.
memry usage disable removes only the variables memry wrote and revokes this machine's usage
token. memry uninstall and memry delete-account turn usage metrics off too.
Changed
The privacy policy (PRIVACY.md, PRIVACY.es.md) describes the
opt-in usage metrics: what Claude Code sends, what the memry server keeps, and how to turn it off.
Every write to Claude Code's settings.json, including setup's SessionStart hook, now checks
that the file did not change since memry read it. On a change it writes nothing (usage
commands) or reads the file again and retries (the hook). Only another program writing at the
same instant can still win.
memry commands that change the memry config (memry setup, memry usage, memry uninstall, memry delete-account) now take a private per-user lock, so they never overwrite each other. A
lock is never taken over automatically. If a command crashed, the message names the lock file to
delete.
Security
Usage tokens are revoked by exact id and only on the server that issued them, so other machines'
tokens are never touched. If enabling fails partway, the new token is revoked and the previous
setup keeps working. A failed revocation prints a warning; unused usage tokens stop working
after 30 days.
Unknown state fails closed. If the memry config or its usage record cannot be read or is
malformed, the usage commands, memry uninstall and memry delete-account stop without
changing anything. Before, uninstall could delete such a config.
Requires memry-server 0.20.0 or later for the usage-token endpoints.