Always use emacsclient instead of emacs. This applies to all Emacs operations: user requests, byte compilation, check-parens, running ERT tests, and any other elisp evaluation.
The user has an Emacs server running. All Emacs operations must go through emacsclient, never emacs or emacs --batch. This includes both user-requested actions and agent-initiated operations like byte compilation, syntax checking, or running tests.
emacsclient --no-wait "/path/to/file"emacsclient --eval '(some-function)'emacsclient --no-wait +42 "/path/to/file"emacsclient --eval '
(byte-compile-file "/path/to/file.el")'
emacsclient --eval '
(with-temp-buffer
(insert-file-contents "/path/to/file.el")
(check-parens))'
emacsclient --eval '
(progn
(load "/path/to/test-file.el" nil t)
(ert-run-tests-batch-and-exit "pattern"))'
emacsclient, never emacs or emacs --batch.--no-wait when opening files so the command returns immediately.--eval when evaluating elisp.--eval elisp across multiple lines with proper indentation.emacsclient commands via the Bash tool.