Extractor

a third-party tool that allows language-model-assisted coding using Claude code or Codex to contextually save smart blocks from projects

Extractor

Extractor is a third-party tool that allows language-model-assisted coding using Claude code or Codex to contextually save smart blocks from projects. Basically, a library of sorts that people can reference and use features that have already been saved.

I imagine that it would look something along the lines of a developer prompting a feature into reality, then saying something along the lines of, "I really like this modal architecture, or this database structure seems really good. Run extractor."

The extractor would take a look at the five nearest git diffs (or whatever number is appropriate) as well as the prompt that set that part of the feature. It would use some kind of introspection to save the important parts of the code, maybe even turning it back into pseudo-code so that it can become language-agnostic.

It would also save the prompt that made it come into being, as well as any variables that the user would need to fill in for future invocations (similar to a form builder like Squarespace).

Back in the day, I built something similar for Visual Studio Code and called it IceBlocks.

GitHub - bramses/ice-blocks: a vsc ext to freeze code blocks in firebase and copy them into an editor
a vsc ext to freeze code blocks in firebase and copy them into an editor - bramses/ice-blocks

The saved blocks would then be accessed by using the language model Hash Map algorithm that I've been thinking about. The keys are natural language prompts, and the values are the rest of the data, stored as a JSON object. After you type in any prompt, the algorithm passes it through an initial step that uses embedding search to find the closest key, while in parallel the model also does its own reasoning across the keys and compares the two results to see which option(s) should be surfaced back to the user.

Other Misc. Thoughts

  • Code in this era is extremely disposable and is filled with unreadable bugs because the model is doing all of the writing. Since the bugs don't come from any person who can be individually blamed or held accountable for their thought process, these "ghost bugs" multiply. We are a degree removed due to prompts. This would probably decrease the usefulness and utility of boilerplate prompts being saved/referenced.
  • On the other hand, being able to save LLM generated code blocks and tweak them to work better or fit a particular spec a developer uses a lot would allow the developer to enhance the functionality of the models they use across different types of prompts they're engaging with. The N+1 invocation of the same feature would be better since it uses high quality base material.