You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Skills ignore global AGENTS.md rule to use ~/.opencode/tmp instead of /tmp #46815
When invoking skills like `/code-review`, OpenCode requests permission to access `/tmp` even though the final report is saved to the correct directory (`~/.opencode/code_reviews/`).
This means users have to approve temporary file access on every skill invocation, which is tedious and suggests unnecessary /tmp usage in the implementation.
Context
The global AGENTS.md rule states:
```
Temporary files go to ~/.opencode/tmp/
For any temporary work, analysis documents, drafts, or exploratory output:
Use `~/.opencode/tmp/` as the temp directory
Never use `/tmp/`, `/var/tmp/`, or system temp directories
Create subdirectories if organizing multiple files (e.g. `/.opencode/tmp/analysis/`, `/.opencode/tmp/drafts/`)
Mention the file path when creating temp files so the user knows where to find them
Clean up large/stale files periodically, but keep the directory for reference
```
Skills should follow this rule and use `~/.opencode/tmp/` for any intermediate processing, not `/tmp`.
Expected behavior
Skills should use `~/.opencode/tmp/` for all temporary/intermediate files
No permission prompts should be needed for accessing user-approved directories under `~/.opencode/`
If /tmp must be used for platform-level operations, that approval should be cached across sessions"
The issue does not use one of the required issue templates (Bug Report, Feature Request, or Question). Please resubmit using the appropriate template. Since this appears to be a bug report, use the Bug Report template which requires a proper Description field and reproduction context (e.g., steps to reproduce, your system info, OpenCode version).
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
Thank you for updating the issue! It now clearly describes the problem, includes the relevant context (the AGENTS.md rule), and explains the expected behavior. We appreciate you taking the time to improve it.
You're asking for skills to use a dedicated temp directory such as ~/.opencode/tmp/ instead of /tmp, for paths under ~/.opencode/ not to need approval, and for temp-directory approvals to carry over between sessions.
This is currently expected behaviour rather than a bug:
The prompt is the external_directory permission. OpenCode asks before any tool reads or writes outside the project, and the only temp location it pre-approves is its own scratch directory under the system temp folder.
Whether the model follows a rule in your AGENTS.md (like "never use /tmp") is up to the model. OpenCode doesn't make skills use a particular temp directory.
Until then, you can stop the repeated prompts by allowing those paths in your config, for example:
Activity
github-actions commentedon Sep 2, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
/tmpinstead of project-specific or configured directories (focused on the handoff skill, but overlaps in theme)If you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Sep 2, 2026
Thank you for updating the issue! It now clearly describes the problem, includes the relevant context (the AGENTS.md rule), and explains the expected behavior. We appreciate you taking the time to improve it.
opencodejr commentedon Oct 28, 2026
Thanks for the report, @MahmoudEzzatAbdul-Rahman!
You're asking for skills to use a dedicated temp directory such as
~/.opencode/tmp/instead of/tmp, for paths under~/.opencode/not to need approval, and for temp-directory approvals to carry over between sessions.This is currently expected behaviour rather than a bug:
external_directorypermission. OpenCode asks before any tool reads or writes outside the project, and the only temp location it pre-approves is its own scratch directory under the system temp folder./tmp") is up to the model. OpenCode doesn't make skills use a particular temp directory.Until then, you can stop the repeated prompts by allowing those paths in your config, for example:
{ "permission": { "external_directory": { "~/.opencode/tmp/**": "allow", "/tmp/**": "allow" } } }Related issues:
/tmpdir #49073: asks for a separate temp directory for each project or sessionI've marked this as a feature request so the maintainers can consider it.