Usage notes
Here are compact prompt templates that usually keep Codex usage down while still getting good output.
The pattern that saves the most usage Give it:
- one narrow goal,
- one bounded file or function,
- one explicit output format,
- one stop condition.
That lines up with OpenAI’s current guidance that Codex usage depends mainly on task size, complexity, context held, and where tasks are executed. OpenAI also notes that Codex pricing for many plans is now token-based, which makes oversized prompts and large context especially relevant. (OpenAI Help Center)
Low-usage templates
1) Single-function bug fix
Only inspect `main.go`, function `handleUpload`. Find the bug causing the failure. Return: 1. root cause in 3 bullets max 2. minimal unified diff Do not scan other files. Do not refactor unrelated code.
2) Small targeted refactor
Only modify `internal/auth/middleware.go`. Goal: reduce duplication in token parsing without changing behavior. Constraints: - keep exported APIs unchanged - no new dependencies Return only a unified diff.
3) Error log triage
Analyze only this error and the code I pasted below. Do not assume repo-wide context. Error: <paste error> Code: <paste small relevant snippet> Return: - most likely cause - second most likely cause - exact patch to try first
4) Focused code review
Review only `storage.go` for: - race conditions - nil dereferences - leaked resources Do not suggest style changes. Rank findings by severity. Limit to top 5 issues.
5) Test generation without repo crawl
Write table-driven tests for `ParseConfig` in `config.go`. Assume no other files unless referenced here. Return a complete `_test.go` file only. Keep cases minimal but high value.
6) Safe optimization pass
Inspect only this function for performance issues: <paste function> Constraints: - preserve behavior - prefer simpler code over clever code - no concurrency changes Return: 1. brief explanation 2. revised function only
7) CLI command help
Create a Cobra subcommand named `serve-certs`. Only produce: - command struct/function - flags - RunE body stub Do not implement unrelated package wiring.
8) SQL / migration help
Review this migration only. Check for: - invalid PostgreSQL syntax - unsafe defaults - ordering issues - rollback concerns Return only concrete problems and corrected SQL.
9) “Do not roam” repo instruction
Work only in these files: - cmd/app/main.go - internal/config/config.go Ignore the rest of the repository unless I explicitly add files later. If you think another file is needed, name it but do not open it.
10) Patch-first mode
I want the smallest fix that works. Do not redesign. Do not rename symbols. Do not move files. Return only the patch.
Good add-ons that reduce waste
Use these as suffixes when needed:
Keep the answer under 200 lines.
Stop after the first good fix.
Ask for no follow-up unless a missing type/signature blocks the patch.
Do not include explanation unless the patch is non-obvious.
Prefer editing existing code over introducing abstractions.
Best workflow for lowest usage
For routine work, this tends to be the most efficient:
- Start with local Codex in CLI or VS Code.
- Use GPT-5-Codex-Mini when it is good enough, since OpenAI says it is a smaller, more cost-effective option that can provide up to 4x more usage in the subscription. (OpenAI Help Center)
- Limit work to one file / one function / one bug.
- Ask for a diff only whenever possible.
- Start a fresh session once context gets bloated.
- Use cloud / long-running tasks only for multi-file or project-scale work, because OpenAI says larger codebases, long-running tasks, and sessions that require more held context use significantly more. (OpenAI Help Center)
What to avoid
These tend to increase usage fast:
Review my whole repo and improve everything.
Find all bugs, refactor, add tests, and optimize performance.
Here are 5,000 lines of logs, what happened?
Keep trying different fixes until all tests pass.
OpenAI’s current notes also indicate Plus is tuned more for steady day-to-day use, while Pro is aimed at longer, higher-intensity Codex sessions. (OpenAI Help Center)
Here’s a reusable “best default” template:
Only inspect <file_or_function>. Goal: <single goal>. Constraints: - no unrelated refactors - no new dependencies - keep public behavior unchanged - do not inspect other files Return: 1. brief root cause 2. minimal unified diff 3. one sentence on risk
And here’s the lowest-usage version:
Only inspect <file>. Fix <specific bug>. Return only a minimal unified diff. Do not explain. Do not inspect other files.
I can turn these into a version tailored for your Go/Postgres/React workflow.