# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## What this is `is_installed` is a single Bash script for Slackware (and derivatives) that queries the package database in `/var/log/packages` (each installed package = one file there). No build, no tests, no dependencies beyond Bash + coreutils + grep. ## Layout - `is_installed` — the script. All logic lives here. - `is_installed.bash-completion` — bash completion. Sourced/installed separately (e.g. into `/usr/share/bash-completion/completions/is_installed`). ## Install The user runs this from `~/bin` (which is on their PATH). Install the script with: ``` install -Dm0755 is_installed ~/bin/is_installed ``` Re-run that after editing to deploy. The bash completion is optional and installed separately: ``` install -m0644 is_installed.bash-completion \ /usr/share/bash-completion/completions/is_installed ``` Note: `is_installed help` exits `69` (`SHOWHELP`), not `0`. That is by design, not a failure. ## Architecture Dispatch happens at the bottom `case` on `$1`: - `file-search ` → `search_file()`: greps file contents of every package manifest in `$PKGS_PATH`, groups hits by package name. - `info ` → `info()`: `less` the matching manifest. - `help` → `help()`. - anything else → treated as a package-name query → `search_package()`: lists `$PKGS_PATH` and greps the names. `PKGS_PATH` (`/var/log/packages`) is the single source of truth and is hardcoded. The completion script mirrors this path in the `info` case, so changing the path means editing both files. Exit codes are named vars at the top: `SHOWHELP=69`, `E_NOPKGFOUND=70`, `E_NOARGS=71`. Reuse these rather than literals. Output uses ANSI color vars (`RED`/`ORANGE`/`GREEN`/`MAGENTA`/`NC`) with `echo -e`. Match this style for any new user-facing output.