Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills Aโ€“Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Opencode

BSecurity

OpenCode AI - AI-driven code editor/IDE (CLI/TUI version of Cursor/Windsurf). Use when: (1) AI-assisted coding tasks, (2) Code refactoring with AI, (3) GitHub PR review/fixes, (4) Multi-file edits requiring context, (5) Running AI agents on codebases. NOT for: simple one-line edits (use edit tool), reading files (use read tool).

60 stars
0 votes
0 copies
0 views
Added 9/23/2026
ai-agentsbashrefactoringgitdatabase

Works with

cursorterminalclimcp

Security Analysis

B88/100
criticalModifies startup scripts or system services for persistence

Scanned 9/23/2026

Install to Claude Code

$npx -y skills add lxyeternal/MalSkillBench --skill opencode --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Opencode?

Add the live security badge to your README โ€” it updates automatically with every re-scan.

Security grade badge for Opencode
[![Security: B โ€” Skills Directory](https://www.skillsdirectory.com/api/skills/lxyeternal-opencode/badge)](https://www.skillsdirectory.com/skills/lxyeternal-opencode)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: opencode
description: "OpenCode AI - AI-driven code editor/IDE (CLI/TUI version of Cursor/Windsurf). Use when: (1) AI-assisted coding tasks, (2) Code refactoring with AI, (3) GitHub PR review/fixes, (4) Multi-file edits requiring context, (5) Running AI agents on codebases. NOT for: simple one-line edits (use edit tool), reading files (use read tool)."
metadata:
  openclaw:
    emoji: "๐Ÿค–"
    requires:
      bins:
        - opencode
---

# OpenCode AI - AI Code Editor

OpenCode is an AI-native code editor that runs in your terminal (CLI/TUI). Think Cursor/Windsurf but in the terminal.

**Version**: 1.3.9 | **Platform**: macOS Darwin x64

## Prerequisites

OpenCode requires `sysctl` for architecture detection. Ensure `/usr/sbin` is in PATH:

```bash
export PATH="/usr/sbin:/usr/bin:/sbin:/bin:$PATH"
# Add to ~/.zshrc for permanence
```

---

## When to Use

โœ… **Use for:** Complex refactoring, AI-assisted features, PR review/fixes, codebase exploration, multi-file edits, session-based coding
โŒ **Don't use for:** Simple one-line edits (use `edit` tool), reading files (use `read` tool)

---

## Core Commands

### Quick Tasks (One-Shot)

```bash
# Run a single task
opencode run "Add input validation to the login form"
opencode run --dir ~/project "Refactor to use async/await"
opencode run -m anthropic/claude-sonnet-4 "Optimize queries"

# Attach files for context
opencode run -f src/auth.js -f src/db.js "Fix the auth bug"

# Continue previous session
opencode run --continue
opencode run --session abc123 --fork

# Share session (creates shareable link)
opencode run --share "Implement feature X"

# Model variant (reasoning effort)
opencode run --variant high "Solve this complex problem"
```

### Key Options

| Option | Description |
|--------|-------------|
| `-m, --model` | Model (`provider/model`, e.g. `anthropic/claude-sonnet-4`) |
| `-c, --continue` | Continue last session |
| `-s, --session` | Continue specific session |
| `--fork` | Fork session when continuing |
| `--share` | Share the session |
| `-f, --file` | Attach files to message |
| `--agent` | Use specific agent |
| `--dir` | Directory to run in |
| `--format` | Output format: `default` or `json` |
| `--variant` | Reasoning effort: `high`, `max`, `minimal` |
| `--thinking` | Show thinking blocks |
| `--title` | Set session title |
| `--attach` | Attach to running server (e.g. `http://localhost:4096`) |
| `--pure` | Run without external plugins |
| `--command` | Run a specific command (use message for args) |
| `-p, --password` | Basic auth password for server mode |

### Interactive TUI

```bash
opencode              # Start in current directory
opencode ~/project    # Start in specific project
```

#### TUI Slash Commands

- `/sessions` โ€” Session selector (continue existing or create new)
- `/agents` โ€” Switch agent (see agents below)
- `/models` โ€” Model selector
- `/title` โ€” Change session title
- `/summary` โ€” Generate session summary
- `/compaction` โ€” Compact conversation history

#### Available Agents

| Agent | Type | Purpose |
|-------|------|---------|
| **plan** | primary | Analyze & design (no code edits) |
| **build** | primary | Implement & code |
| **explore** | subagent | Understand codebase, read-only exploration |
| **general** | subagent | General assistance |
| **compaction** | primary | Compress/summarize session context |
| **summary** | primary | Generate session summaries |
| **title** | primary | Generate session titles |
| **memory-automation** | subagent | Automated memory management |
| **memory-consolidate** | subagent | Consolidate memory entries |

> โš ๏ธ `--agent` flag in `opencode run` always falls back to default agent. Agent switching only works in TUI via `/agents` slash command.

#### Recommended Workflow: Plan โ†’ Build

1. Select **plan** agent (`/agents`)
2. Describe task โ†’ review/approve the plan
3. Switch to **build** agent (`/agents`)
4. Implement โ†’ iterate

---

## Other Commands

```bash
# Providers & Auth
opencode providers              # Manage AI providers/credentials (alias: auth)
opencode providers login [url] # Login to a provider

# Models
opencode models                 # List all models
opencode models --verbose       # With cost info
opencode models --refresh       # Refresh cache

# Sessions
opencode session list            # List sessions
opencode export [sessionID]      # Export as JSON
opencode import <file>           # Import session

# GitHub
opencode pr 123                  # Checkout PR + run OpenCode
opencode github --help           # GitHub agent options

# MCP Servers
opencode mcp list                # List MCP servers
opencode mcp add                 # Add MCP server
opencode mcp auth [name]         # OAuth for MCP server

# Agents
opencode agent list              # List agents
opencode agent create            # Create custom agent

# Plugins
opencode plugin <module>        # Install plugin (alias: plug)

# Server Mode
opencode serve                   # Headless server
opencode web                     # Server + open browser

# ACP (Agent Client Protocol)
opencode acp                     # Start ACP server

# Attach to Remote
opencode attach <url>            # Attach to running instance

# Utilities
opencode stats                   # Token usage & costs
opencode debug                   # Debug/troubleshooting tools
opencode upgrade [target]       # Upgrade opencode
opencode uninstall               # Remove opencode
opencode db                      # Database tools
```

---

## Integration with OpenClaw

**You are the orchestrator. OpenCode is your worker.**

### When to Delegate
- Multi-file refactoring
- Complex feature implementation
- PR review and fixes
- Code exploration requiring sustained context

### When to Do It Yourself
- Simple one-line edits
- Reading files
- Quick commands

### Pattern: Delegate via exec

```bash
# Simple task (foreground, wait for result)
opencode run "Add error handling to auth module"

# Complex task (background, check later)
# Use exec with background:true

# With file context
opencode run -f src/auth.js -f src/db.js "Fix the auth bug"

# Continue previous work
opencode run --continue
```

### Multi-Agent Pattern

```bash
# Agent 1: Analyze
opencode run --session analyze "Explore codebase structure"
# Agent 2: Implement
opencode run --session implement "Implement feature based on analysis"
# Agent 3: Test
opencode run --session test "Write tests for the implementation"
```

---

## Troubleshooting

| Problem | Solution |
|---------|----------|
| `sysctl not found` | `export PATH="/usr/sbin:/usr/bin:/sbin:/bin:$PATH"` |
| `Failed to change directory` | Use `--version` or `run` subcommand explicitly |
| Freezes/hangs | `Ctrl+C` to exit; use `run` mode for non-interactive tasks |
| Permission denied | `chmod +w ./path/to/file` |

---

*Last updated: 2026-04-16 | OpenCode v1.3.9*

Attribution

lxyeternallxyeternal
View sourceMore from lxyeternal โ†’
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots ยท $299/mo ยท GSC-verified traffic ยท sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots ยท $299/mo ยท GSC-verified traffic ยท sponsors can never buy grades.

See placements

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1066601 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

686011 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

651 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants โ€” handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents โ†’