Skip to content

Dynamic shell tool name: detect user shell, name tool accordingly #494

Description

@bonk-moltbot

What

Name the shell tool after the user's actual shell (zsh, bash, fish) instead of hardcoded bash. Detect via $SHELL at startup.

Why

The tool is called bash but ShellSession already spawns the user's login shell (usually zsh). The model sees "bash" in the tool name → generates bash idioms → zsh parses them differently → occasional escaping/quoting errors.

Tool name is a one-token NTP context signal that shifts the entire probability distribution. Naming it zsh when running zsh = zero-cost accuracy improvement.

How

  1. ShellSession.shell_nameFile.basename(ENV["SHELL"] || "bash")
  2. Tools::Shell.tool_name → dynamic from detected shell
  3. Optionally: shell-specific prompt_guidelines (zsh arrays are 1-indexed, fish uses set not export, etc.)

Full exploration: thoughts/shared/notes/2026-05-02/dynamic-shell-tool-name-from-user-shell.md

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions