Dev builds PreToolUse hook that makes Claude Code ask before git push --force
OkPermission1689 · reddit · 2026-11-14
A developer running multiple parallel Claude Code sessions shares a PreToolUse hook setup: each session points via --settings to a hook that sends every Bash command over a local socket (with a per-session token) to a desktop app, which returns allow/block/ask — with a banner or phone notification on "ask". Key lesson: raw command-string checks aren't enough, since agents emit bash -c, eval, $(...), a && b and obfuscated strings, so commands get unwrapped and every part checked; staged diffs are also scanned for secrets before git commit. The companion app OpenCognit runs Claude Code and other CLIs side by side with an orchestrator, free tier of 4 agents.
More from coding & agent
- Solo dev builds real-time conference translation platform for 70 languages with an agentic harness — evisoft · 2026-11-14
- Open-source Blender add-on runs NVIDIA Kimodo, ARDY and MotionBricks locally for AI motion generation — bdsqlsz · 2026-11-14
- TestPrune: pruning regression tests to unblock AI-driven autonomous bug fixing — burkov · 2026-11-14
- Context beats model choice: Databricks benchmark shows 91% vs 58% for data agents — CautiousUse8597 · 2026-11-14
- Developer skips localhost entirely: prompts go straight to production with AI agent safeguards — marclou · 2026-11-14
- HeyGen MCP demo: one ChatGPT prompt books tickets and sends an avatar birthday video — toolstelegraph · 2026-11-14