Components of a Coding Agent
https://magazine.sebastianraschka.com/p/components-of-a-coding-agent
Components of a Coding Agent
https://magazine.sebastianraschka.com/p/components-of-a-coding-agent
If all you want is a program that calls the model in a loop and offers a bash tool, then ask Claude Code to build that. You won't like it though!
For a preview of what it'd be like, just tell your AI chat app that you'll run bash commands for it, and please change the app in your "current directory" to "sort the output before printing it", or some such request.
Claude Code with Opus 4.6 regularly uses sed for multi-line edits, in my experience. On top of it, Pi is famously only exposing 4 tools, which is not just Bash, but far more constrained than CCs 57 or so tools.
So, yes, it can work.