I would like to specify a looping improvement process and have Claude follow it endlessly until a terminal condition is met.
I have tried doing this a few ways, the end result is that with compaction, Claude eventually ends his turn. It feels like Claude forgets the strict, looping, prime directive and falls back to pursuing the goal of improvement.
The looping improvement process is documented in a file such that no context other than ‘do what it says’ is necessary to execute the process.
One idea I had was hooks to actually block the turn ending unless the exit criteria was met. What is the right approach?
Additional context
My use case is a running a heavy script that can take 2-4 hours to complete (running in the GPU utilizing all compute).
Claude’s job is to periodica…
I would like to specify a looping improvement process and have Claude follow it endlessly until a terminal condition is met.
I have tried doing this a few ways, the end result is that with compaction, Claude eventually ends his turn. It feels like Claude forgets the strict, looping, prime directive and falls back to pursuing the goal of improvement.
The looping improvement process is documented in a file such that no context other than ‘do what it says’ is necessary to execute the process.
One idea I had was hooks to actually block the turn ending unless the exit criteria was met. What is the right approach?
Additional context
My use case is a running a heavy script that can take 2-4 hours to complete (running in the GPU utilizing all compute).
Claude’s job is to periodically analyze log file output, identify issues, fix them and re-start. Batches are incremental.
Inevitably Claude fixed some issues and then presents options for me to choose between. Unfortunately at that time I am asleep.
I can think of other architectures for doing this like periodically running 1-shot incremental operations but trying to figure out if this is just cursed.