[BUG] Claude Code agent ignores CLAUDE.md / project directives, leading to real-money loss

Resolved 💬 3 comments Opened Apr 29, 2026 by RafeRoberts Closed May 31, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

I'm running a Claude Code agent in a DeFi yield farming project (3-layer architecture: directives → orchestrator → executions). The project's CLAUDE.md and an explicit user-prompt-submit hook re-inject the rules every turn, instructing the agent to:

Read the directive in directives/ before acting (Layer 1 = source of truth)
Route through deterministic execution scripts rather than improvising
Self-anneal on errors before patching live execution code
In a single session, the agent:

Never opened the master strategy directive at directives/defi-yield-farming-rebalancing-agent-strategy.md despite being told to in CLAUDE.md, until the user explicitly forced it after multiple failures
Modified the live executions/executor/sickle_executor.py (which sends real on-chain transactions moving real funds) without dry-run, preflight gas check, or proof of swap-path — directly contradicting directive §3.3 step 3
The change burned a real LP NFT (base_aerodrome_68634850, RECALL/USDC on Aerodrome), stranding ~$104 of single-sided RECALL in the EOA
A separate position on BSC was also damaged in the same session for related reasons (gas-budget exhaustion mid-multistep)
The agent acknowledged the failure each time but repeated the same root behavior (acting as a coder rather than as the orchestrator the architecture defines) on subsequent turns. The CLAUDE.md re-injection on every prompt did not prevent the regression.

Repro pattern: any project where CLAUDE.md is heavy on architectural rules and the agent has tools that move real assets. The agent treats CLAUDE.md as background noise rather than binding instructions, especially under time pressure / "fix this" prompts.

Suggested investigation areas:

Why repeated CLAUDE.md injection isn't enforcing the documented workflow
Whether the agent should refuse-by-default on irreversible operations (exit(), move(), signed txs) until preconditions are explicitly verified
A standard "fiduciary mode" guardrail for projects with on-chain or financial side effects

2.1.116 (Claude Code)

What Should Happen?

It should read the Claude.md file and not ignore it for starters

Error Messages/Logs

Steps to Reproduce

I dont know its random

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

I reported this months ago on another projects and you just closed it

Claude Code Version

2.1.116 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗