This document provides a detailed overview of the steps performed by the install.sh and uninstall.sh scripts.
The install.sh script sets up the Claude Code Tracker on your system. It performs the following actions:
- Platform Detection: Identifies your operating system (macOS, Linux, WSL, or Windows/Git Bash) to tailor subsequent steps.
- Directory Setup: Creates the necessary directory structure for the tracker:
~/.claude_code_tracker/: The main installation directory where all core scripts reside.~/.claude_code_tracker/config/: A dedicated directory for configuration files.~/.claude_code_tracker/data/work/: A dedicated directory for work session data files.
- File Copying: Copies all scripts and files from the
src/directory of the project into the~/.claude_code_tracker/installation directory. This includesfunctions.sh,claude_code_wrapper.sh,statusline.sh, andgit-hooks/prepare-commit-msg. - Claude Code Script Integration:
- Creates the
~/.claude/scripts/directory (if it doesn't exist). - Copies
claude_code_wrapper.shinto~/.claude/scripts/, ensuring it is configured with the correct tracker installation path (INSTALL_DIR). This script acts as the main interface for Claude Code's status line.
- Creates the
- Configuration Prompts: If configuration files do not exist, the script interactively prompts you for:
- The desired separator for the Claude Code status line (e.g.,
\\nfor newline,for space). - Your Jira base URL (e.g.,
https://jira.yourcompany.com/browse). - Your Jira ticket regex (e.g.,
[A-Z]+-[0-9]+), with an interactive builder. These values are saved in~/.claude_code_tracker/config/claude_code_statusline_config,claude_code_jira_config, andclaude_code_jira_regex_configrespectively. If these files already exist, your custom settings are preserved.
- The desired separator for the Claude Code status line (e.g.,
- Claude Code
settings.jsonModification: The script automatically updates your Claude Codesettings.jsonfile to setstatusLine.commandto~/.claude/scripts/claude_code_wrapper.sh. If an originalstatusLine.commandexisted, it is backed up and later restored byclaude_code_wrapper.sh. - Git Hook Setup: Configures global Git hooks by:
- Copying the
prepare-commit-msgscript fromgit-hooks/to~/.git-templates/hooks/. - Making the hook executable.
- Configuring Git to use
~/.git-templatesas its global template directory, ensuring theprepare-commit-msghook is applied to new repositories.
- Copying the
- Shell Integration: Adds a
sourcecommand for~/.claude_code_tracker/functions.shto your shell's configuration file (.zshrc,.bashrc, or.bash_profile). This ensures that the tracker's functions and auto-detection mechanisms are loaded automatically when you start a new terminal session.
The uninstall.sh script systematically removes the Claude Code Tracker from your system. It performs the following actions:
- Shell Configuration Removal: Locates your shell's configuration file (e.g.,
.zshrc,.bashrc) and removes thesourcecommand and associated comments that were added by the installer. - Claude Code
settings.jsonCleanup: Automatically cleans up your Claude Codesettings.jsonfile. If an originalstatusLine.commandwas backed up during installation, it will be restored. Otherwise, thestatusLineentry will be removed. Ifsettings.jsonbecomes empty, it will be deleted. - Work History Management: Prompts you to confirm whether you want to delete your work history data, which is stored in
~/.claude_code_tracker/data/work/. - Installation Directory Removal: Deletes the main
~/.claude_code_tracker/installation directory and all its contents (includingconfig/anddata/work/if not already removed). - Claude Code Scripts Cleanup: Removes the
claude_code_wrapper.shscript from~/.claude/scripts/. If the~/.claude/scripts/directory becomes empty, it will prompt you to confirm its removal. - Configuration File Removal: Prompts you individually to confirm whether you want to delete the specific configuration files:
claude_code_jira_config,claude_code_jira_regex_config, andclaude_code_statusline_configfrom~/.claude_code_tracker/config/. - Global Git Hooks Removal: Prompts you to confirm whether you want to unset the global Git template directory configuration and remove the
prepare-commit-msghook from~/.git-templates/hooks/. - Restart Terminal Instruction: Advises you to restart your terminal for all changes to take effect.