prompt
FreeTerminal-native coding agent for small LLMs
FreeFree tier
About prompt
This is a system prompt designed for small LLMs (8B–35B parameters) to act as a terminal-native coding agent. It specifies architectural principles optimized for constrained context windows (8k–32k tokens), unreliable JSON tool calls, and limited multi-step reasoning. Key components include a deterministic tool router using regex scoring, a plan tracker with running anchors, patch-first editing with search-and-replace, and a forgiving JSON parser. The prompt is part of the ai-boost/awesome-prompts repository on GitHub.
Key Features
Deterministic Tool Router with zero-token classification using regex scoring
Plan Tracker with numbered plan and running anchor for multi-step tasks
Patch-First Editing via exact search-and-replace for reliability
Forgiving JSON Parser that repairs common small-model JSON errors
Read-before-write guard to prevent unintended file modifications
Two-stage routing for context windows under 16k tokens
Assertion guard to maintain tool category mid-task
Pros & Cons
Pros
- Explicitly designed for small LLMs (8B–35B), making it efficient on consumer hardware
- Saves tokens by injecting only relevant tool schemas based on user message category
- Handles common small-model errors like malformed JSON and incomplete steps
- Patch-first editing reduces hallucinations and indentation drift compared to full file rewrites
- Plan tracker provides structure for multi-step tasks with dependency awareness
Cons
- Not suitable for models with very large context windows or high reasoning capability
- Assumes terminal-native environment; may not apply to GUI or web-based agents
- Requires careful tuning of regex scoring and tool schema injection for each use case
- Limited to coding-related tasks (read, write, run, search, plan, etc.)
- No built-in support for non-coding domains like creative writing or data analysis
Best For
Building terminal-native coding agents on consumer hardwareAutomating small-model code generation and editing tasksCreating robust tool-calling workflows with limited context windowsDesigning prompts that compensate for small LLM limitations
FAQ
What size models is this prompt designed for?
The prompt is optimized for small LLMs with 8B to 35B parameters, running on consumer hardware with context windows of 8k–32k tokens.
How does the tool router work?
It uses a weighted regex scoring system to classify user messages into eight categories (read, write, run, search, plan, code-intelligence, web, respond) and injects only the tool schemas for that category, saving tokens.
What is patch-first editing?
It uses exact search-and-replace (patch) as the primary edit primitive because small models are unreliable at whole-file rewrites. Surgical patches of about 10 lines are more reliable than rewriting 300 lines.
How does the plan tracker help?
It forces the model to emit a numbered plan before tool calls and re-injects the plan on every subsequent turn as a running anchor, advancing only when a step is completed.