Memtrace v1.1.6
Sessions clean up after themselves, and reset never deletes your history
New
- Clearing or resetting a store no longer deletes anything: everything it held moves to a sibling history archive next to the store, ready to restore by moving it back. The new
memtrace historycommand lists archived generations, and only the explicitmemtrace history purge --store <path> --delete-forevercan permanently remove them. memtrace stopnow also collects engine processes left behind in other workspaces when the store's own records prove their owning session is gone, so a forgotten window can no longer leave a database engine running for days.- New features land on Nightly first:
npm install -g memtrace@nightlyis the same memtrace command, and it is not always stable. They still ship on the default install.memtrace installstays on the channel you already have. - A built-in CPU profiler: set MEMCORE_SELF_PROFILE=1 and the engine samples its own hot functions and writes named stack reports into its normal log — no admin rights or external tools needed on any machine.
memtrace uiserves the dashboard on its own against an engine that is already running. It does not index, watch, or take workspace ownership, so the dashboard and the engine can be restarted independently and a status page can outlive the editor session that used to keep it alive.memtrace claude installwrites a Memtrace routing directive into a project's own CLAUDE.md, so Claude Code reaches for Memtrace before text search in that repository. It survives context compaction, can be committed so a team shares one rule, andmemtrace claude uninstallremoves it leaving the rest of the file byte-identical.- Directories that are not git repositories can now be indexed as a point-in-time snapshot, with
--allow-non-gitor MEMTRACE_ALLOW_NON_GIT. Symbols, relationships, impact and search all work; history-derived answers are unavailable by construction and now say so rather than returning an empty result that looks like nothing ever changed. cleanup_stale_recordsgained acheck_stale_spansscope that reaches symbols left behind in files that still exist — the case the missing-file scope cannot see, which previously needed deleting the whole repository.--index-ignored(orMEMTRACE_INDEX_IGNORED) indexes the files a repository's ignore rules would normally hide. Every ignore source is turned off together, parent directories included, so an ancestor cannot keep filtering a tree you asked to see in full. Off by default: a repository's ignore rules are written for building the product, and honouring them is what almost everyone wants.- Fields and constants are now first-class symbols with read and write edges, extracted across 18 language families and classified by each language's own write-once form — so get_impact finally answers who reads a feature flag, config constant, or magic number, with no getter workaround. Compound assignments record both a read and a write. Thanks to Magalz for the field report behind this batch.
- link_symbols records cross-repository relationships at symbol granularity — queue producer/consumer pairs, gRPC seams, shared schemas the HTTP linker cannot infer — and get_impact walks them in both directions. An ambiguous name is refused with the candidates listed, never guessed.
- ingest_graph_fragment lets your own tools contribute nodes and edges for structure Memtrace cannot parse — generated stubs, in-house DSLs, build-graph output — with a provenance tag stamped on every contributed record and surfaced in queries, and rerunning generators rewrite their rows instead of duplicating them.
- find_code_review_issues flags a value consumed inconsistently across call sites — the classic money, timestamp, and ID bug no single-file rule can see — listing every consuming site, and staying quiet when narrowing is unanimous and deliberate.
- Annotation names and their arguments are captured and queryable: find_symbol can filter by annotation and get_symbol_context surfaces them, across Java and Kotlin annotations and Python and TypeScript decorators.
- Named milestone anchors bind a name to an instant, and get_evolution can diff the graph between two named states — release-to-release change reports without hunting timestamps. Re-creating a name moves the anchor, because a re-cut release is the common case.
- An opt-in query-level audit log (MEMTRACE_QUERY_AUDIT=1) records one line per tool call — who, what, when, outcome — exported with export_query_audit. Tool arguments are deliberately not recorded, so the audit trail can never become a second copy of your source under weaker access control.
Fixed
- Closing an agent session no longer leaves its database engine running in the background — every exit path now shuts the engine down with the session.
- Background agent sessions no longer advertise a dashboard port they never opened, which made
memtrace startmistake a healthy session for a broken one and restart it, briefly taking every connected agent down with it. - Memory no longer spikes by hundreds of megabytes per code search in each connected agent: searches now reuse the running workspace engine for query embedding, the reranking model unloads when idle, and freed memory returns to the system promptly.
- Recovering a store with damaged records no longer floods the engine log with megabytes of repeated warnings per minute; repairs are summarized instead.
- Stopping Memtrace in one workspace can no longer discard the runtime record of a different workspace whose session is still running.
- History and timeline questions no longer scan and decode the entire store: all-time and as-of queries are answered from the property index, so a daemon left running with no clients measures around one percent of a core instead of holding two or more cores forever.
- Deleted or superseded code now stays deleted after a restart. Soft-deletes used to live only in memory, so every boot brought removed vectors back as live and searchable and the compactor re-reclaimed them each time; deletes are now durably logged and replayed on boot, with no store migration needed.
- If the property index cannot record a write, the store now marks that index incomplete and answers from the full data until it heals, instead of silently missing rows.
- A single slow engine call can no longer hold a client request open indefinitely: per-call deadlines fail fast with a clear error instead.
- On NVIDIA cards, embeddings no longer route through DirectML when the runtime documents a better provider for that hardware — and when CPU is measurably faster, Memtrace says so plainly instead of pretending the GPU helps.
- Windows no longer loops demoting and rebuilding the insights cache: file replacement follows one atomic rule everywhere, and Windows now matches macOS across path handling, locks, and Cortex startup.
- Startup embedding and cross-repository relinking can no longer deadlock each other during boot.
- Starting the dashboard next to a headless agent session takes over the store cleanly instead of leaving both processes wedged.
- Stale overlay copies of a symbol no longer outrank the current version in search results, and a modified symbol now closes its superseded predecessor rows so watched repositories stop accumulating duplicates.
- Cleanup no longer flags virtual paths as missing files, and branch-scoped statistics explain a near-empty scan instead of looking broken.
- Starting no longer aborts with a multi-gigabyte allocation failure when a recovery checkpoint points into the middle of a record instead of at a record boundary. A damaged checkpoint now costs a slower start rather than a database that can never be opened again, and the recovery path can no longer shorten a log to a position it has not verified.
- Repository enumeration is bounded and no longer stalls a whole agent session. If it outruns its deadline it reports what to do instead of leaving the client to give up in silence, and tools that need a repository will now read the store's own membership record when enumeration cannot answer — so a slow discovery call no longer blocks everything behind it.
- A relationship query that finds no connections now says whether that is a conclusive answer. A count of zero used to read as proof that a symbol was unused even when the lookup itself had not resolved, which is the worst possible wording ahead of a deletion.
- A background pass that processed nothing is no longer reported as a failure. An empty work-set cannot have failed, and calling it one led users toward wiping a store whose data was intact and only needed its index repaired.
- The graph view only suggests running an index when the store is confirmed empty. While indexing is in progress, or while counts are briefly unavailable, it now says so instead of advising a second indexer against a store the first one is still writing.
- The upgrade hint names
sudowhen, and only when, the install location actually needs it, so an upgrade on a system-owned install no longer fails with a permissions error after you have already confirmed it. memtrace statusconfirms the dashboard is really listening before printing its address, and says so plainly when the port is recorded but nothing answers on it.- MCP sessions no longer leave behind lease files owned by processes that have exited, and a session that is stopped abruptly is cleaned up by the next start rather than accumulating. The Cortex socket is removed when the daemon that owned it stops.
doctor --fixnow names the sessions it could not stop, which application owns each one, and the exact command to stop them — rather than reporting that it found processes and then leaving them running.- A workstation that sleeps overnight no longer fills the log with one identical heartbeat warning per cycle. The first failure is reported, the rest stay quiet, and a single line says when the network came back and how long it was gone.
- The documentation assistant no longer tells Windows and Linux readers to press a key their keyboard does not have; the search shortcut now shows the modifier for the reader's platform.
- The documentation assistant follows a streaming answer the way a terminal does: it stays pinned while you are at the bottom, releases as soon as you scroll up to read, and re-attaches when you scroll back down.
--allow-non-gitpassed inside an actual git repository no longer disappears without a word. The flag only opens the gate for a directory with no version control, so it now says it does not apply, names the repository it resolved, and points at--index-ignoredwhen indexing ignored files is what you were after.- Files whose extension matches no supported language are now counted and reported by the scan instead of vanishing from every statistic. A tree Memtrace has no parser for used to be indistinguishable from an empty one.
- Running out of file watches on the host no longer costs you the whole daemon. Exhausting the operating system's watch capacity used to abort startup outright — no dashboard, no agent connection, no way to reach an index that was already complete. Memtrace now starts without live watching, names the limit it hit and the exact command to raise it, and keeps serving search, graph and impact. Watcher failures it cannot explain still stop startup, because those are not something a host setting fixes.
memtrace installno longer depends on npm being resolvable from the shell it happens to run in — it now finds the npm that ships beside Node itself. And when the upgrade genuinely cannot run, it says what went wrong in one line instead of crashing with a stack trace that buried the reason.- Upgrades no longer complete silently WITHOUT their finishing step on newer npm versions whose script policy blocks install scripts by default: the installer now grants itself permission to run its own completion step, so the platform binary and the consented configuration always arrive together with the package.
- Installs and upgrades now succeed even from a shell where Node itself is not on PATH: the installer carries its own Node location into every step it runs. It also stops a running Memtrace before replacing its files, so a live daemon can no longer make a Windows upgrade half-land on locked binaries.
- find_duplicate_code no longer reports a symbol as a duplicate of itself. Copies the index holds more than once — branch snapshots, working-tree saves, path-spelling variants — are collapsed before pairing, so each real duplicate appears exactly once and cites the correct original. Thanks to Trekkie for the report.
- find_duplicate_code now honors its branch parameter: results are scoped to the requested branch, or to the repository's current branch when omitted, and asking for a branch with no indexed code is a clear error instead of a silent unscoped scan. Thanks to Trekkie for the report.
- The dashboard's exact-duplication figure now counts real duplicated function bodies instead of raw scan rows, which could overstate duplication roughly twenty to one. Thanks to Trekkie for the report.
- cleanup_stale_records now treats file_path_pattern as a strict boundary: combined with any staleness scope, nothing outside the pattern can be selected for deletion, a pattern that matches nothing deletes nothing, and the sampled paths always satisfy the pattern. Previously the scopes combined as a union, so a cleanup scoped to one file could silently select records across the whole repository; scrubs that intentionally span scopes now take one call per scope. Thanks to Trekkie for the report.
- get_repository_stats can no longer present a healthy graph as empty: when an exact branch match finds almost nothing, statistics are recomputed with the same branch-ancestry visibility every other graph tool uses, and any remaining divergence is explained in the response with the store's real live counts and the likely cause — so zero edges never silently looks like a failed index. Thanks to Trekkie for the report.
- get_repository_stats without a branch now reports the repository's primary indexed branch — the one list_indexed_repositories shows — instead of whatever branch the local checkout happened to be on, and the tool reference now defines every node count and when indexing_incomplete is set. Thanks to Trekkie for the report.
- When the database backend dies or stops answering mid-session, the heavy graph tools — get_cochange_context, get_evolution, get_symbol_context — now fail within seconds with the clear endpoint-unreachable error, even for calls already queued behind another heavy query, instead of blocking for up to thirty minutes. Thanks to Trekkie for the report.
- Cancelling or abandoning a tool call now stops its server-side work, so an abandoned heavy query no longer keeps burning CPU or starving the queries behind it. Thanks to Trekkie for the report.
- memtrace index no longer stalls for five minutes and exits with an error when embeddings are enabled: the wait for cross-repository graph convergence now happens only after the index has published its results, so indexing and background relinking can no longer lock each other out.
- index_directory now attaches to a repository's index job already in flight instead of starting a second run, which could race the first and leave the older job's record stalled forever.
Improved
- The agent-tooling hook that routes code searches now asks the running workspace service directly instead of launching a new program for every terminal command, removing dozens of short-lived processes per minute during active coding sessions.
- Symbol evolution views make one pass over the history window instead of one query per episode, so long histories load quickly.
- Cross-repository topology lookups seek directly to the rows they need instead of walking unrelated ones.
- Background maintenance now reports each tick's cost in the log, so a busy daemon can say what it was doing.
- The documentation now covers clone detection and repository statistics: what find_duplicate_code pairs and how its branch scoping works, what the dashboard's duplication figure counts, every get_repository_stats node count and when indexing_incomplete is set, and how cleanup scopes combine. Thanks to Trekkie for flagging the gaps.
- A branch-scoped symbol miss now names the branches that do carry the symbol, instead of returning the same empty answer as a symbol that does not exist.
Install
npm install -g memtrace