GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — v2: no CLAUDE.md fallback (compatibility issue, as migrate-v1 asks) · Issue #53402 · anomalyco/opencode

v2: no CLAUDE.md fallback (compatibility issue, as migrate-v1 asks) #53402

New issue
Copy link
New issue
Copy link
Closed
#64474
Closed
v2: no CLAUDE.md fallback (compatibility issue, as migrate-v1 asks)#53402
#64474
Copy link
Assignees
neriousy
Labels
reproduced

Description

@nkoynov
nkoynov
opened on Oct 5, 2026
Issue body actions

Description

V1 used CLAUDE.md when a project had no AGENTS.md, and ~/.claude/CLAUDE.md when there was no ~/.config/opencode/AGENTS.md. V2 only looks for AGENTS.md (packages/core/src/config/plugin/instruction.ts). The migration guide says to file a compatibility issue for this, so here it is.

Our setup: we use Claude Code and OpenCode on the same repos, and the instructions are written for Claude Code: a global ~/.claude/CLAUDE.md and project CLAUDE.md files. Today a local plugin injects them into V2.

Ask: bring back the V1 fallback, with the V1 off switches (OPENCODE_DISABLE_CLAUDE_CODE, OPENCODE_DISABLE_CLAUDE_CODE_PROMPT, see #36990), or add it as an opt-in setting.

Plugins

none

OpenCode version

2.0.22. instruction.ts behaves the same in 2.0.23 and on v2 @ ef07075.

Steps to reproduce

  1. mkdir p && cd p && git init && echo 'The project codeword is TEAL-42.' > CLAUDE.md
  2. opencode run --standalone "What is the project codeword? Answer from your context only, no tools."
  3. V1 answers TEAL-42. V2 doesn't know it.
  4. The same happens with the codeword in ~/.claude/CLAUDE.md and no ~/.config/opencode/AGENTS.md.

Screenshot and/or share link

n/a

Operating System

NixOS 26.11 (Linux 6.18)

Terminal

n/a (also happens through opencode serve)

Activity

  1. github-actions
    assigned
    neriousy
    on Oct 5, 2026
  2. github-actions commented on Oct 5, 2026

    @github-actions
    github-actionsBot
    on Oct 5, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might overlap with existing issues. Please check:

    • Add support for global CLAUDE.md or AGENTS.md #259: Previously requested reading ~/.claude/CLAUDE.md as global instructions.
    • [FEATURE]:Support .claude/CLAUDE.md project files #17436: Tracks project-level CLAUDE.md compatibility.
    • core: restore non-experimental environment variable compatibility in v2 #36990: Broader V2 compatibility issue that includes the OPENCODE_DISABLE_CLAUDE_CODE* behavior.
  3. opencodejr commented on Oct 27, 2026

    @opencodejr
    opencodejrBot
    on Oct 27, 2026
    Contributor
    More actions

    Thanks for the clear report. I could reproduce this on 2.0.22, and it still happens on the latest dev (f7d0ce1).

    What I did, with a simulated model:

    • A git project with only CLAUDE.md (The project codeword is TEAL-42.), no AGENTS.md.
    • A ~/.claude/CLAUDE.md with a second codeword, and no ~/.config/opencode/AGENTS.md.
    • One prompt from the TUI, then a check of the request sent to the model.

    Neither file's content was in that request. When I put the same text in a project AGENTS.md, it does show up, so only the CLAUDE.md fallback is missing. In the code, packages/core/src/config/plugin/instruction.ts only looks for AGENTS.md (the global file and the walk up the directory tree); nothing reads CLAUDE.md.

    The script below reproduces it. It logs whether each codeword reached the model; set CONTROL=1 to run the AGENTS.md comparison.

    Related: #36990 tracks V1 environment variable compatibility, including OPENCODE_DISABLE_CLAUDE_CODE and OPENCODE_DISABLE_CLAUDE_CODE_PROMPT. Bringing back the fallback would also give _PROMPT something to turn off again.

    Reproduction script (drive.ts)
    // Repro for #53402: V2 ignores CLAUDE.md (project) and ~/.claude/CLAUDE.md (global) fallbacks.
    // Neither AGENTS.md exists, so V1 would load both files into the system prompt.
    // Set CONTROL=1 to write the same text to AGENTS.md instead: V2 then does include it.
    import { Effect, Stream } from "effect"
    import { mkdirSync, writeFileSync } from "node:fs"
    import { join } from "node:path"
    import { Llm, OpenCodeDriver } from "opencode-drive"
    
    export default OpenCodeDriver.use(
      {
        ...(process.env.OC_DEV ? { opencode: { dev: process.env.OC_DEV } } : {}),
        project: { git: true, files: { [process.env.CONTROL ? "AGENTS.md" : "CLAUDE.md"]: "The project codeword is TEAL-42.\n" } },
        tui: { recording: true },
      },
      ({ artifacts, ui, llm }) =>
        Effect.gen(function* () {
          // OPENCODE_TEST_HOME is the artifacts dir: this is ~/.claude/CLAUDE.md for the run.
          mkdirSync(join(artifacts, ".claude"), { recursive: true })
          writeFileSync(join(artifacts, ".claude", "CLAUDE.md"), "The global codeword is NAVY-7.\n")
          const requests: string[] = []
          // Give the file watcher a moment to pick up the new global file.
          yield* Effect.sleep("2 seconds")
          yield* llm.serve((request: unknown) => {
            requests.push(JSON.stringify(request))
            return Stream.make(Llm.text("done"))
          })
          yield* ui.submit("What is the project codeword?")
          yield* ui.waitFor("done", { timeout: 60000 })
          const body = requests.join("\n")
          const hasProject = body.includes("TEAL-42")
          const hasGlobal = body.includes("NAVY-7")
          const hasAgentsMention = /AGENTS\.md|Instructions from/.test(body)
          yield* Effect.log(`requests=${requests.length} project codeword (TEAL-42) in model request=${hasProject} global codeword (NAVY-7, ~/.claude/CLAUDE.md) in model request=${hasGlobal}`)
          yield* Effect.log(`home=${artifacts} AGENTS/instructions mentioned=${hasAgentsMention}`)
          if (!hasProject || !hasGlobal) yield* Effect.log("REPRODUCED: CLAUDE.md fallback not applied")
        }),
    )

    Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.

  4. opencodejr
    added
    reproduced
    on Oct 27, 2026
  5. Lukk17 commented on Nov 17, 2026

    @Lukk17
    Lukk17
    on Nov 17, 2026
    More actions

    #63830 brings this back in a configurable way: with instruction_files set to ["AGENTS.md", "CLAUDE.md"], v2 reads CLAUDE.md again in the global config folder and in the upward walk. It is behind an experimental flag for now.
    Feedback or a thumbs up on the PR would help :)

  6. neriousy
    closed this as completedin #64474on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @neriousy
    neriousy

Labels

reproduced

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.