This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is the shelltime installation repository - a collection of shell scripts that install the shelltime CLI and configure shell hooks for zsh, bash, and fish. Shelltime tracks shell command execution times.
install.bash- Main installation script that downloads shelltime CLI binaries and sets up shell hookshooks/- Shell-specific hook scripts that track command execution:zsh.zsh- Uses zsh's nativepreexecandprecmdhooksbash.bash- Usesbash-preexeclibrary for preexec/precmd functionalityfish.fish- Uses fish'sfish_preexecandfish_postexecevents
Run the CI workflow locally or on GitHub Actions:
# The test workflow runs on ubuntu-latest and macos-latest
# Testing shells: zsh, fish, bash
bash ./install.bashThe CI verifies:
- Installation script runs successfully across shells
- Shell configuration files are properly sourced
- Hook files are placed in
~/.shelltime/hooks/
Each shell hook script:
- Checks if
shelltimeCLI is available - Runs
shelltime gcon shell startup - Creates a unique
SESSION_IDper shell session - Tracks commands via
shelltime trackwith-p=pre(before execution) and-p=post(after execution) - Skips tracking for
exit,logout, andrebootcommands
Bash requires the external bash-preexec.sh library (downloaded during installation) since bash doesn't have native preexec/precmd hooks.
- CLI binary:
~/.shelltime/bin/shelltime - Hook scripts:
~/.shelltime/hooks/ - Daemon directory:
~/.shelltime/daemon/
Follow Conventional Commits with scope:
fix(hooks): correct command tracking in bash
feat(install): add support for ARM64 Linux
refactor(zsh): simplify preexec function