Skip to content

Add a SessionStart hook so Claude Code web/remote sessions can lint and (partially) validate automatically #92

Description

@kmatzen

Problem

Claude Code on the web/remote sessions for this repo start in a plain Linux container with no Swift toolchain and no SwiftLint installed, so an agent can't even run swiftlint lint (which CI enforces via swiftlint lint --strict per CONTRIBUTING.md) before pushing — style violations are only caught once CI runs on macOS.

Proposal

Add .claude/hooks/session-start.sh (registered via .claude/settings.json SessionStart hook) that, when $CLAUDE_CODE_REMOTE=true:

  • Installs a Linux SwiftLint binary release (SwiftLint publishes Linux binaries/Docker images) so swiftlint lint can run standalone against changed files, matching the CI check.
  • If/when Enable Linux-only unit testing for pure-logic modules (no Xcode required) #91 (Linux-testable FacettCore package) lands, also bootstraps a Linux Swift toolchain (e.g. via swift.org's Linux download or swiftly) so swift test works out of the box in every new session, no manual setup.

Why this belongs in the repo, not just "ideas"

Once merged to main, this hook applies automatically to every future Claude Code web session on this repo (per the session-start-hook mechanism), so it's a one-time investment rather than something to redo per session.

Scope note

This only closes the linting gap immediately. Full xcodebuild build/test (SwiftUI, CoreBluetooth, UI tests) is a hard macOS/Xcode requirement and out of scope here — see #91 for the plan to make the pure-logic subset testable on Linux, and consider a macOS-based Claude Code remote environment (self-hosted runner) as a separate, heavier option if full-suite validation inside an agent session is ever needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions