Nodes/Claude Code ComfyUI Nodes/Claude Memory Builder
ComfyUI Node

Claude Memory Builder

Give every Claude run the same project context without rewriting the prompt

By christian-byrne·Created about a year ago·Updated about a year ago· 34
Claude Memory Builder
  • append_to
  • memory
  • memory_text
memory_typememory_file
memory_file[Custom Memory]
text_memory
file_path
claude_md_content# Project Context

Claude Memory Builder is the pack's way of giving every command the same background knowledge without you retyping it. Claude Code already understands CLAUDE.md conventions from its own ecosystem, so this node builds exactly that kind of context - project facts, style rules, what a "good" output looks like - and hands it to Claude Code Execute through its memory input. Execute drops whatever it receives into the prompt under a # Context/Memory header, right above your command.

It's the pack's version of "please remember this." Since every run is stateless (each execution is a fresh folder and a fresh agent), memory is the glue that makes runs feel like they share a brain. Combined with Claude Context Builder, it's also how you chain runs: the Context Builder turns a previous output folder into a string, and this node wraps that string up in the right type for Execute.

The inputs

You pick a memory_type and then fill in whichever field it needs:

  • text - type your context straight into text_memory.
  • memory_file - a dropdown of .md/.txt templates from the pack's memories/ folder. This is the reusable one: save a project brief there once, pick it forever.
  • file - read any file on disk via file_path (a CLAUDE.md you already maintain, say).
  • claude_md - a dedicated claude_md_content box, preformatted for the CLAUDE.md style.
  • combined - all of the above joined together.

append_to takes a previous CLAUDE_MEMORY and stacks new context on top, which is how you build up memory across multiple nodes in one graph.

Outputs

Outputs: memory (CLAUDE_MEMORY, for wiring into Execute's memory input) and memory_text (the same content as a plain STRING, useful for logging or a preview).

Installing

Install: ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/christian-byrne/claude-code-comfyui-nodes

and restart. One gotcha on the dropdown: it's populated when the node loads, so a template you drop into memories/ won't show up until you refresh the page / reload the node. And remember the dropdown only lists files that existed at load time - you'll see the bundled reddit-video-context.md from day one, your own files after a reload.

Common issues

The trap to avoid is cargo-culting a giant memory blob into every run. Claude reads the whole context on every turn, so a 5,000-word memory file makes every run slower and pricier for context you mostly don't need. Keep it to the facts that actually change the output - tone, format, constraints, the shape of a good result - and let the command carry the specifics. That's what the file's author clearly intended with the bundled template, and it's the difference between context that guides and context that just eats tokens.

Categoryclaude_code/helpers

Inputs (6)

NameTypeDefaultDescription
memory_typeCOMBOmemory_fileType of memory input
memory_fileoptCOMBO[Custom Memory]Select a memory file from the memories folder
text_memoryoptSTRINGDirect text input for memory/context
file_pathoptSTRINGPath to a file containing memory (e.g., CLAUDE.md)
claude_md_contentoptSTRING# Project Context CLAUDE.md formatted content
append_tooptCLAUDE_MEMORYPrevious memory to append to

Outputs (2)

NameTypeDescription
memoryCLAUDE_MEMORY
memory_textSTRING