Function: claude-code-ide-clear-selection
claude-code-ide-clear-selection is an interactive and natively
compiled function defined in claude-code-ide.el.
Signature
(claude-code-ide-clear-selection)
Documentation
Drop the file or selection Claude shows in its prompt.
The prompt's "In <file>" or "N lines selected" label disappears and the next prompt carries no opened-file or selection reminder. The file stays dismissed while the cursor moves inside it; selecting a region or visiting another file shares editor context again. Targets one instance: the current terminal, the sole or sole-visible instance, else the most recently used one (prefix argument picks).
Key Bindings
This command is not in any keymaps.
Source Code
;; Defined in /nix/store/yjvbhwl7p6zrbw9xlnni7y4hra8sa3pl-emacs-packages-deps/share/emacs/site-lisp/claude-code-ide.el
;;;###autoload
(defun claude-code-ide-clear-selection ()
"Drop the file or selection Claude shows in its prompt.
The prompt's \"In <file>\" or \"N lines selected\" label disappears and
the next prompt carries no opened-file or selection reminder. The file
stays dismissed while the cursor moves inside it; selecting a region or
visiting another file shares editor context again.
Targets one instance: the current terminal, the sole or sole-visible
instance, else the most recently used one (prefix argument picks)."
(interactive)
(let ((session (claude-code-ide--resolve-session
'auto "Clear editor context of Claude instance: ")))
(if (and session (claude-code-ide-mcp-session-client session))
(progn
(claude-code-ide-mcp-clear-selection session)
(claude-code-ide-debug "Cleared editor context"))
(user-error "Claude Code is not connected. Please start Claude Code first"))))