How-tos
Bash techniques
A ThinkThen function is a shell command. It reads standard input, prints an answer, and sets an exit code. Each page here teaches one shell form with one real run.
Techniques
Branch with ifdecide --quiet prints nothing.Route with casechoose --raw prints the bare label.Handle not surerefund_code=$? names the exit code of decide.Set a cut or a bandOne number is a cut.Loop over lineswhile read hands each line to decide on its own.Chain questions with pipesTwo filters in a row keep the records that pass both questions.Ask many files at onceA function asks one question of one file.Fail a buildfilter finds the lines that hedge.Keep one process for a step loopcoproc holds one choose process open.Judge one paragraph at a timeawk -v RS= splits on blank lines.Guard a coding agent tool callThis Claude Code PreToolUse hook reads a proposed Bash command as text.
Recipes
Label a JSON file and keep its idsLabel every ticket in a JSON array by kind and urgency.Review a diff by what it doesjq cuts a unified diff into hunks.Lint prose for hedgingjq numbers the lines.Fill a form by selectionEvery field is a pick from a list you wrote, or true or false.Set bad records aside firstjq reads each raw line and keeps only JSON objects with a string body.
On GitHub: github.com/botassembly/thinkthen