0xkuze

Add Dir Opencode — Development skill for Claude Code

Development community

the add-dir command from claude code but for opencode.

How to install Add Dir Opencode

This entry records only its repository, not the path inside it, so there is no exact command to give. Open 0xkuze/add-dir-opencode and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Add Dir Opencode does

the add-dir command from claude code but for opencode.

Alternatives in Development

  • Check 1: Cache Exists? — CLAUDE_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}" CACHE_EXISTS=$(ls -d "$CLAUDE_DIR/plugins/cache/claude-hud" 2 10.9k ★
  • IPolloWork — Enterprise-grade, local-first Agent Workbench for people and agent teams 4.9k ★
  • Petdex — A public gallery of animated pets for Codex, Claude Code, DeepSeek Harness, Hermes, OpenCode, Gemini CLI, and 4k ★

README

/add-dir for OpenCode

Add working directories to your [OpenCode](https://opencode.ai) session — inspired by Claude Code's [`/add-dir`](https://docs.anthropic.com/en/docs/claude-code/cli-usage#add-dir) command.

When you need an agent to read, edit, or search files outside the current project, this plugin grants access without permission popups. ![add_dir_2](https://github.com/user-attachments/assets/9b048406-0ab0-4510-a424-f5e83923db70)

Quick Start

opencode plugin opencode-add-dir -g

Restart OpenCode. The plugin auto-registers itself in your `tui.json` — no manual config needed.

Alternative: local development
git clone https://github.com/kuzeofficial/add-dir-opencode.git
cd add-dir-opencode
bun install && bun run deploy

Add the local path to both configs:

// ~/.config/opencode/opencode.json
{ "plugin": ["/path/to/add-dir-opencode"] }

// ~/.config/opencode/tui.json
{ "plugin": ["/path/to/add-dir-opencode"] }

Commands

All commands are interactive TUI dialogs — type the command and select from autocomplete.

Command Dialog Description
/add-dir Text input + remember checkbox Add a working directory. Toggle [x] Remember with tab to persist across sessions.
/list-dir Alert Shows all added directories.
/remove-dir Select list + confirm Pick a directory to remove, then confirm.

How It Works

The plugin has two parts: a **TUI plugin** for the interactive dialogs and a **server plugin** for silent permission handling.

TUI Plugin

Handles all three slash commands via dialogs. Directories are stored in two files under `~/.local/share/opencode/add-dir/`:

  • directories.json — Persisted dirs, survive restarts.
  • session-dirs.json — Session-only dirs, cleared automatically on startup.

Which file gets written depends on the "Remember across sessions" toggle in `/add-dir`.

Respects `XDG_DA