Skip to content

chore: Add Claude session hooks for automated dependency installation and testing - #835

Merged
krlmlr merged 3 commits into
mainfrom
claude/setup-package-dependencies-kpktr
Apr 21, 2026
Merged

chore: Add Claude session hooks for automated dependency installation and testing#835
krlmlr merged 3 commits into
mainfrom
claude/setup-package-dependencies-kpktr

Conversation

@krlmlr

@krlmlr krlmlr commented Apr 21, 2026

Copy link
Copy Markdown
Member

Summary

This PR adds Claude IDE integration configuration to automate dependency management and testing workflows for the pillar R package. A new session start hook is configured to run whenever a Claude session begins.

Key Changes

  • Added .claude/settings.json: Configures Claude IDE hooks, specifically a SessionStart hook that triggers a bash script
  • Added .claude/hooks/session-start.sh: A bash script that automatically:
    • Installs all hard and soft dependencies for the pillar R package using remotes::install_deps()
    • Runs the local test suite using testthat::test_local()

Implementation Details

  • The session start hook ensures a consistent development environment by installing dependencies every time a Claude session begins
  • The script uses set -euo pipefail for strict error handling
  • Both installation and testing are run with appropriate flags (dependencies = TRUE, quiet = TRUE) to ensure comprehensive dependency resolution and clean output
  • This automation reduces manual setup steps and helps catch issues early in the development workflow

https://claude.ai/code/session_01GnQ8dLwYqBS5PwiNy3o7Fm

claude and others added 3 commits April 21, 2026 17:59
…n tests

- Install all hard and soft dependencies via remotes::install_deps(dependencies = TRUE)
- Run testthat::test_local() on session startup
- Ensures all required packages are available for development and testing in Claude Code on the web

https://claude.ai/code/session_01GnQ8dLwYqBS5PwiNy3o7Fm
Replaced remotes and testthat commands with pak for dependency installation.
Exclude Claude Code configuration directory from package builds.

https://claude.ai/code/session_01GnQ8dLwYqBS5PwiNy3o7Fm
@krlmlr krlmlr changed the title Add Claude session hooks for automated dependency installation and testing chore: Add Claude session hooks for automated dependency installation and testing Apr 21, 2026
@krlmlr
krlmlr enabled auto-merge (squash) April 21, 2026 18:30
@krlmlr
krlmlr merged commit 68d17ac into main Apr 21, 2026
5 of 6 checks passed
@krlmlr
krlmlr deleted the claude/setup-package-dependencies-kpktr branch April 21, 2026 18:33
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.

2 participants