# Behavior traces — ohmyzsh/ohmyzsh

> Canonical page: https://codevetter.com/unpack/ohmyzsh/behavior-traces

# Behavior traces — ohmyzsh/ohmyzsh

Scanned commit 86ef6555e068663736a33376e4055aca9c1acc89 (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Three flows matter most. Startup: .zshrc -> oh-my-zsh.sh guards -> env defaults -> check_for_upgrade -> fpath/compinit -> lib -> plugins -> custom -> theme. Update: startup hook -> epoch/frequency gates -> GitHub API compare -> upgrade.sh git rebase -> epoch write -> optional exec. Config mutation: omz subcommand -> awk rewrite of .zshrc -> zsh -n validation -> rollback or reload. Install is a fourth boundary: curl|sh -> git init/fetch -> .zshrc template -> chsh -> exec zsh.
- Startup sequence in order: ZSH_VERSION guard with omz_ptree diagnostics -> `emulate` mode check -> ZSH/ZSH_CUSTOM/ZSH_CACHE_DIR defaults -> mkdir cache/completions + fpath -> source tools/check_for_upgrade.sh -> plugin dirs into fpath -> SHORT_HOST -> compinit/zcompdump -> _omz_source each lib/*.zsh -> each plugin -> each $ZSH_CUSTOM/*.zsh -> theme -> LS_COLORS zstyle. — [oh-my-zsh.sh#L10-267](https://github.com/ohmyzsh/ohmyzsh/blob/86ef6555e068663736a33376e4055aca9c1acc89/oh-my-zsh.sh#L10-L267)
- Auto-update trace: check_for_upgrade.sh resolves zstyle ':omz:update' mode (legacy DISABLE_UPDATE_PROMPT/DISABLE_AUTO_UPDATE mapped to auto/disabled) -> bails on disabled/unwritable/non-tty -> sources .zsh-update and returns early inside the frequency window (default 13 days) -> handle_update takes update.lock -> is_update_available -> prompt ('Would you like to update? [Y/n]') or silent modes -> update_ohmyzsh runs upgrade.sh. — [tools/check_for_upgrade.sh#L14-55](https://github.com/ohmyzsh/ohmyzsh/blob/86ef6555e068663736a33376e4055aca9c1acc89/tools/check_for_upgrade.sh#L14-L55) [tools/check_for_upgrade.sh#L203-289](https://github.com/ohmyzsh/ohmyzsh/blob/86ef6555e068663736a33376e4055aca9c1acc89/tools/check_for_upgrade.sh#L203-L289)
- background-alpha update mode registers _omz_bg_update on precmd which forks handle_update and installs _omz_bg_update_status to report EXIT_STATUS/ERROR from .zsh-update on a later prompt. — [tools/check_for_upgrade.sh#L291-341](https://github.com/ohmyzsh/ohmyzsh/blob/86ef6555e068663736a33376e4055aca9c1acc89/tools/check_for_upgrade.sh#L291-L341)
- upgrade.sh execution order: re-exec under zsh if needed -> cd $ZSH -> parse -v/-i/-c flags -> rewrite legacy robbyrussell remotes -> set core.eol/autocrlf/fsck/rebase.autoStash git config -> checkout update branch -> git pull --rebase (or cooldown path: fetch + find first FETCH_HEAD commit older than cooldown days + merge --ff-only) -> run changelog.sh if interactive -> restore previous HEAD and autoStash. — [tools/upgrade.sh#L7-49](https://github.com/ohmyzsh/ohmyzsh/blob/86ef6555e068663736a33376e4055aca9c1acc89/tools/upgrade.sh#L7-L49) [tools/upgrade.sh#L205-341](https://github.com/ohmyzsh/ohmyzsh/blob/86ef6555e068663736a33376e4055aca9c1acc89/tools/upgrade.sh#L205-L341)
- Insecure-completion handling: unless ZSH_DISABLE_COMPFIX=true, compfix.zsh is sourced, compinit runs with -i to skip insecure dirs, and handle_completion_insecurities lists `compaudit` output with a chmod g-w,o-w fix hint. — [oh-my-zsh.sh#L153-164](https://github.com/ohmyzsh/ohmyzsh/blob/86ef6555e068663736a33376e4055aca9c1acc89/oh-my-zsh.sh#L153-L164) [lib/compfix.zsh](https://github.com/ohmyzsh/ohmyzsh/blob/86ef6555e068663736a33376e4055aca9c1acc89/lib/compfix.zsh)
- `omz plugin disable git` trace: omz -> _omz::plugin -> _omz::plugin::disable validates names against $plugins -> builds gsub() awk program -> awk .zshrc > .zshrc.new -> cp .zshrc .zshrc.bck -> mv .zshrc.new .zshrc -> `zsh -n` check -> rollback mv on syntax error -> _omz::reload execs ${ZSH_ARGZERO:-zsh} (with -l for login shells). — [lib/cli.zsh#L228-322](https://github.com/ohmyzsh/ohmyzsh/blob/86ef6555e068663736a33376e4055aca9c1acc89/lib/cli.zsh#L228-L322) [lib/cli.zsh#L735-746](https://github.com/ohmyzsh/ohmyzsh/blob/86ef6555e068663736a33376e4055aca9c1acc89/lib/cli.zsh#L735-L746)
- Git prompt render trace (async default on zsh >= 5.0.6): precmd -> _defer_async_git_register checks whether $(git_prompt_info)/$(git_prompt_status) appear in PS1/RPROMPT/etc -> _omz_register_handler -> _omz_async_request forks _omz_git_prompt_info -> _omz_async_callback fills _OMZ_ASYNC_OUTPUT -> zle reset-prompt -> git_prompt_info stub echoes the cached output. — [lib/git.zsh#L171-236](https://github.com/ohmyzsh/ohmyzsh/blob/86ef6555e068663736a33376e4055aca9c1acc89/lib/git.zsh#L171-L236) [lib/async_prompt.zsh#L46-142](https://github.com/ohmyzsh/ohmyzsh/blob/86ef6555e068663736a33376e4055aca9c1acc89/lib/async_prompt.zsh#L46-L142)
- Install trace: main() detects non-tty stdin -> forces RUNZSH=no CHSH=no OVERWRITE_CONFIRMATION=no -> setup_ohmyzsh (umask g-w,o-w; git init; core.eol=lf, autocrlf=false, zeroPaddedFilemode ignores; fetch --depth=1; checkout $BRANCH) -> setup_zshrc (backup, sed template) -> setup_shell (locate zsh in /etc/shells, save old shell, sudo chsh) -> print_success -> exec zsh -l. — [tools/install.sh#L538-604](https://github.com/ohmyzsh/ohmyzsh/blob/86ef6555e068663736a33376e4055aca9c1acc89/tools/install.sh#L538-L604)
- `omz pr test 123` trace: URL basename normalized -> digit check -> git symbolic-ref saves current branch -> remote list scanned for ohmyzsh/ohmyzsh -> curl api.github.com/repos/ohmyzsh/ohmyzsh/pulls/123 -> 'testers needed' label check (jq or grep on node_id) -> typed 'yes' gate if unlabeled -> git fetch refs/pull/123/head:ohmyzsh/pull-123 -> rebase onto master with commit.gpgsign temporarily disabled -> `zsh -l` test shell -> optional checkout back. — [lib/cli.zsh#L591-724](https://github.com/ohmyzsh/ohmyzsh/blob/86ef6555e068663736a33376e4055aca9c1acc89/lib/cli.zsh#L591-L724)
- Uninstall trace: uninstall_oh_my_zsh -> tools/uninstall.sh restores shell from ~/.shell.pre-oh-my-zsh via chsh, confirms, rm -rf ~/.oh-my-zsh, renames ~/.zshrc to .zshrc.omz-uninstalled-<timestamp>, and restores .zshrc.pre-oh-my-zsh. — [lib/functions.zsh#L7-9](https://github.com/ohmyzsh/ohmyzsh/blob/86ef6555e068663736a33376e4055aca9c1acc89/lib/functions.zsh#L7-L9) [tools/uninstall.sh](https://github.com/ohmyzsh/ohmyzsh/blob/86ef6555e068663736a33376e4055aca9c1acc89/tools/uninstall.sh)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
