The Research Report
The Context Window Deserves Its Own IDE
Why ContextCraft matters and what it says about where LLM tooling is headed
Every LLM prompt is a construction project. You gather system instructions, a few examples, some retrieved context, the actual user message. You arrange them, trim what's too long, test whether the output still works, count tokens, and save versions so you can roll back when something breaks.
Most developers build these context windows in a text editor. Some use notebooks. Others scatter scripts across a repo. Nobody has a single place where you can see the whole context window, drag a block to reorder it, compress a section, test the result live, and save a snapshot. Not until now.
ContextCraft, published May 5 on dev.to, is a canvas-based workbench for assembling, compressing, testing, and versioning LLM context windows. It runs locally, connects to Ollama for compression and testing, and exports directly to OpenAI, Anthropic, LangChain, and JSON formats. It is the first open-source tool that treats the context window as a visual, measurable artifact rather than a blob of text.
What ContextCraft Does
ContextCraft gives you a drag-and-drop canvas where each piece of a prompt lives as a separate block. System message here. Few-shot examples there. Retrieved documents below. You see every block, its token count, and how much of your budget it consumes. All in real time.
The core features break down into six pieces.
Visual canvas. Blocks represent individual prompt sections. You drag to reorder, edit inline or in a full editor, and watch token counts update as you type. Progress bars show how close you are to your model's context limit.
Smart compression. Click the compress icon on any block. Set a target compression ratio from 0.1 to 0.9. Choose whether to preserve structure. Ollama runs a local model, default is gemma2:2b, that compresses the block while trying to keep the meaning intact. You see a before-and-after comparison before committing.
Coverage analysis. This is the part that separates ContextCraft from a simple token counter. After compression, you can run a semantic similarity check between the original and compressed content. The tool uses sentence-transformers to score how well the compressed version preserves key concepts. You get a number, not just a token count, telling you what you traded for those savings.
Live LLM testing. Select a provider, Ollama or OpenRouter, pick a model, set a temperature, and stream responses directly from the canvas. No copy-paste into a separate playground. You see whether your assembled context actually produces the output you want.
Version control. SQLite backs a save-and-restore system. Name your versions. Roll back to any snapshot. Compare two versions to see exactly what changed. This is git for your prompt, without the command line.
Multi-format export. When your context window is ready, export it as OpenAI messages, Anthropic messages, LangChain prompt templates, or raw JSON. Copy the generated code and paste it into your application. No manual reformatting.
How It Works Under the Hood
ContextCraft splits into a FastAPI backend and a React + Vite frontend.
The backend handles the heavy lifting. Token counting runs through tiktoken with support for GPT-4, GPT-4o, GPT-4o Mini, GPT-3.5 Turbo, Claude 3 Opus, Sonnet, and Haiku, and Claude 3.5 Sonnet tokenizers. Semantic similarity runs through sentence-transformers. Compression streams through Ollama. LLM testing streams responses from Ollama or OpenRouter. Version management sits on SQLite. Export generation turns your canvas into ready-to-use code for four frameworks.
The frontend renders the visual canvas with @hello-pangea/dnd for drag-and-drop and CodeMirror for inline editing. Every change hits the backend API in real time.
The project structure looks like this:
contextcraft/
├── server/ # FastAPI backend
│ ├── main.py # App entry point
│ ├── models.py # Pydantic data models
│ ├── tokenizer.py # Token counting (tiktoken)
│ ├── coverage.py # Semantic similarity analysis
│ ├── compress.py # Ollama compression service
│ ├── tester.py # LLM streaming test service
│ ├── export.py # Export format generators
│ ├── versions.py # SQLite version management
│ └── pricing.py # OpenRouter pricing API
├── frontend/ # React + Vite frontend
│ ├── src/
│ │ ├── components/
│ │ ├── hooks/
│ │ └── App.jsx
│ └── package.json
├── cli/
│ └── main.py
└── pyproject.toml
The API surface is clean. Tokenize, compress, coverage, test, versions, export, and library. Each endpoint does one thing. The frontend calls them directly.
Why Visual Context Assembly Matters
Context engineering is becoming its own discipline. The old approach was prompt engineering, tweaking words in a text box. That still matters, but the harder problem is context engineering: deciding what goes into the window, how much of it fits, whether the compressed version still means the same thing, and how to test the whole assembly end to end.
Right now most teams handle this with ad-hoc scripts and manual token counting. A developer copies text into a token counter website, trims manually, pastes into a playground, checks the output, goes back, trims more, and repeats. This loop runs dozens of times per prompt. There is no version history. No semantic measurement. No single view of the assembled context.
ContextCraft addresses all of that. The visual canvas makes the context window legible. You see every block, its size, and its relationship to the others. Compression with semantic scoring means you make informed trade-offs, not blind cuts. Version control means you can experiment without fear. Live testing closes the loop. You go from assembly to compression to testing to export without switching tools.
This is what an IDE for context windows looks like. Not a text editor with token counts bolted on. A workspace designed around the artifact itself.
Getting Started
You need Python 3.9 or later, Node.js 18 or later, and optionally Ollama for local compression and testing.
# Clone the repository
git clone https://github.com/contextcraft/contextcraft.git
cd contextcraft
# Install Python dependencies
pip install -e ".[dev]"
# Install frontend dependencies
cd frontend
npm install
cd ..
# Initialize the database
contextcraft init-db
# Start the server and frontend
contextcraft serve
The frontend runs at localhost:5173 and the API docs at localhost:8000/docs.
For configuration, create a .env file in the project root:
# OpenRouter API key (for cloud LLM testing)
OPENROUTER_API_KEY=your_api_key_here
# Ollama URL (default: http://localhost:11434)
OLLAMA_URL=http://localhost:11434
# Default compression model
DEFAULT_COMPRESSION_MODEL=gemma2:2b
Ollama and OpenRouter are optional. Without Ollama you lose local compression and testing. Without OpenRouter you lose cloud model testing. The canvas, token counting, version control, and export all work standalone.
Docker is also available:
docker build -t contextcraft .
docker run -p 8000:8000 -p 5173:5173 contextcraft
The Bigger Picture
ContextCraft is one signal in a growing ecosystem. ContextLab, another open-source project, provides a Python toolkit for analyzing, compressing, and visualizing prompt contexts. Cased's Kit library handles context assembly for code. The VS Code extension "Context Craft" by Airizom cherry-picks workspace files and copies them as LLM-ready XML with token counts.
Each of these tools addresses a slice of the same problem. ContextCraft is the first to put the slices together in a visual workbench. You assemble, compress, measure, test, version, and export in one place. That integration is the key contribution.
The tool was built entirely using NEO, an autonomous AI engineering agent. The author describes generating and connecting every component, from the FastAPI backend services to the React frontend canvas, from a high-level problem description. Whether this excites you or concerns you, it is worth noting. The code is MIT-licensed and open for contribution.
The context window is the scarcest resource in LLM applications. Every token costs money and latency. Every compressed block risks losing meaning. Every untested prompt is a gamble. ContextCraft gives you a workspace where those trade-offs are visible, measurable, and reversible. That is a step change from counting tokens in a text editor and hoping for the best.
Suggested Title
The Context Window Deserves Its Own IDE
Citations
- ContextCraft dev.to article: https://dev.to/nilofer_tweets/contextcraft-a-visual-workbench-for-building-and-managing-llm-context-windows-3f8e
- ContextCraft GitHub repository: https://github.com/contextcraft/contextcraft (also referenced as https://github.com/dakshjain-1616/ContextCraft)
- ContextLab: https://github.com/Siddhant-K-code/ContextLab
- Cased Kit context assembly: https://kit.cased.com/core-concepts/context-assembly
- Airizom Context Craft VS Code extension: https://marketplace.visualstudio.com/items?itemName=airizom.context-craft
- NEO AI agent: https://heyneo.com
Word Count
1,321
Fact-Check Notes
- The dev.to article and GitHub README both reference
github.com/contextcraft/contextcraftas the clone URL, but the actual repo appears to live atgithub.com/dakshjain-1616/ContextCraft. Both URLs are included in citations. Verify which URL actually works before publishing. - The search results also surfaced
github.com/flight505/ContextCraft, which is a different project. That repo is a desktop Electron app for formatting and exporting code to share with AI models. It is not the same tool described in the dev.to article. I have not confused the two in the article, but verify if you want to mention the name collision. - The article states ContextCraft is "the first open-source tool" to treat the context window as a visual, measurable artifact. This claim is from the task brief. ContextLab and other tools overlap in some areas. Verify this framing holds if you want to keep the "first" language, or soften to "among the first."
- Token counting support list (GPT-4, GPT-4o, etc.) comes directly from the README. Verify these are still accurate if models have been added or deprecated since publication.
- The default compression model is listed as gemma2:2b. Verify this is correct and current in the repo.