Fix Goose CLI projects.json Parse Error
Fix the warning Failed to update project tracker with instruction: Failed to parse projects.json file that can occur after updating Goose CLI, caused by malformed JSON in the project tracker file.
Steps
- Locate the projects.json file
The project tracker file is at:
~/.local/share/goose/projects.jsonVerify it exists:
ls -la ~/.local/share/goose/projects.json - Validate the JSON
Check whether the file contains valid JSON:
python3 -m json.tool ~/.local/share/goose/projects.json > /dev/nullIf this reports an error, the file is malformed and needs repair.
- Inspect the file for common issues
Read the file and look for:
- Extra trailing closing braces
}at the end of the file (most common cause) - Duplicate keys or other JSON syntax errors
- Truncated or corrupted content
- Extra trailing closing braces
- Repair the JSON
Fix the identified issues. The most common problem is extra
}}or}appended to the end of the file after an update. Remove the extra braces so the file ends with a single closing}matching the opening{of the root object. The correct structure is:{ "projects": { "/path/to/project": { "path": "/path/to/project", "last_accessed": "...", "last_instruction": "...", "last_session_id": "..." } } } - Validate the fix
Confirm the repaired file is valid JSON:
python3 -m json.tool ~/.local/share/goose/projects.json > /dev/null
Notes
- If the file is too corrupted to repair, it is safe to replace it with an empty project tracker:
{"projects": {}}. Goose will repopulate it as you use different project directories. - Do not leave backup files behind after the fix — clean up any
.bakcopies.
Verification
python3 -m json.tool ~/.local/share/goose/projects.jsonexits with no errors- The Goose CLI warning no longer appears on next session start
Changelog
See CHANGELOG.md for version history.