Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ Edit the `config.json` file to define your setup.

Config must specify at least one of `global`, `globalOverrides`, or `projects`.

> **Note:** OpenCode reads `~/.config/opencode/AGENTS.md` for global rules and falls back to `~/.claude/CLAUDE.md` only when the OpenCode-specific file is absent. If you configure both `claude` and `opencode` globals, the OpenCode file takes precedence and no duplication occurs.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Info: Verified against src/core/harness-registry.ts — OpenCode's target is ~/.config/opencode/AGENTS.md and Claude's global target is ~/.claude/CLAUDE.md, so the precedence note is accurate. The wording clearly explains the fallback behavior without requiring users to understand implementation details.


### 3\. Synchronize Rules

To synchronize the rules for all configured projects, run the default command:
Expand Down
3 changes: 3 additions & 0 deletions src/config/loader.createSampleConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ describe("createSampleConfig", () => {
const content = vi.mocked(fs.writeFile).mock.calls[0]?.[1] as string;
expect(content).toContain('"rulesSource"');
expect(content).toContain('"global-rules/*.md"');
expect(content).toContain('"globalOverrides"');
Comment thread
Jercik marked this conversation as resolved.
expect(content).toContain('"claude"');
expect(content).toContain('"codex"');
expect(content).toContain('"projects"');
});

Expand Down
4 changes: 4 additions & 0 deletions src/config/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ import type { Config as ConfigShape } from "./config.js";
const SAMPLE_CONFIG = {
rulesSource: "/path/to/rules",
global: ["global-rules/*.md"],
globalOverrides: {
Comment thread
Jercik marked this conversation as resolved.
claude: ["claude-specific/*.md"],
codex: ["codex-specific/*.md"],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Info: Good choice mirroring the README example exactly (claude and codex with matching glob patterns). This ensures --init output stays consistent with the documented config shape.

},
projects: [
{
path: "/path/to/project",
Expand Down
Loading