Investigates OpenCode runtime errors by locating and analyzing log files. Use when OpenCode fails to start, plugins do not load, MCP servers error out, or terminal shows cryptic errors without details.
설치
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Investigates OpenCode runtime errors by locating and analyzing log files. Use when OpenCode fails to start, plugins do not load, MCP servers error out, or terminal shows cryptic errors without details.
OpenCode Log Investigation
Quick start
Identify the latest log file:
Windows:%USERPROFILE%\.local\share\opencode\log\
Linux/macOS:~/.local/share/opencode/log/
Open the most recent YYYY-MM-DDTHHMMSS.log.
Search for ERROR lines to find the root cause.
Workflows
1. Plugin loading issues
Search for service=plugin in the log.
Check if the target plugin appears as loading plugin.
If absent, verify opencode.json has the plugin in the plugin array.
If present but errors follow, inspect the stack trace immediately after the load line.
2. MCP server failures
Search for service=mcp and ERROR.
Common errors:
MCP error -32000: Connection closed → the command failed to start.
The system cannot find the path specified → the executable (e.g., /bin/bash, uvx) is missing or not in PATH.
Check the command= field in the error line to see the exact command invoked.
3. Session or tool errors
Search for service=session or service=tool.registry.
Look for error= or failed in the same block.
Cross-reference timestamps to match user-visible terminal errors with log entries.
4. Shell command errors inside plugins
If a plugin uses ctx.$ to run shell commands, console.error output from the plugin may not appear in the OpenCode log.
Check the terminal output directly, or redirect plugin stderr to a temp file for debugging.
Verify the command exists in the OS PATH (e.g., python3 vs python on Windows).
Advanced features
See REFERENCE.md for a detailed error pattern catalog.
For plugin-specific debugging, add console.log in the plugin and watch the terminal; OpenCode does not capture plugin stdout/stderr into its log file.