🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)

🔧 Programmierung 🕛 kürzlich 5 Min Lesezeit
0

Stop Your AI Coding CLI From Wasting Tokens on "Hi" and "Thanks"

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

In this blog post, we will see how a small Python script called is a pre-hook script for AI coding CLIs. It blocks pleasantry-only prompts like "hi", "hello", "ok", and "thank you" before they ever reach the model.



Here is the observation that started this. AI coding assistants are task tools, not chat buddies. Every "hello" still triggers a full round trip: the CLI reads it, sends it to the model, and the model replies. That is a wasted call, wasted tokens, and a small break in your flow, all for a prompt that carries no actual task.



I spend a lot of my time thinking about efficiency, whether that is a load test or a model call, so this felt like an easy win to automate away.



2. How it works



The idea is simple. A hook intercepts your prompt before it reaches the model:



CODE
You type "hi" --> Hook reads prompt --> Regex fullmatch --> Blocked
You type "fix auth bug" --> Hook reads prompt --> No match --> Prompt proceeds


Under the hood, the matcher normalizes your input (lowercase, strip punctuation, collapse whitespace) and checks if the entire prompt is a pleasantry using a fullmatch, not a partial match. That distinction matters a lot. Prompts that contain a pleasantry word but also carry a real task pass through untouched.





A few tools do not have a hook system to plug into yet, so they are not supported: CodeBuddy, OpenCode, Aider, Kilo Code, Trae, Hermes, Pi, OpenClaw, Amp, Google Antigravity, Cline, oh-my-pi, Freebuff, and Command Code.



and clone the repo. Then run the installer:



CODE
python install.py


The installer will:




  1. Copy block_pleasantries.py to ~/.pleasantries/




  2. Detect which AI coding CLIs are installed on your machine




  3. Let you pick which ones to hook




  4. Merge the hook into each CLI's config, skipping anything already installed



If you would rather wire it up by hand, here is the Claude Code config as an example. Add this to ~/.claude/settings.json:



CODE
{
"hooks": {
"UserPromptSubmit": [
{ "hooks": [{ "type": "command",
"command": "python3 /path/to/block_pleasantries.py claude",
"timeout": 5 }] }
]
}
}


Swap in the real path to block_pleasantries.py, and you are set. Every other supported CLI follows the same pattern with its own config file, all documented in the README.



To remove every hook later:



CODE
python install.py --uninstall


Requirements are light: Python 3.10+, no external dependencies beyond the standard library (json, re, sys), and it runs on macOS, Linux, and Windows.



6. Customizing the blocklist



The blocklist lives in the PLEASANTRY_PATTERNS regex inside block_pleasantries.py, grouped by category:





  • Greetings: hi, hello, hey, howdy, good morning, and similar





  • Acknowledgments: ok, sure, yeah, got it





  • Thanks: thank you, thanks, thx, ty





  • Please: please, pls, plz





  • Farewells: bye, goodbye, see ya, later



If your team has its own shorthand, like a Slack-style "yo" or "np", just add it to the matching category and the hook picks it up on the next run.



Adding support for a brand new CLI is just as simple, since the core matcher is CLI-agnostic and each CLI only needs a small adapter function to plug into the shared ADAPTERS dict.



7. Wrap up



Pleasantries is a small tool solving a small but real problem. If you run multiple AI coding CLIs day to day and catch yourself typing "hi" before your actual ask, this hook quietly saves you a wasted model call every single time.



Happy Testing!



Do you type greetings to your AI coding assistant out of habit too, or am I the only one guilty of that?

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
3 Quellen
GPT-6 Astra Release Today? OpenAI’s Next Major AI Model Is Almost Here
1 Quelle
Apple accuses OpenAI of destroying evidence as trade-secrets fight intensifies
1 Quelle
Major AI platforms go down in unprecedented simultaneous outage