Skip to content

fix: write display cache in run.go so show-cache UserPromptSubmit hook works#44

Merged
claude[bot] merged 1 commit intomainfrom
claude/issue-42-20260227-0443
Feb 27, 2026
Merged

fix: write display cache in run.go so show-cache UserPromptSubmit hook works#44
claude[bot] merged 1 commit intomainfrom
claude/issue-42-20260227-0443

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Feb 27, 2026

Summary

  • Extracted shared displayCachePath() and writeDisplayCache() helpers into a new cmd/displaycache.go file
  • Updated cmd/showcache.go to use displayCachePath() instead of inlining the UID/path logic
  • Added writeDisplayCache(output) calls in runHandler and runWithoutCache in cmd/run.go (after the fmt.Print(output) stdout emit), so the display cache is populated for every successful run
  • The write uses a secure atomic pattern (CreateTemp + Rename) matching what scripts/uncompact-hook.sh already does

Root Cause Fixed

cmd/run.go was only writing to stdout. The UserPromptSubmit hook (show-cache) reads the UID-based temp file, which was only ever written by the shell plugin (scripts/uncompact-hook.sh), not the Go binary. This made the hook a permanent no-op for uncompact install users.

Closes #42

Generated with Claude Code

…k works

Extract shared displayCachePath() and writeDisplayCache() helpers into
cmd/displaycache.go. Call writeDisplayCache() after stdout emit in both
runHandler and runWithoutCache so the UserPromptSubmit hook (show-cache)
actually has content to display for install users.

Closes #42

Co-Authored-By: Grey Newell <greyshipscode@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: claude[bot] <claude[bot]@users.noreply.github.com>
@claude claude bot merged commit b18e972 into main Feb 27, 2026
1 check passed
@claude claude bot deleted the claude/issue-42-20260227-0443 branch February 27, 2026 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: uncompact run never writes display cache — show-cache UserPromptSubmit hook is always a no-op for install users

0 participants