Skip to content

System prompt memory instructions override PAI's own memory system #97

@virtualian

Description

@virtualian

Problem

When saving learnings/feedback, the system prompt's built-in memory instructions (Claude Code's project-level memory at projects/.../memory/) compete with PAI's own memory system (~/.claude/MEMORY/). The system prompt instructions are more immediately available — exact path, frontmatter format, two-step process — so they get followed instead of checking CONTEXT_ROUTING.md for the authoritative source.

Root Cause

Three layers:

  1. Competing instructions — louder wins over authoritative. The system prompt memory instructions are fully specified in active context. PAI's CONTEXT_ROUTING.md requires stopping, reading a file, following indirection, then acting. The path of least resistance wins.

  2. Domain misclassification. "Save a learning from a failure" is a PAI-domain operation — PAI has hooks (RatingCapture, WorkCompletionLearning) and a structured memory system that handles this. But nothing signals to the agent that this operation belongs to PAI rather than generic Claude Code.

  3. No guard or routing hint at the decision point. CLAUDE.md has the CONTEXT_ROUTING directive, but there's no explicit callout that says "memory operations go through PAI, not Claude Code's built-in memory."

Suggested Fix

Add an explicit directive in CLAUDE.md or the PAI steering rules that:

  • States PAI's memory system (~/.claude/MEMORY/) is the authoritative memory store
  • States that Claude Code's built-in project-level memory (projects/.../memory/) should NOT be used when PAI is active
  • Routes to CONTEXT_ROUTING.md → MEMORYSYSTEM.md for any memory write operation

This would resolve the ambiguity at the point where the competing instructions diverge.

Evidence

Session 2026-03-29: Saved feedback to project-level memory instead of LEARNING/ALGORITHM/. Required three rounds of correction before root cause was identified.

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