use slash commands in print/headless/non-interactive mode

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 5 comments · opened Apr 21, 2025 · closed May 8, 2025
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

hi,

i'd like to use slash commands in non-interactice mode, e.g. claude -p "/cost" but it's not possible at the moment.

will this be available in future or is there any way to do it?

View original on GitHub ↗

5 Comments

je2ryw · 1 year ago

Totally agree — having project-scoped custom slash commands with support for arguments would be incredibly useful in the CI/CD or other automation scenarios.

tino · 1 year ago

I'm using claude -p /project:my-custom-command and that works?

bcherny collaborator · 1 year ago

yep, this is supported

tino · 1 year ago

But there are quite some issues with it. See #1048 and #1339

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.