A Revit add-in that records what the user does during a session as a JSONL log
(one JSON object per line). Designed to be fed to Claude / the Revit MCP later via a
get_action_history tool.
Two complementary event sources, combined for command-level history:
- Command events — bindings on a curated set of
PostableCommands fire onBeforeExecuted, giving the exact command the user invoked (Move, Delete, Wall, …). Language-independent (keyed on the enum, not a localized string). - Change events —
DocumentChangedfires after each committed transaction, giving the affected element ids, their categories, and the operation (added / modified / deleted).
Plus SessionStart / SessionEnd markers.
One file per Revit session:
%LOCALAPPDATA%\RevitActionLog\session_<utc-timestamp>_pid<pid>.jsonl
Example lines:
{"ts":"2026-07-16T14:02:11Z","user":"aidan","source":"session","command":"SessionStart"}
{"ts":"2026-07-16T14:32:07Z","user":"aidan","source":"command","command":"Move","doc":"Project1.rvt"}
{"ts":"2026-07-16T14:32:07Z","user":"aidan","source":"change","command":"Move","operation":"modified","doc":"Project1.rvt","categories":["Walls"],"elementIds":[123,456]}
{"ts":"2026-07-16T14:33:12Z","user":"aidan","source":"command","command":"Delete","doc":"Project1.rvt"}
{"ts":"2026-07-16T14:33:12Z","user":"aidan","source":"change","command":"Delete","operation":"deleted","doc":"Project1.rvt","elementIds":[789]}Append-only, one writer, complete lines flushed to disk — safe for a reader (the MCP tool) to tail. A partially written trailing line is simply skipped by the reader's JSON parse.
| File | Purpose |
|---|---|
App.cs |
IExternalApplication — startup, command bindings, DocumentChanged. |
ActionLogger.cs |
Thread-safe append-only JSONL writer. |
LogEntry.cs |
Log record schema (short, stable field names). |
RevitActionLogger.addin |
Manifest Revit reads to load the add-in. |
RevitActionLogger.csproj |
Build config; auto-deploys DLL + manifest to Revit's AddIns folder. |
- Set
<RevitVersion>inRevitActionLogger.csprojto your Revit (2024 / 2025 / 2026).- 2025+ builds against .NET 8; 2022–2024 against .NET Framework 4.8.
- Confirm
<RevitApiDir>points at your Revit install (defaultC:\Program Files\Autodesk\Revit <version>). dotnet build -c Release. The post-build target copiesRevitActionLogger.dllandRevitActionLogger.addinto%APPDATA%\Autodesk\Revit\Addins\<version>\.- Start Revit. It loads the add-in automatically (no ribbon button — it runs in the background). Approve the add-in if Revit prompts about a non-signed assembly.
Generate a .snk and sign the assembly if you want to suppress the load-time
security prompt.
Edit the TrackedCommands array in App.cs. Only postable commands can be bound
this way. To track more, add the corresponding PostableCommand enum values.
DocumentChangedgives what changed, not always which UI command caused it; the command bindings fill that gap for the commands you list. Actions from neither source (e.g. non-postable internal commands) won't appear — Revit's journal file is the only place those live, at the cost of noise and an unsupported format.- All logging is wrapped in try/catch and never throws into Revit — a logging failure can't disrupt the user's session.
- No PII beyond the Revit username and open document titles is written.