Function: claude-code-ide-send-prompt
claude-code-ide-send-prompt is an interactive and natively compiled
function defined in claude-code-ide.el.
Signature
(claude-code-ide-send-prompt &optional PROMPT SESSION)
Documentation
Send a prompt to a Claude Code terminal.
When called interactively, reads a prompt from the minibuffer. When called programmatically, sends the given PROMPT string; SESSION overrides the automatic instance resolution.
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-send-prompt (&optional prompt session)
"Send a prompt to a Claude Code terminal.
When called interactively, reads a prompt from the minibuffer.
When called programmatically, sends the given PROMPT string; SESSION
overrides the automatic instance resolution."
(interactive)
(let ((session (or session
(claude-code-ide--resolve-session 'auto "Send prompt to Claude instance: "))))
(if-let* ((buffer (and session (claude-code-ide-mcp-session-buffer session))))
(let ((prompt-to-send (or prompt (read-string "Claude prompt: "))))
(when (not (string-empty-p prompt-to-send))
(with-current-buffer buffer
(claude-code-ide--terminal-send-string prompt-to-send)
;; Small delay to ensure prompt text is processed before sending return
(sit-for 0.1)
(claude-code-ide--terminal-send-return))
(claude-code-ide-debug "Sent prompt to Claude Code: %s" prompt-to-send)))
(user-error "No Claude Code session for this project"))))