From e0ffa274d499c49ea038430e181313dce8a48d2f Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 20:15:12 +0000 Subject: [PATCH] fix: include CLAUDE.md in API-mode context bombs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Read and inject CLAUDE.md into RenderOptions in both API-mode code paths (runHandler and runWithoutCache), matching the behaviour already present in runLocalMode. The template conditional was already in place — only the ReadClaudeMD call and ClaudeMD field assignment were missing. Closes #149 Co-Authored-By: Grey Newell Co-Authored-By: Claude Sonnet 4.6 Co-authored-by: claude[bot] --- cmd/run.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/run.go b/cmd/run.go index 45a6015..5b3de6c 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -201,6 +201,7 @@ func runHandler(cmd *cobra.Command, args []string) error { } // Render context bomb + claudeMD := local.ReadClaudeMD(proj.RootDir) opts := tmpl.RenderOptions{ MaxTokens: maxTokens, Stale: stale, @@ -208,6 +209,7 @@ func runHandler(cmd *cobra.Command, args []string) error { WorkingMemory: wm, PostCompact: postCompact, SessionSnapshot: snap, + ClaudeMD: claudeMD, } output, tokens, err := tmpl.Render(graph, proj.Name, opts) if err != nil { @@ -327,7 +329,8 @@ func runWithoutCache(cfg *config.Config, proj *project.Info, wm *project.Working return silentExit() } - opts := tmpl.RenderOptions{MaxTokens: maxTokens, WorkingMemory: wm, PostCompact: postCompact, SessionSnapshot: snap} + claudeMD := local.ReadClaudeMD(proj.RootDir) + opts := tmpl.RenderOptions{MaxTokens: maxTokens, WorkingMemory: wm, PostCompact: postCompact, SessionSnapshot: snap, ClaudeMD: claudeMD} output, _, err := tmpl.Render(graph, proj.Name, opts) if err != nil { logFn("[warn] render error: %v", err)