Skip to content

enhancement: include CLAUDE.md in API-mode context bombs (already done in local mode) #149

@claude

Description

@claude

Feature gap

CLAUDE.md is already read and injected into the context bomb when running in local mode (cmd/run.go runLocalMode, lines 280-281):

claudeMD := local.ReadClaudeMD(proj.RootDir)
opts := tmpl.RenderOptions{
    ...
    ClaudeMD: claudeMD,
    LocalMode: true,
}

However, the API mode path in the same file (runHandler, lines 204-211) never reads CLAUDE.md and leaves ClaudeMD empty in RenderOptions:

opts := tmpl.RenderOptions{
    MaxTokens:       maxTokens,
    Stale:           stale,
    StaleAt:         staleAt,
    WorkingMemory:   wm,
    PostCompact:     postCompact,
    SessionSnapshot: snap,
    // ClaudeMD: missing!
}

The template (internal/template/render.go, contextBombTmpl) already has a conditional block that renders the CLAUDE.md section when ClaudeMD is non-empty. The render path and the local.ReadClaudeMD helper are already in place — API mode just needs to call ReadClaudeMD and pass the result.

Why this matters

CLAUDE.md contains project-specific instructions that are highly relevant for any AI-assisted session, regardless of whether project analysis came from the API or a local scan. Omitting it in API mode means users who rely on API-powered features never get their project instructions re-injected after compaction.

Files

  • cmd/run.go — runHandler (lines 204-211): add local.ReadClaudeMD call and pass ClaudeMD to RenderOptions
  • cmd/run.go — runWithoutCache (line 330): same fix needed in the no-cache code path

@claude please implement this

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions