-
Notifications
You must be signed in to change notification settings - Fork 3
Description
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