Skip to main content Module rewrite_registry Copy item path Source RewriteEntry Category REWRITE_COMMANDS Single source of truth for all commands that lean-ctx rewrites/compresses.
Used by: hook_handlers (PreToolUse), hooks.rs (bash scripts), cli.rs (shell aliases). bash_case_pattern Generates a bash case pattern for rewrite scripts.
e.g. git\ *|gh\ *|cargo\ *|npm\ *|... hook_bare_commands Commands eligible for PreToolUse hook (bare command match, no trailing space).
Used for commands like eslint, prettier, tsc that may run without args. hook_prefixes Commands eligible for PreToolUse hook rewriting (IDE hooks).
Excludes rg (search tools) and FileRead (handled separately in hook_handlers). is_file_read_command Check if a command is a file-read alternative (cat/head/tail) that should be
rewritten to lean-ctx read rather than lean-ctx -c. is_rewritable_command Check if a command string matches a rewritable prefix (for hook handlers).
Excludes Search, FileRead, and DirList (all have dedicated rewrite paths). shell_alias_commands All command names for shell alias generation. shell_alias_list Space-separated list for shell alias arrays.