Skip to content

/add-context writes to global path instead of project-local by default #321

@ethanio12345

Description

@ethanio12345

Description

Ran /add-context expecting project intelligence to land in the project repo, but files were written to ~/.config/opencode/context/project-intelligence/ instead. The --global flag made no difference since both paths resolve to the same location.

Steps to Reproduce

  1. Run /add-context in any project
  2. Complete the wizard
  3. Check where files were created: ~/.config/opencode/context/project-intelligence/
  4. Run /add-context --global — files go to the same directory

What I Expected

Default (no flag) writes to <project-root>/.opencode/context/project-intelligence/ so files are version-controlled and team-shared. --global writes to ~/.config/opencode/context/project-intelligence/ for personal cross-project defaults.

What Happened Instead

Both paths resolve to ~/.config/opencode/context/project-intelligence/.

Context

context/core/system/context-paths.md already documents the intended split:

  • Local: <project-root>/.opencode/context/ (project-specific, committed to git)
  • Global: ~/.config/opencode/context/ (user-wide defaults)

The /context migrate operation also correctly describes copying global→local, so the pattern exists.

Possible Fix

In command/add-context.md, Stage 0.5 (lines 134-139), update the default path resolution:

# Current (both resolve to same directory)
Default: /home/<user>/.config/opencode/context/project-intelligence/
Global:  ~/.config/opencode/context/project-intelligence/

# Suggested
Default: <project-root>/.opencode/context/project-intelligence/
Global:  ~/.config/opencode/context/project-intelligence/

Environment

  • OAC version: latest (via npm package opencode-froggy)
  • Config location: ~/.config/opencode/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions