Skip to content

refactor: methodology + principles via per-campaign CLAUDE.md and auto-memory #131

@sriumcp

Description

@sriumcp

TL;DR

Move the campaign methodology and accumulated principles out of "re-sent every prompt" into the target repo's .nous/<run-id>/CLAUDE.md. Claude Code auto-loads it on every session. Auto-memory persists per-iteration learnings across sessions.

Why this matters

Right now Nous re-injects the campaign brief, methodology, and accumulated principles into every claude -p call. Claude Code already has two persistence mechanisms loaded automatically every session: CLAUDE.md and auto-memory. Using them both reduces token spend AND simplifies the orchestrator (less prompt assembly).

What's already shipped

Proposed approach

  1. On nous run, write the campaign methodology + current principles into <repo>/.nous/<run-id>/CLAUDE.md.
  2. Pass --add-dir <repo>/.nous/<run-id> (or the SDK equivalent) so Claude Code auto-loads it.
  3. After each iteration, regenerate the CLAUDE.md with updated principles and last-iteration handoff (deterministic Python — no LLM).
  4. Use auto-memory for longer-tail learnings ("at high saturation, binary gating loses discriminatory power vs ordinal scheduling") that persist across runs.
  5. The orchestrator's prompts/methodology/*.md stays as the source of truth, but it's installed into CLAUDE.md per-campaign rather than re-sent every call.

Acceptance criteria

  • <repo>/.nous/<run-id>/CLAUDE.md is created on nous run and updated each iteration.
  • Iteration N+1 prompts are measurably smaller than iteration N's were before this change.
  • No regressions on the existing test suite.

Part of #120.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions