opencode attach --dir does not use project commands #7882

Open
opened 2026-02-16 18:08:34 -05:00 by yindo · 1 comment
Owner

Originally created by @ekweible on GitHub (Jan 28, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When attaching opencode to a running server and using --dir to specify what the CWD should be, any custom commands in that directory are not picked up/available.

The same issue does not appear to exist for project-specific custom skills; those appear to be available even when using opencode attach.

Plugins

None

OpenCode version

1.1.30

Steps to reproduce

  1. opencode serve from some other directory
  2. opencode attach --dir . <url> in a project directory that has custom commands at .opencode/commands/
  3. Note that the project's custom commands are not available

Screenshot and/or share link

No response

Operating System

macOS 26.2

Terminal

Ghostty

Originally created by @ekweible on GitHub (Jan 28, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description When attaching opencode to a running server and using `--dir` to specify what the CWD should be, any custom commands in that directory are not picked up/available. The same issue does not appear to exist for project-specific custom skills; those appear to be available even when using `opencode attach`. ### Plugins None ### OpenCode version 1.1.30 ### Steps to reproduce 1. `opencode serve` from some other directory 2. `opencode attach --dir . <url>` in a project directory that has custom commands at `.opencode/commands/` 3. Note that the project's custom commands are not available ### Screenshot and/or share link _No response_ ### Operating System macOS 26.2 ### Terminal Ghostty
yindo added the bug label 2026-02-16 18:08:34 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 28, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #7376: add --dir flag to opencode run --attach
  • #10615: Use attach to reference a local directory
  • #5380: TUI referencing local directory when using attach --dir to connect to a remote server
  • #10151: OpenCode serve mode and attach --dir working directory context issue
  • #4054: MCP Servers are not available if config is per project
  • #8868: Agents and Commands are not shown
  • #9335: Global commands/ directory not recognized on Windows, only command/ works
  • #10622: Clarification on command vs commands directory naming
  • #6985: Add .claude/commands/ compatibility (like .claude/skills/)
  • #2177: Allow explicitly changing working directory
  • #1143: Create session with a different root/working directory

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 28, 2026): This issue might be a duplicate of existing issues. Please check: - #7376: add --dir flag to `opencode run --attach` - #10615: Use attach to reference a local directory - #5380: TUI referencing local directory when using attach --dir to connect to a remote server - #10151: OpenCode serve mode and attach --dir working directory context issue - #4054: MCP Servers are not available if config is per project - #8868: Agents and Commands are not shown - #9335: Global `commands/` directory not recognized on Windows, only `command/` works - #10622: Clarification on `command` vs `commands` directory naming - #6985: Add .claude/commands/ compatibility (like .claude/skills/) - #2177: Allow explicitly changing working directory - #1143: Create session with a different root/working directory Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7882