hidi — an agent in your pocket
A bridge from Telegram into Claude Code: a real agent with disk and terminal access, wrapped in policy and audit.
- Voice or text from your phone — answers with formatting, files and a live progress status
- Every action passes through policy: what runs silently, what needs confirmation
- A full ledger: what was done, on whose instruction, and what it cost
The problem
I wanted a working agent — the same one I have in the terminal, with files and commands — not a chat toy. But exposing that through a messenger without a gate is reckless: one careless phrasing and it does something irreversible.
How it works
aiogram plus the Claude Agent SDK, one continuous session, access restricted to an allowlist. Authentication rides on the already-logged-in CLI rather than a separate API key — a deliberate choice to live on a subscription instead of per-token billing. The project deliberately started from usefulness, not infrastructure: systemd and deployment arrived only once their absence became annoying.
The hard part
The key finding was a trap in the SDK itself. A function whose name reads like a universal 'may this tool be used' gate is not one: some calls bypassed the check entirely. Until I moved the policy onto a pre-tool-use hook, the protection looked functional and wasn't. That is precisely the class of bug you cannot detect by observing that things work.
Evidence
- A live end-to-end test before declaring it done, not 'the code compiles'
- Four planned stages closed: deployment and service, policy with approvals and audit, rendering with a fallback path, voice input
- Session controls straight from chat: switch model, plan mode, resume, show diff