Your agent can, and probably should have per environment tools. Here I run my agent in 4 “environments”:
- tui: from terminal, usually for coding sessions
- systemd: persistent tmux so I can chat using telegram
- headless: transient cron job sessions for background tasks
- subagent: special pi subprocess spawned in other environments
Naturally, not all tools fit to all environments. For example, I don’t want a background subagent to create a plan and ask for approval, neither my coding session to be polluted with my personal todo list.
So I built a system where at startup each one of those environments is declared, and then the tools are loaded conditionally to the environments they are built for.
You can probably replicating this by asking your harness of choice to make a tool available when some environment variable is set, and then start the harness with that environment.