Created
September 29, 2025 16:30
-
-
Save krlohnes/960646d66dc2a3ac707b64c67f6af001 to your computer and use it in GitHub Desktop.
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
#! /usr/bin/bash | |
#requires https://gist.github.com/krlohnes/4b25c05c896378937b842d8ba81777ac | |
if ! "$(command -v jq &>/dev/null;)": | |
then | |
echo "jq must be installed for this script to work" | |
exit 1 | |
fi | |
if ! command -v sponge &>/dev/null; | |
then | |
echo "sponge must be installed for this script to work" | |
exit 1 | |
fi | |
PROJECT_DIR=$(echo "$PWD" | sed -E "s#[/\.]#-#g") | |
echo "Fixing tool uses in $PROJECT_DIR" | |
pushd "$HOME/.claude/projects/$PROJECT_DIR" || exit | |
for file in *.jsonl | |
do | |
echo "Fixing $file" | |
filter_tool_messages.jq "$file" | sponge "$file" | |
done | |
echo "Done fixing tool uses. Restart claude and resume from where you left off." | |
popd || exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment