feat(claude): rules and hints from the background-session audit - #14
Draft
CosmDandy wants to merge 1 commit into
Draft
feat(claude): rules and hints from the background-session audit#14CosmDandy wants to merge 1 commit into
CosmDandy wants to merge 1 commit into
Conversation
Eight CLAUDE.md lines, one per loss pattern found across six autonomous sessions: edits through Edit/Write instead of heredocs, a numeric check before the screenshot loop, thresholds from a median, one wait per background task, stop what you started, references read once by a subagent, review per finished part, foreign tasks to a new session, gh pr create after push. bashhint: hint on the worktree-isolation rejection with a per-session repeat counter, and on a push whose output shows the branch has no PR. precompact: append what the transcript tail already read and ran, so the summary stops losing it.
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
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Source: audit of six autonomous sessions on kvt-cosmdandy-dev (2026-09-02..08); report at ~/.claude/reports/2026-09-08-kvt-session-audit.md locally.
CLAUDE.md — one line per loss pattern
gh pr createafter pushHooks
posttooluse-bashhint.sh: hint on the worktree-isolation rejection ("too complex to verify") with a per-session repeat counter; hint on a push whose output says the branch has no PRprecompact-snapshot.sh: append what the transcript tail already read and ran, so the summary stops losing itposttooluse-bashhint.test.sh(9 cases)Checks
shellcheck clean; bashhint 9/9; pretooluse-guard 187/0; session-lifecycle 25/0; precompact smoke-tested on a synthetic transcript.
Unverified: whether the harness routes its own worktree rejection through PostToolUseFailure (the hook is registered there); if it does not, the first hint never fires and only the CLAUDE.md line applies.