prompting cursor and claude code effectively7 / 9
the four-part prompt that actually works
The toy context_health function rejects a session when the total
token count is over 6000. The session log has six turns and is over
the limit. Drop the two oldest turns (turns 1 and 2) so the script
prints exactly healthy.
Expected output:
healthy
The break is on lines 2, 3 — but read the whole snippet first.
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _