Skip to content

Optimize bash tool description to prevent redundant cd commands#16

Merged
ammario merged 2 commits into
mainfrom
optimize-bash-tool-description
Oct 4, 2025
Merged

Optimize bash tool description to prevent redundant cd commands#16
ammario merged 2 commits into
mainfrom
optimize-bash-tool-description

Conversation

@ammario

@ammario ammario commented Oct 4, 2025

Copy link
Copy Markdown
Member

Problem

The bash tool already runs commands in the configured working directory, but the description cwd: /path was ambiguous. This led to the AI assistant unnecessarily prefixing every command with cd /path &&, wasting tokens and making commands harder to read.

Solution

Changed the description from:

Execute a bash command with a configurable timeout
cwd: /Users/ammar/.cmux/src/cmux/tmp

To:

Execute a bash command with a configurable timeout
Runs in /Users/ammar/.cmux/src/cmux/tmp - no cd needed

This:

  • Clearly states commands already run in that directory ("Runs in")
  • Explicitly prevents the anti-pattern ("no cd needed")
  • Uses similar token count but is much clearer

Impact

  • Reduces token usage in AI interactions
  • Makes bash commands cleaner and more readable
  • No functional changes - just clarifies existing behavior

When a branch has an open PR, pushing to it triggers both the 'push'
and 'pull_request' events, causing CI to run twice. This change limits
'push' triggers to only the main branch, while keeping 'pull_request'
triggers for all branches. This is the standard GitHub Actions pattern
to prevent duplicate runs.
The bash tool already runs commands in the configured cwd, but the
previous description 'cwd: /path' was ambiguous and didn't explicitly
prevent the redundant pattern of starting every command with 'cd /path &&'.

Updated to 'Runs in /path - no cd needed' which:
- Clearly states commands already run in that directory
- Explicitly prevents the anti-pattern
- Uses fewer tokens (~same length but clearer)
@ammario ammario merged commit 812d1bb into main Oct 4, 2025
4 checks passed
@ammario ammario deleted the optimize-bash-tool-description branch October 4, 2025 20:39
duynguyen020304 pushed a commit to duynguyen020304/mux that referenced this pull request May 10, 2026
…RY, tests

Batch 1 — Compile Errors & Correctness:
- Add TOGGLE_KANBAN to KEYBIND_LABELS and KEYBIND_GROUPS (coder#1)
- Fix Ctrl+K conflict → Ctrl+Shift+K to avoid PREV_WORKSPACE collision (coder#2)
- Add TOGGLE_KANBAN dispatch handler in App.tsx (coder#3)
- Fix dirty-cache in promoteQueuedTask: move flag clearing after moveTask (coder#5)
- Wrap 4 IPC helpers in KanbanBoard with try/catch (coder#4)

Batch 2 — Consistency & DRY:
- Deduplicate KanbanColumnSchema: import from canonical orpc/schemas (coder#6)
- Remove unused KanbanBoardData import from kanbanStorage.test (coder#7)
- Remove dead KANBAN_STORAGE_KEYS constant (coder#8)
- Replace console.warn with log helper in kanbanStorage (coder#9)
- Replace useEffect form reset with key prop in TaskDetailModal (coder#10)
- Remove unsafe {} as KanbanTask cast, use EMPTY_FORM pattern (coder#11)
- Add loading state + error logging to KanbanView (coder#12, coder#13)
- Add KANBAN_STATUS_LABELS helper, use in TaskDetailModal (coder#14)
- Validate column membership in reorderTasks (coder#15)
- Use KanbanTaskPriority type import in TaskCreateModal (coder#16)

Batch 3 — Tests:
- Add 4 tests for updateColumn (coder#17)
- Add 3 tests for promoteQueuedTask (coder#18)
- Rename misleading test 'rejects empty title' → 'accepts empty title' (coder#19)

43 tests pass (was 36). No typecheck or lint regressions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant