Repository navigation
fix: keep the live ponytail level across context compaction - #1074
Merged
DietrichGebert merged 2 commits intoOct 13, 2026
Merged
Conversation
SessionStart also fires on compact, and the activate hook always reset the flag to the default level. A session switched to /ponytail ultra fell back to full after compaction, and a session stopped with "stop ponytail" was switched back on. Codex fires the same compact source. The activate hook now reads the source from the JSON Claude Code and Codex pipe on stdin, and keeps the live level (or stays off) on compact. Startup, resume and clear still start at the default level. Like the mode tracker, it never waits on stdin for more than a second and falls back to the default level (DietrichGebert#443). The hook entry itself is unchanged: Codex trusts a hook by a hash of its matcher and command, and skips a changed hook until the user approves it again, so a new or edited entry would have dropped the ruleset there.
keyclaw6
added a commit
to keyclaw6/ponytail
that referenced
this pull request
Oct 11, 2026
Fork-only: carries DietrichGebert#1074 (compaction keeps the live level) until upstream merges it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p in a child process)
Owner
|
Thanks! Tested it in Claude Code: on main a real /compact dropped ultra back to full, with this PR it stays ultra, and after "stop ponytail" it stays off. Merged, will be in the next release. |
Merged
5 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
SessionStart also fires on compaction (
source: "compact"), and the activate hook always reset the flag to the default level. So:/ponytail ultrafell back tofullafter compaction,Codex fires the same
compactsource.Fix
hooks/ponytail-activate.jsnow readssourcefrom the JSON that Claude Code and Codex pipe on stdin:compact: keep the live level, or stay off if the session was stopped,startup,resume,clear: start at the default level, as before.Like the mode tracker, it never waits on stdin for more than a second, and falls back to the default level (#443).
The hook entry in the manifests is unchanged on purpose: Codex trusts a hook by a hash of its matcher and command, and skips a changed hook until the user approves it again. A new or edited entry would have dropped the ruleset there.
Tests
tests/hooks.test.js: compact keepsultra, compact after "stop ponytail" stays off, startup still resets to the default.tests/hooks-windows.test.js: updated for the stdin read.node scripts/check-rule-copies.jsandnode scripts/check-versions.jspass.Note: on my Windows machine, two failures also show up on an untouched
main:tests/correctness.test.js(pandas one-liner) and the#1032nudge-path assertion attests/hooks.test.js:319, which aborts the rest of that file. I ran the rest ofhooks.test.jswith that one assertion commented out, and it passes. CI on Linux should show the full picture.