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?
5 Comments
Totally agree — having project-scoped custom slash commands with support for arguments would be incredibly useful in the CI/CD or other automation scenarios.
I'm using
claude -p /project:my-custom-commandand that works?yep, this is supported
But there are quite some issues with it. See #1048 and #1339
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.