TrackGo Cursor Agent Tool-Call Loop

TrackGo Cursor Agent Tool-Call Loop A workflow diagram generated by Archify. 01 / User surface 02 / Agent runtime EX / Policy & exception 04 / Tools & observability Intake Select + gate Execute + record Policy boundary Exception handling Observability Tool execution Shell run User prompt · Cursor chat · User surface › Intake User prompt Cursor chat Final reply · answer + diffs · User surface › Execute + record Final reply answer + diffs Parent agent · rules + skills · Agent runtime › Intake Parent agent rules + skills Select tool · Shell or files · Agent runtime › Select + gate Select tool Shell or files Shell hook · before-shell.sh · Policy & exception › Policy boundary › Select + gate Shell hook before-shell.sh Consent wait · permission ask · Policy & exception › Exception handling › Execute + record Consent wait permission ask Revise command · wrap in tmux · Policy & exception › Exception handling › Execute + record Revise command wrap in tmux Session files · .cursor/sessions · Tools & observability › Observability › Intake Session files .cursor/sessions Compact hint · afterFileEdit · Tools & observability › Observability › Intake Compact hint afterFileEdit File tools · Read / Grep / Write · Tools & observability › Tool execution › Select + gate File tools Read / Grep / Write Run Shell · permission allow · Tools & observability › Shell run › Execute + record Run Shell permission allow plan next tool afterFileEdit tool result allow ask sessionStart other tools dev or git push agent_message Legend User UI Agent logic Policy Tool action Context / trace External system

What the hook gates

  • • Asks on git push and non-tmux * run dev; never denies; errors exit 0

Evidence the repo writes

  • • sessionStart loads 7-day .tmp files; afterFileEdit logs at 50 calls