[FEATURE] Directly execute a tool with `/tool`
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
There are times when it becomes necessary to test and debug tool calls within a very specifically-configured CC environment. For example, I was recently working with custom PreToolUse hook scripts in a sandboxed CC environment. It is tricky to test and debug this with no way to directly invoke the tool in question. Yes, I can always prompt with something like run this bash command and nothing else: "ls -l ~/" - but results are not always consistent especially with how respect to how much of the output CC reveals.
Proposed Solution
A simple mechanism that will bypass the language model and simply invoke a tool directly and give complete output would be very helpful in such cases. I imagine something like: /tool Bash("ls -l ~/") which then executes the tool in the current environment and gives complete and detailed output of what is returned from the system.
Alternative Solutions
As I mentioned, I've tried prompting CC to run the tool, which it will, but is inconsistent with how much detail it reveals about the returned outputs. I've spent time digging through the logs, but they are a bit impenetrable. I'm testing out claude-devtools which may be my best solution, but it seems like having this way to just call the tool "raw" without passing through a language model could still be a good addition.
Priority
Medium - Would be very helpful
Feature Category
Developer tools/SDK
Use Case Example
Example scenario:
- I'm developing an agent that should be able to connect to my account on some website via a headless browser session (say, using
agent-browserorplaywrightfor example) - I want to give this agent a certain range of action, but also keep it in a sandboxed environment
- I want to screen any calls to
agent-browserthrough a PreToolUse hook script, to validate that it's not doing anything it shouldn't but also to inject appropriate session state, etc. - I would use this feature to test that the agent can use the tool appropriately and debug any issues with the hook script or the sandboxed environment that are preventing it from working correctly.
Additional Context
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗