mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-05 06:07:57 +01:00
execute_inject glued the 20-line handoff block onto every dispatched prompt. Each Claude turn then tried to write the handoff file, hit the existing-file guard, and prompted the user "Do you want to overwrite revamp-it.md?" — surfaced live during cloud-dispatch verification. Also wasted ~500 input tokens per inject across every project running a Claude/Cursor/Codex agent. Gate the append on /tmp/agent-handoff-sent-<tab>. After a successful inject, touch the sentinel. Clear it everywhere the agent process is considered fresh: - close_tab (tab destroyed) - hard_stop / close_session (lifecycle dispatch) - launch_agent (explicit launch) - switch_agent (different agent process) - auto-launch branch in execute_inject (daemon spun the agent itself) Net result: first dispatch of each session carries the template; every subsequent dispatch in the same session is just the user's prompt.