Skip to content

[harness] executable_session-cleanup.sh missing set -euo pipefail header #157

@claude

Description

@claude

Problem

dot_claude/scripts/executable_session-cleanup.sh is missing the required set -euo pipefail header mandated by .claude/rules/shell-scripts.md. The script jumps straight from the shebang/comment to find and true with no error mode:

#!/usr/bin/env bash
# SessionStart hook: Clean up stale session flag files from /tmp.
# Deletes flag files older than 1 day for both current and legacy patterns.

find /tmp -maxdepth 1 \( -name "claude-learning-briefing-*" -o -name "claude-harness-checked-*" \) -mtime +0 -delete 2>/dev/null
true

Issue #99 covers executable_notify-wrapper.sh but not this script.

Files

  • dot_claude/scripts/executable_session-cleanup.sh (lines 1–6)
  • .claude/rules/shell-scripts.md — rule requiring set -euo pipefail after shebang

Suggested Action

Add set -euo pipefail on line 2 (after the shebang, before the comment block):

#!/usr/bin/env bash
set -euo pipefail
# SessionStart hook: Clean up stale session flag files from /tmp.

Note: the 2>/dev/null on the find line already suppresses permission errors, so adding set -euo pipefail won't break the silent-failure behavior for the cleanup case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    harness-analysisAutomated harness improvement suggestions

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions