Vibe Coding with the Agent
Generate and edit code, workflows, and configs through natural language — then refine until it's right.
1. What Is Vibe Coding?
Vibe coding is a workflow where you describe what you want in plain English, the agent generates or edits the code, you review it in the built-in editor, and refine with feedback. Think of it as a conversation that produces code.
Describe
Tell the agent what you want in natural language
Generate
Agent reads context, writes or edits files
Refine
Review in the editor, give feedback, repeat
This works for: Python, YAML, JSON, TOML, Bash, Rust, JavaScript, TypeScript, ComfyUI workflow JSON, .thumper.yaml manifests, and .model.yaml/.pack.yaml files.
How it differs from traditional coding: you describe the outcome, not the implementation. The agent reads existing code, understands the structure, and makes targeted changes.
The agent follows platform guidelines: READ before EDIT. It always reads file state before changing anything.
2. Setup
Prerequisites: Thumper-Run installed with at least one app (ComfyUI recommended for this tutorial).
Select the code-helper template from the dropdown at the agent launch screen. This adds a system prompt: "Focus on code-related tasks. Prefer search_code, file_read, file_edit. Show code snippets."
Recommended Models for Code
| Model | Size | Speed | Code Quality | Best For |
|---|---|---|---|---|
| qwen3:4b | 2.4 GB | Fast | Good | Quick edits, JSON, YAML |
| codellama:7b | 4 GB | Medium | Very Good | Python, complex logic |
| llama3.1:8b | 4.7 GB | Medium | Good | Balanced tasks |
| llama3.1:70b | 40 GB | Slow | Excellent | Large refactors, multi-file |
You can also attach reference files at launch (image/*, .pdf, .txt, .md, .json, .csv) to give the agent initial context without extra tool calls.
Your model and template choices are persisted via CRDT so they're remembered next time.
3. Describe What You Want
Example 1: Create a ComfyUI Workflow
Type a specific request:
Create a ComfyUI API workflow JSON that generates a 1024x1024 image usingthe SDXL base checkpoint with 25 KSampler steps, CFG scale 7, euler sampler,normal scheduler. Include positive and negative CLIP text encode nodes.Save it to ~/comfyui-workflows/portrait.json
The agent reasons through the node structure it needs, then writes the file:
Thinking: I need to create a valid ComfyUI API format workflow with nodes: CheckpointLoaderSimple, CLIPTextEncode ×2, KSampler, VAEDecode, SaveImage...
[file_write { path: "~/comfyui-workflows/portrait.json" }]
⚡ Awaiting approval...
After you approve, the file appears in the code editor panel:
{"3": {"class_type": "KSampler","inputs": {"seed": 42,"steps": 25,"cfg": 7,"sampler_name": "euler","scheduler": "normal","denoise": 1.0}}}
Example 2: Edit a .thumper.yaml Manifest
Read the ComfyUI .thumper.yaml and add a ROCm platform patch thatsets HSA_OVERRIDE_GFX_VERSION=11.0.0 for AMD gfx1100 GPUs
The agent first reads the file, then makes a targeted edit:
[file_read { path: "~/.local/share/tr-desktop/apps/comfyui/.thumper.yaml" }]
✓ Read 45 lines
[file_edit { old_string: "platform_overrides:", new_string: "platform_overrides:\n amd_gfx1100:\n env:\n HSA_OVERRIDE_GFX_VERSION: '11.0.0'" }]
Example 3: Generate a Python Script
Write a Python script that converts all PNG images in a directory toWebP format using Pillow. Add argparse for input/output directoriesand quality setting.
The agent generates a complete script with imports, argument parsing, and error handling:
import argparsefrom pathlib import Pathfrom PIL import Imagedef convert_images(input_dir, output_dir, quality):input_path = Path(input_dir)output_path = Path(output_dir)output_path.mkdir(parents=True, exist_ok=True)for png in input_path.glob("*.png"):img = Image.open(png)img.save(output_path / f"{png.stem}.webp", "webp", quality=quality)
Be specific about file paths — saves a search_files call and ~200 context tokens. The agent has 4096 tokens of context by default.
4. The Code Editor
When the agent creates or edits files, a code editor panel appears on the right (668px width). This is your review workspace.
File Tabs
Each generated file gets its own tab:
- Active tab — bg-gray-800, pink text
- Inactive tabs — border outline, gray text
- Modified indicator — ● dot next to filename
- Close button — X icon on each tab
Syntax Highlighting
The editor highlights code with a dark theme:
- Tags/keywords — blue
- Attributes/functions — green
- Values/strings — amber
- Text/identifiers — light gray
Supported languages: Python, YAML, JSON, TOML, Bash, Rust, JavaScript, TypeScript, HTML, CSS, and more.
Diff View
When file_edit modifies an existing file, you see a before/after diff:
- Green lines — added
- Red lines — removed
Changes must be approved before they're saved to disk. Think of this as your safety net — a checkpoint you can review before anything changes.
Editor Toolbar
| Action | Shortcut |
|---|---|
| Indent | Tab |
| Dedent | Shift+Tab |
| Toggle Comment | Ctrl+/ |
| Find | Ctrl+F |
| Find & Replace | Ctrl+H |
| Go to Line | Ctrl+G |
The agent operates within the Thumper data directory (~/.local/share/tr-desktop/) and app directories. System files are off-limits.
5. Test & Iterate
The Refinement Loop
- Describe what you want (code mode)
- Review the generated code in the editor
- Tell the agent what to fix (natural language)
- Agent reads current state, applies targeted edits
- Repeat until satisfied
Example: Iterating on a Workflow
The workflow runs but quality is low
Thinking: Low quality → likely not enough steps or missing negative prompt
[file_read] Reading portrait.json...
[file_edit] Increased KSampler steps 25→40, set cfg_scale to 8.5
Add a negative prompt: blurry, low quality, watermark, text
[file_edit] Added CLIPTextEncode for negative prompt, connected to KSampler negative input
Now test it
[run_command] curl -s -X POST http://localhost:8188/prompt -d @portrait.json
Workflow queued. Check ComfyUI at http://localhost:8188 for results.
Error Recovery
When things go wrong, the agent handles it:
- Tool fails: Agent sees the error in ToolResult and can retry with different parameters.
- file_edit fails (old_string not found): Agent re-reads the file with file_read, adjusts old_string to match current content.
- run_command times out (60s limit): Agent reports the timeout and suggests alternatives.
The agent retries once on malformed output via step_with_retry. If it's stuck after 25 iterations, it stops and explains what went wrong.
6. Advanced Patterns
Multi-File Scaffolding
Ask the agent to create an entire project structure:
"Create a ComfyUI custom node called ThumperResize"
The agent generates __init__.py, resize_node.py, and requirements.txt — each as a separate file_write call with its own editor tab.
Search Then Edit
For bulk changes across files:
"Find all files referencing 'sd_xl_base_1.0.safetensors' and update to 'juggernautXL_v9.safetensors'"
The agent runs search_code to find all matches, then file_edit on each one.
Context Attachment
Attach .json, .yaml, or other reference files at launch to give the agent initial context. This saves tool calls and context tokens.
agent_knowledge.md
Create a persistent knowledge file at ~/.local/share/tr-desktop/agent_knowledge.md (max ~2000 chars). This is loaded at priority 3 into every agent session:
This project uses ComfyUI with SDXL.Models are in /data/models/.Use BF16 on AMD GPUs — never FP16.Preferred sampler: euler_ancestral.
Filesystem Tools Reference
| Tool | Description | Safety | Timeout | Use Case |
|---|---|---|---|---|
| file_read | Read file contents (offset/limit) | Safe | 10s | Inspect before editing |
| file_write | Create or overwrite a file | Confirm | 10s | New files, complete rewrites |
| file_edit | Replace exact string in file | Confirm | 10s | Targeted patches |
| search_code | Regex search across project | Safe | 30s | Find patterns, references |
| list_files | List directory recursively | Safe | 30s | Explore file structure |
| run_command | Execute shell command (sandboxed) | Confirm | 60s | Test, build, validate |
Key Takeaways
- Describe the outcome, not the implementation — let the agent choose the approach
- Use the code-helper template to narrow the tool set for coding tasks
- Always review diffs in the editor before approving file changes
- Iterate with specific feedback — "increase steps to 40" beats "make it better"
- Use "search then edit" for bulk changes across multiple files
- Create agent_knowledge.md for persistent project-specific context