✨ Visual Editor

close

Thread Truncated

Only the first 20 tweets are shown to ensure high-quality rendering and prevent image size issues.

palette Canvas & Background

Gradient:arrow_forward
Text Color:
135°

style Card Style

40px
16px

text_fields Typography

16px
Thariq
@trq212
One of the hardest parts of building an agent harness is constructing its action space.
Thread image
Thariq
@trq212
Claude acts through Tool Calling, but there are a number of ways tools can be constructed in the Claude API with primitives like bash, skills and recently code execution (read more about programmatic tool calling on the Claude API in ).
Thariq
@trq212
Given all these options, how do you design the tools of your agent? Do you need just one tool like code execution or bash? What if you had 50 tools, one for each use case your agent might run into?
Thariq
@trq212
To put myself in the mind of the model I like to imagine being given a difficult math problem. What tools would you want in order to solve it? It would depend on your own skills!
Thariq
@trq212
Paper would be the minimum, but you’d be limited by manual calculations. A calculator would be better, but you would need to know how to operate the more advanced options. The fastest and most powerful option would be a computer, but you would have to know how to use it to write and execute code.
Thariq
@trq212
This is a useful framework for designing your agent. You want to give it tools that are shaped to its own abilities. But how do you know what those abilities are? You pay attention, read its outputs, experiment. You learn to see like an agent.
Thariq
@trq212
Here are some lessons we’ve learned from paying attention to Claude while building Claude Code.
Thariq
@trq212
# Improving Elicitation & the AskUserQuestion tool
Thariq
@trq212
Thread image
Thariq
@trq212
When building the AskUserQuestion tool, our goal was to improve Claude’s ability to ask questions (often called elicitation).
Thariq
@trq212
While Claude could just ask questions in plain text, we found answering those questions felt like they took an unnecessary amount of time. How could we lower this friction and increase the bandwidth of communication between the user and Claude?
Thariq
@trq212
## Attempt #1 - Editing the ExitPlanTool
Thariq
@trq212
The first thing we tried was adding a parameter to the ExitPlanTool to have an array of questions alongside the plan. This was the easiest thing to implement, but it confused Claude because we were simultaneously asking for a plan and a set of questions about the plan. What if the user’s answers conflicted with what the plan said? Would Claude need to call the ExitPlanTool twice? We needed another approach.
Thariq
@trq212
(you can read more about why we made an ExitPlanTool in )
Thariq
@trq212
## Attempt #2 - Changing Output Format
Thariq
@trq212
Next we tried modifying Claude’s output instructions to serve a slightly modified markdown format that it could use to ask questions. For example, we could ask it to output a list of bullet point questions with alternatives in brackets. We could then parse and format that question as UI for the user.
Thariq
@trq212
While this was the most general change we could make and Claude even seemed to be okay at outputting this, it was not guaranteed. Claude would append extra sentences, omit options, or use a different format altogether.
Thariq
@trq212
## Attempt #3 - The AskUserQuestion Tool
Thariq
@trq212
Thread image
Thariq
@trq212
Finally, we landed on creating a tool that Claude could call at any point, but it was particularly prompted to do so during plan mode. When the tool triggered we would show a modal to display the questions and block the agent's loop until the user answered.
Generated by Thread Navigator
100%
view_carousel Carousel Studio NEW
Press + S to quick-export