/koopa:koopa-envfrom koopa
Explains koopa environment activation, PATH resolution, and tool version diagnosis. Use when commands resolve to unexpected binaries, in non-interactive/CI/agent sessions, or for macOS BSD sed vs gsed issues.
Ships in koopa. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
koopa system which <tool> # real path of the koopa-managed binary
koopa system version <tool> # version koopa installed
koopa system prefix # koopa's own root, e.g. ~/.local/share/koopa
koopa system list path-priority
koopa system prefix returns the root every app lives under, for example
<prefix>/app/<tool>/<version>/bin/<tool>. koopa system list path-priority
shows the PATH order, which is the fastest way to diagnose "wrong version
resolved."
Interactive shells activate koopa automatically. Non-interactive shells (ssh host 'cmd', CI steps, agentic harnesses) do not: PATH and environment
exports are opt-in there.
Set KOOPA_AUTO_ACTIVATE=1 to opt in. This exports PATH and environment only;
it does not load prompt, alias, or history machinery. If a command that should
resolve to a koopa-managed tool instead reports "command not found" in an
agent session, check whether this variable is set.
ssh host 'cmd' runs the system binaryWithout activation, PATH has no koopa directory. A bare tmux, bash, or
chezmoi resolves to the system copy (for example /usr/bin/tmux 3.2a on
Ubuntu LTS), not the koopa copy that the interactive shell uses. This fails
silently in two ways:
tmux -V over ssh said 3.2a
while the live server ran koopa tmux 3.8.lookPath "bash" rendered default-shell as
/usr/bin/bash instead of the koopa bash. Confirmed 2026-11-02.Fix: call the tool by its full path (~/.local/share/koopa/bin/<tool>). For a
tool that looks up other tools, such as chezmoi with lookPath, also put koopa
first on PATH for that one command:
ssh host 'export PATH=$HOME/.local/share/koopa/bin:$PATH; chezmoi --source=<tree>/chezmoi diff <target>'
Run chezmoi diff <target> before apply. A changed binary path in the diff
(default-shell, a lookPath result) means the PATH is wrong. To see the
binary that a live process uses, run ps -eo pid,args | grep '[t]mux'.
sed is BSD sed: use gsed for in-place editsmacOS ships BSD sed. sed -i 's/a/b/' file fails there with undefined label,
because BSD sed -i needs a backup-suffix argument (sed -i '' ...). koopa
provides GNU sed as gsed, and gsed -i works the same on macOS and Linux.
Prefer the Edit tool for a small known change. For a scripted bulk edit, use
gsed -i. Check it first with command -v gsed.
The koopa plugin's guard_hook_writes.py treats gsed -i like sed -i, so
both still ask before they touch protected hook or settings files.
timeout does not exist: use gtimeoutmacOS has no timeout. A call to it prints timeout: command not found. Do not
try timeout on macOS. koopa provides GNU timeout as gtimeout (from the
coreutils app), and it takes the same arguments:
gtimeout 30 <command>
Exit code 124 means the command ran out of time. Check that gtimeout exists
with command -v gtimeout. If it is missing, use
perl -e 'alarm 30; exec @ARGV' <command>.
koopa never shadows a project-local .venv or a uv-managed environment.
Those take priority on PATH when active. koopa only fills gaps: tools the
project itself does not provide.
koopa list --all tells you what koopa can install. koopa system which <tool> tells you what is actually first on PATH right now. A tool can be
installed by koopa and still lose to a Homebrew copy earlier in PATH; checking
list alone will not reveal that.
Claude Code's Bash tool picks its shell from the CLAUDE_CODE_SHELL
environment variable: a path to a bash or zsh binary. An invalid value silently
falls back to auto-detection, which uses $SHELL when it is bash or zsh. Set it
in the env block of the user-level settings.json (for example
"CLAUDE_CODE_SHELL": "/path/to/zsh"). Documented for Claude Code, but not
re-verified here against your installed version.
Check from inside a session rather than assume:
echo "bash=${BASH_VERSION:-none} zsh=${ZSH_VERSION:-none} shell=$SHELL"
Exactly one of the two version variables is set in the shell actually running.
$SHELL is the login shell, not necessarily the running one.
How Copilot CLI and Codex choose their shell is undocumented and unverified
here. Run the same check there. Remember that the agent shell is
non-interactive, so koopa activates only with KOOPA_AUTO_ACTIVATE=1.
KOOPA_BUCKET is the directory of koopa's dated notes bucket (typically an
Obsidian vault). _koopa_activate_today_bucket resolves it from an existing
KOOPA_BUCKET that is a directory, else ~/bucket, else ~/Documents/bucket,
resolves symlinks, and exports it, then repoints the ~/today and
~/Documents/today links at <bucket>/YYYY/MM/DD. It runs in koopa-activated
interactive shells only, so a non-interactive agent shell has it only if it
inherited the variable from the parent process. If no bucket directory exists it
is not set.
The plugin's guard_report_path.py hook reads it first when finding a notes
vault: KOOPA_BUCKET, then OBSIDIAN_VAULT_DIR, then Obsidian's own registry
(obsidian.json). With none of those found, the hook does nothing. To see the
value in use: [ -n "${KOOPA_BUCKET:-}" ] && echo set || echo unset.
KOOPA_BUCKET is always the symlink-resolved path, so it can differ as a string
from the path a tool reports. ~/Documents is often a symlink (for example into
OneDrive), so ~/Documents/bucket (what obsidian vaults lists) and
KOOPA_BUCKET can be the same directory. Never conclude they are different
vaults from a string comparison: run realpath on both first.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
koopa, path-resolution, environment-activation, macos-tooling
npx claudepluginhub acidgenomics/koopa --plugin koopa14 skills in this plugin
/koopa-agent-guardsWhat the koopa plugin's agent guard hooks block or ask about, why, and the correct alternative for each. Use when a koopa hook blocked or asked about a command or a file write, when a deny message names a script such as block_uv.py or guard_rm.py, or when the user asks what the koopa plugin guards do and how to configure them./koopa-claude-permissionsClaude Code permission system internals, protected paths, permission modes, allow/ask/deny rule precedence, and the PreToolUse permissionDecision hook contract. Use when debugging unexpected permission prompts, understanding why Edit(.claude/**) or Bash(*) allow rules have no effect on .claude/ writes, reasoning about acceptEdits vs plan vs bypassPermissions mode tradeoffs, a headless claude -p call that hangs with no output, interpreter allow entries (bash, python, sh, xargs) that bypass deny rules, a deny rule that blocks a harmless test command, or a settings.json change that did not deploy on a work host./koopa-cliCommand syntax for koopa, a shell bootloader that installs apps into its own prefix instead of the system package manager. Use when changing koopa's CLI architecture, installing a CLI tool, updating apps, switching koopa branches, recovering from a stale checkout, or listing what koopa manages.Other plugins' skills for the same job