Skip to content

Conversation

@zeke
Copy link
Contributor

@zeke zeke commented Jan 13, 2026

This PR documents Claude Code compatibility features in the Rules documentation.

Changes

  • Update intro to mention CLAUDE.md as alternative to AGENTS.md
  • Update Project section to mention CLAUDE.md support
  • Add "Claude Code Compatibility" section covering:
    • Project-level CLAUDE.md
    • Global ~/.claude/CLAUDE.md
    • Cross-reference to Skills docs for ~/.claude/skills/
  • Document all three OPENCODE_DISABLE_CLAUDE_CODE* environment variables
  • Update Precedence section to list all local file types (AGENTS.md, CLAUDE.md, CONTEXT.md)

Closes #8265

Testing locally

gh repo clone anomalyco/opencode
cd opencode
gh pr checkout 8268
# Review changes in packages/web/src/content/docs/rules.mdx

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found


### Claude Code Compatibility

For users migrating from or using both Claude Code and OpenCode, OpenCode also reads `~/.claude/CLAUDE.md`. This allows you to share instructions between both tools.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Only reads it if u don't have AGENTS.md (note)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Updated to clarify these are fallbacks: d68ed5c

- Add CLAUDE.md as alternative to AGENTS.md in intro and Project sections
- Add Claude Code Compatibility section with project/global rules and skills
- Document all three OPENCODE_DISABLE_CLAUDE_CODE* environment variables
- Update Precedence section to list all local file types and clarify behavior
- Add cross-reference to Agent Skills docs for ~/.claude/skills/
@zeke zeke force-pushed the docs-claude-compat branch from 033e17f to 2d52fdd Compare January 13, 2026 18:33
AGENTS.md takes precedence over CLAUDE.md at both project and global levels.
### Project

The ones we have seen above, where the `AGENTS.md` is placed in the project root, are project-specific rules. These only apply when you are working in this directory or its sub-directories.
Place an `AGENTS.md` (or `CLAUDE.md`) in your project root for project-specific rules. These only apply when you are working in this directory or its sub-directories.
Copy link
Collaborator

Choose a reason for hiding this comment

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

NIT: prefer not to say or CLAUDE.md everywhere, stick to AGENTS.md everywhere and then just document that CLAUDE.md is picked up as a fallback like u have

---

You can provide custom instructions to opencode by creating an `AGENTS.md` file. This is similar to `CLAUDE.md` or Cursor's rules. It contains instructions that will be included in the LLM's context to customize its behavior for your specific project.
You can provide custom instructions to opencode by creating an `AGENTS.md` file (or `CLAUDE.md` for Claude Code compatibility). This is similar to Cursor's rules. It contains instructions that will be included in the LLM's context to customize its behavior for your specific project.
Copy link
Collaborator

Choose a reason for hiding this comment

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

NIT: prefer not to say or CLAUDE.md everywhere, stick to AGENTS.md everywhere and then just document that CLAUDE.md is picked up as a fallback like u have

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call. Reverted intro and project sections to just reference AGENTS.md: 37356cc

Keep CLAUDE.md documentation in the Claude Code Compatibility section only.
@rekram1-node rekram1-node merged commit 5947fe7 into anomalyco:dev Jan 13, 2026
4 checks passed
@rekram1-node
Copy link
Collaborator

thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOCS]: Document ~/.claude/CLAUDE.md compatibility behavior

2 participants