Function: claude-code-ide-mcp-server-update-last-active-buffer
claude-code-ide-mcp-server-update-last-active-buffer is a natively
compiled function defined in claude-code-ide-mcp-server.el.
Signature
(claude-code-ide-mcp-server-update-last-active-buffer SESSION-ID BUFFER)
Documentation
Update the last active buffer for SESSION-ID to BUFFER.
This should be called when the user switches to a different buffer in the project to ensure MCP tools execute in the correct context.
Source Code
;; Defined in /nix/store/yjvbhwl7p6zrbw9xlnni7y4hra8sa3pl-emacs-packages-deps/share/emacs/site-lisp/claude-code-ide-mcp-server.el
(defun claude-code-ide-mcp-server-update-last-active-buffer (session-id buffer)
"Update the last active buffer for SESSION-ID to BUFFER.
This should be called when the user switches to a different buffer
in the project to ensure MCP tools execute in the correct context."
(when-let* ((session (gethash session-id claude-code-ide-mcp-server--sessions)))
;; Store the result: plist-put only mutates in place when the key
;; already exists in the list
(puthash session-id (plist-put session :last-active-buffer buffer)
claude-code-ide-mcp-server--sessions)
(claude-code-ide-debug "Updated last active buffer for session %s to %s"
session-id (buffer-name buffer))))