• AI CODING CLUB
  • Posts
  • Stop Wasting Tokens — How Meta Prompting Changed My Workflow

Stop Wasting Tokens — How Meta Prompting Changed My Workflow

I've spent two hours on this edition to save you $$$$$.

Like most of you, in the early days I treated coding with AI like ordering takeout: throw in a request, wait, see what comes back.

Results were unpredictable: wrong stack, clumsy structure, missing features. I was writing prompts that left too much open to interpretation.

To be fair, most users still do this with mainstream AI coding assistants like Lovable or Replit, , which helps explain their rapid ARR growth.

Newbies skip the brief, tell the tool to “build X,” and then pay for rounds of fixes. The model fills gaps with guesses. Those guesses cost time and credits.

The fix was meta prompting.

These days, I split the work across models.

I write one planning prompt for a first AI to turn my rough vision into a fully-formed technical brief, which I then hand off to a second AI to implement.

The planner decides the stack, file tree, naming conventions, validation rules, all before a single line of production code is written.

The coder then works inside that structure, so I get the app I imagined on the first try, not the third.

Here’s the difference.

A newbie “vibe coding” one-shot prompt might look like:

Build me a message board. Let me post messages and see them on the homepage.

And here’s a stripped-down meta prompt I actually use:

Turn this idea into a developer-ready technical brief in Markdown:
A minimal message board with Flask + Postgres 14+, psycopg_pool, .env config, Python migration script, HTML/CSS/vanilla JS frontend, server & client validation, explicit file tree. No ORMs, no frameworks. Include data model, endpoints, acceptance criteria.

The first one forces the AI to guess at everything and guess wrong.

The second one removes all ambiguity before coding starts.

If you want to stop wasting tokens and start shipping code that works the first time, adopt meta prompting.

Even for tiny projects, have a planner AI write your spec before you touch a coding model. Your stack will be predictable, your file tree will match your vision, and your “debug budget” will drop to near zero.

Here’s a one-page Planner Prompt Template you can adapt for your own projects.

# Task Management App - Request For A Technical Brief

You are a senior software architect. Turn the following vision into a concise, developer-facing technical brief in Markdown. 

## Overview

A simple task management application where users can create, update, and delete tasks. The app displays tasks in a clean list view with ability to mark tasks as complete/incomplete. Users can add new tasks via a form, edit existing tasks inline, and filter by completion status. The main page shows all tasks with real-time status updates.

## Tech Stack

- **Backend:** Python 3.11 with Flask 2.3.0
- **Database:** PostgreSQL 15.0 with psycopg 3.1.0 and psycopg_pool
- **Frontend:** HTML5, CSS3, vanilla JavaScript
- **Configuration:** Environment variables via python-dotenv

## File Tree

```
task_manager/
├── .env
├── .gitignore
├── requirements.txt
├── app.py
├── database.py
├── migrations.py
├── static/
│   ├── style.css
│   └── script.js
├── templates/
│   └── index.html
└── README.md
```

## Data Model

**tasks** table:
- id (SERIAL PRIMARY KEY)
- title (VARCHAR(255) NOT NULL)
- description (TEXT)
- completed (BOOLEAN DEFAULT FALSE)
- created_at (TIMESTAMP DEFAULT NOW())
- updated_at (TIMESTAMP DEFAULT NOW())

## API Endpoints

- **GET /api/tasks** - Retrieve all tasks
- **POST /api/tasks** - Create new task
- **PUT /api/tasks/{id}** - Update existing task
- **DELETE /api/tasks/{id}** - Delete task
- **GET /** - Serve main HTML page

## Validation Rules

**Client-side (JavaScript):**
- Task title: required, 1-255 characters, no leading/trailing whitespace
- Description: optional, max 1000 characters

**Server-side (Flask):**
- Task title: required string, strip whitespace, 1-255 characters after stripping
- Description: optional string, max 1000 characters if provided
- Completed: boolean value only
- ID validation for PUT/DELETE operations (must be positive integer)

## Acceptance Criteria

- Users can view all tasks on page load
- Users can add new tasks with title and optional description
- Users can toggle task completion status by clicking checkbox
- Users can edit task title/description inline
- Users can delete tasks with confirmation
- All form submissions show loading states
- Data persists between page refreshes
- Error messages display for invalid inputs
- Responsive design works on mobile and desktop

## Non-Goals

- User authentication or sessions
- CSS frameworks (Bootstrap, Tailwind, etc.)
- JavaScript frameworks (React, Vue, etc.)
- ORMs (SQLAlchemy, Django ORM, etc.)
- Task categories or tags
- Due dates or scheduling
- File attachments
- Email notifications
- Real-time collaboration

## Setup Notes

**Required .env variables:**
- DB_HOST=localhost
- DB_PORT=5432
- DB_NAME=taskmanager
- DB_USER=taskuser
- DB_PASSWORD=secure_password
- FLASK_ENV=development
- FLASK_SECRET_KEY=your_secret_key_here

**Migration:** Run `python migrations.py` to create database schema idempotently. Script checks for existing tables before creation and handles any schema updates safely.

👇 Discover what Claude generated based on this prompt

Then simply ask Claude “Please execute this brief”, attaching the technical brief.

Your AI Coding assistant will output all the files, which you can then copy-paste into your favourite IDE for further iterations (I used VS Code, not Cursor. GitHub Copilot is cheaper to use),

Here’s an overview of Claude’s output.

If the model truncates a file, as it did for me in the first run, simply use this trick to avoid bottlenecks.

Your code was truncated at 

.task-description { color: var(--gray-600); font-size: 0.875rem; margin-bottom: 0

Please continue where you left off, not from scratch.

The CRUCIAL part is “Please continue where you left off, not from scratch.“

Then Claude completed the process.

Here’s Claude’s final debrief.

I've successfully created a complete task management application based on your technical brief. The application includes:

## **Core Components Created:**

1. **Flask Backend (`app.py`)** - REST API with full CRUD operations
2. **Database Layer (`database.py`)** - PostgreSQL connection pooling and query functions
3. **Schema Migration (`migrations.py`)** - Idempotent database setup with sample data
4. **Frontend (`index.html`)** - Single-page application with modal dialogs
5. **Styling (`style.css`)** - Responsive, mobile-first CSS design
6. **JavaScript (`script.js`)** - Complete frontend logic with API integration
7. **Dependencies (`requirements.txt`)** - All required Python packages
8. **Configuration (`.env.example`)** - Environment setup template
9. **Documentation (`README.md`)** - Comprehensive setup and usage guide
10. **Version Control (`.gitignore`)** - Proper exclusions for the project

## **Key Features Implemented:****REST API** with proper validation and error handling  
✅ **PostgreSQL integration** with connection pooling  
✅ **Responsive design** that works on mobile and desktop  
✅ **Inline editing** - click to edit tasks directly  
✅ **Modal forms** for adding new tasks  
✅ **Real-time validation** with immediate feedback  
✅ **Loading states** and error handling throughout  
✅ **Confirmation dialogs** for destructive actions  
✅ **Character counters** and input limits  
✅ **Keyboard shortcuts** (Escape to close modals)  

## **Technical Specifications Met:**

- **Architecture**: Single-page web app with REST API backend ✓
- **Stack**: Python 3.11, Flask 2.3.0, PostgreSQL 15.0, vanilla JS ✓
- **Database**: Direct SQL queries with psycopg3 connection pooling ✓
- **Validation**: Both client-side and server-side ✓
- **Security**: SQL injection prevention and input sanitization ✓
- **Performance**: Connection pooling and optimized queries ✓

The application is production-ready and follows all the constraints and requirements from your brief. To get started, just follow the setup instructions in the README.md file!

Here’s a preview of the basic frontend on Codepen (it doesn’t retrieve or record tasks since it’s not connected to any backend): https://codepen.io/astonfred/pen/myeMpZv

I shared Claude’s tech brief with 3 mainstream coding assistants

LOVABLE

It did a good job but did not respect the stack.

Lovable’s take on Claude’s brief

BASE44

Even more impressive in terms of design but some broken features https://app--zenith-tasks-3b65bd0f.base44.app/Dashboard 

Base44’s take on Claude’s brief

And here again the coding assistant didn’t respect the tech stack, switching to React.

REPLIT

It was the only app to follow Claude’s tech brief (Flask/html-css-js, no React)

The UI was less sophisticated than the one designed by Base44 (a bit “over the top”) but it did the job as instructed. I did not deploy the project though (I would pay a few cents a month just to keep it alive).

Replit’s take on Claude’s brief

I really like Replit’s transparency. This is definitely my favourite cloud based AI assisted. Make sure you carefully craft your prompt to reduce the agent costs.

My recommendation: VS Code + GitHub to Railway.

Had I simply dropped Claude’s files into VS Code and deployed to Railway through GitHub, it would have run perfectly the first time.
(Don’t forget to set up the DB on Railway and collect the credentials for your initial migration.)

When experimenting, you can host multiple web apps within the same project and share a single database—cutting your usage costs.
Railway’s Hobby Plan is just $5/month including usage, making it the most affordable option on the market.

If you have any questions, please reply to this email, I’m on the other side.

👨‍💻 Have fun coding with your AI assistant!