Skip to content

fix(bad): write session state to .claude/ instead of TMPDIR#5

Open
stephenleo wants to merge 3 commits intomainfrom
fix-gate
Open

fix(bad): write session state to .claude/ instead of TMPDIR#5
stephenleo wants to merge 3 commits intomainfrom
fix-gate

Conversation

@stephenleo
Copy link
Copy Markdown
Owner

Summary

  • Store bad-session-state.json in .claude/ (next to the statusline script) instead of the sandbox-restricted ${TMPDIR:-/tmp}/
  • bad-statusline.sh now resolves its own directory via $(dirname "$0") — no setup-time path substitution needed
  • gate-pre-continuation.md reads from .claude/bad-session-state.json (relative to project root)
  • Updated chaining template in setup-statusline-hook.md to match

Test plan

  • Run /bad setup on a fresh project and verify .claude/bad-session-state.json is created after the first API response
  • Trigger a gate-pre-continuation check and confirm session state is read correctly (context % and rate limits populated)
  • Verify chaining case: if a prior statusLine command exists, the chained script also writes to .claude/bad-session-state.json

🤖 Generated with Claude Code

stephenleo and others added 3 commits April 13, 2026 09:41
Store bad-session-state.json next to the statusline script in .claude/
so it persists reliably outside the sandbox-restricted temp directory.
Gate-pre-continuation now reads from .claude/bad-session-state.json
(relative to project root) — no setup-time path substitution required.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…opped chain

The ambiguous "stop at first file / skip bad-statusline.sh" wording caused
the scan to halt at priority 2 when bad-statusline.sh was already installed,
never reaching the original chain command (e.g. cship) at priority 4.
Rewrite Step 1 as explicit skip-and-continue vs stop-and-capture branches.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e positives

Firing the check exactly at resets_at risks hitting the API before the
quota has fully cleared. Adding a 600s buffer ensures the window has
settled before BAD re-checks and resumes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant