Prompt engineering notes

Fifteen practical notes on tokens, structure, and cost. Start with the optimizer if you want a number before you read.

CostOct 24, 2026 · 7 min read

How to reduce OpenAI API costs with token optimization

A practical way to lower an OpenAI bill: count the repeated prompt, cut what every call pays for, and keep the line the model actually needs.

PromptingOct 22, 2026 · 7 min read

Zero-shot vs few-shot prompting

When a plain instruction beats an example, and when one worked pair is worth the tokens it adds on every call.

ModelsOct 20, 2026 · 6 min read

Structuring prompts for Claude vs GPT-4

Markdown headings suit GPT-4-class models. Tagged blocks have long been Claude's documented preference. The task inside should be the same.

TokensOct 18, 2026 · 7 min read

What cl100k_base actually counts

cl100k_base is not a word count. Spaces, line starts, digits, and rare words change the token integer GPT-4-class models bill.

TokensOct 16, 2026 · 6 min read

Filler words that waste tokens

Please, kindly, and I would like are real tokens. They are rarely the bulk of the bill. Here is when they are worth deleting.

StructureOct 14, 2026 · 6 min read

Delimiters models actually follow

Fences, headings, and tags work when they separate the assignment from the evidence. A delimiter around everything separates nothing.

FormatOct 12, 2026 · 6 min read

Prompts that return JSON

Ask for the keys, forbid a preamble, and show one valid object. Most JSON failures are prose around an object, not the object.

StructureOct 10, 2026 · 7 min read

System prompt vs user prompt

Put stable rules in the system text and the ticket in the user turn. Two copies of the same rule will drift the first week.

PromptingOct 8, 2026 · 6 min read

When chain-of-thought helps, and when it only adds tokens

Step-by-step reasoning helps some judgments and taxes every call. Ask for the steps only when you have seen the answer fail without them.

EditingOct 6, 2026 · 6 min read

Shorten a prompt without losing the task

Cut copies, souvenirs, and tone paragraphs. Keep the verb, the limit that prevented an incident, and one example that still earns its tokens.

CostOct 4, 2026 · 6 min read

Count tokens before a batch job

A batch multiplies one prompt by every row. Count the template, the longest row, and the output cap before you launch thousands of calls.

StructureOct 2, 2026 · 6 min read

Messy prompt failures that structure fixes

The model answers the sample, follows the customer, or emits two formats. These failures are layout problems more often than model problems.

ModelsSep 30, 2026 · 6 min read

Temperature does not fix a vague prompt

Sampling settings change how often you see an answer. They do not supply the task, the enum, or the ban on invented dates.

PromptingSep 28, 2026 · 6 min read

Role prompts that stay in scope

A role is one sentence about the job. It is not a persona, a license, or a substitute for the constraint you are hoping the persona implies.

ExampleSep 26, 2026 · 7 min read

A worked example: from a rambling support request to a brief

A full pass on a shipping-delay prompt: the messy draft, the structured brief, what the token estimate did, and what a person still has to check.

Nothing here calls an API. A token count in a note is the same cl100k estimate as the tool. Treat it as a planning figure, not an invoice.