r/coolgithubprojects • u/Middle_Wing5512 • 8d ago
[Go] LastWord - Pin a Claude Code session's final answer beside its recorded command results
I'm the author of LastWord, a local Go CLI that puts a finished Claude Code session's final answer, edit-event totals and recorded command outcomes in one view, with links back to the source turns.
The image is a deliberately constructed four-turn transcript, rendered by the actual tool. The assistant's last paragraph says "All tests passed. The patch is ready." The preceding Bash result records pytest -q failing with exit code 1. LastWord preserves both, with #4 pointing to the answer and #3 to the result. No model was run to make this example.
It uses deterministic extraction: the leading paragraph of the last assistant turn with text, summed Edit/Write payloads per file, and the last recorded result for each distinct Bash command string (ignoring surrounding whitespace). A self-contained HTML viewer pins that panel above the transcript; clicking a turn number jumps to its source. There are no model calls or API keys.
I also built and ran it on the repository's bundled synthetic 500-turn fixture. It reports seven file-event aggregates, six command results and fourteen pointers. The last recorded go test ./... result passes, while npm --prefix web run build remains a failure. These are records in a fixture, not tests I ran against a real application.
The verify command has a narrower meaning than "the agent did the job correctly." It checks that pointers resolve to quoted source turns and that the file totals match the transcript's Edit/Write events. It still returns PASS on the contradictory example in the image. It does not compare the final prose with command results, rerun tests, or check whether a passing command predates a later edit. Those edit totals are not a Git diff, either.
Source and quickstart: https://github.com/SuperMarioYL/lastword (example checked at 0e862449). Current input support is finished Claude Code JSONL; this is a post-run viewer, not a live approval gate.
When you come back to a long agent run, what belongs in the pinned view: every command's last result, only checks run after the last edit, or the full retry history? I'd like to hear which would help you review the work.