{"slug": "session-visualization-with-obsidian", "title": "Session Visualization with Obsidian", "summary": "A developer created a script that logs coding agent events into Obsidian vault files, enabling visualization of the model's reasoning path through a graph. The script, shared as a gist, uses pre/post hooks in Claude's settings.json to capture prompts, tool calls, and results, allowing users to see the step-by-step process behind the final output.", "body_md": "on\n\n# Session Visualization with Obsidian\n\nWhen working with coding agents such as Claude, Codex etc. we provide the prompts and context until we get to the final result. However a lot happens behind the scenes. The model constantly makes calls to tools, MCP servers, commands etc until it arrives at the output. By knowing what path it took, we can begin to understand its reasoning better.\n\nOne way I have found useful is to use pre/post hooks to log these messages into files and then use [Obsidian](https://obsidian.md) to visualize them.\n\nObsidian is a note taking app which stores notes as files on your local disk. You can link notes together and then visualize them as a graph.\n\nIn order to demonstrate this, I used claude to create a sample todo app. I had claude generate a [script](https://gist.github.com/jimmyislive/883238a86c4f8ffe5603c7e3e8d1e903) which would log events for me into a folder of my choice (In Obsidian lingo, this folder is called a “[vault](https://obsidian.md/help/vault)”).\n\nBefore you start prompting Claude, you will have to update its `settings.json`\n\nfile to call this script in the pre/post hooks:\n\n|\n\n```\n1\n2\n3\n4\n5\n```\n\n |\n\n```\n\"hooks\": {\n        \"UserPromptSubmit\": [{ \"hooks\": [{ \"type\": \"command\", \"command\": \"python3 ~/.claude/obsidian-tracker/log_event.py prompt\" }] }], \n        \"PreToolUse\": [{ \"matcher\": \"mcp__.*\", \"hooks\": [{ \"type\": \"command\", \"command\": \"python3 ~/.claude/obsidian-tracker/log_event.py tool_call\" }] }],\n        \"PostToolUse\": [{ \"matcher\": \"mcp__.*\", \"hooks\": [{ \"type\": \"command\", \"command\": \"python3 ~/.claude/obsidian-tracker/log_event.py result\" }] }]\n}\n```\n\n |\n\nOnce this is ready, just prompt claude as you would. It will log all the events into the folder configured in your script. The events are logged into numbered files representing the thought process of the model.\n\nYou can now see the visual representation of all the steps as to how the model arrived at the final result. You can also go sequentially through the files to understand them and see how the graph builds up.\n\nAnd here is the final todo app:\n\nThere may be other uses of keeping your session history around, but at least now you have them in an easy visualizable format !", "url": "https://wpnews.pro/news/session-visualization-with-obsidian", "canonical_source": "https://jimmyislive.dev/posts/session-visualization/", "published_at": "2026-08-17 16:11:09+00:00", "updated_at": "2026-08-17 16:41:51.882005+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-agents"], "entities": ["Obsidian", "Claude", "Codex", "jimmyislive"], "alternates": {"html": "https://wpnews.pro/news/session-visualization-with-obsidian", "markdown": "https://wpnews.pro/news/session-visualization-with-obsidian.md", "text": "https://wpnews.pro/news/session-visualization-with-obsidian.txt", "jsonld": "https://wpnews.pro/news/session-visualization-with-obsidian.jsonld"}}