All articles
Projects

Releasing Claude-B: How Swiss Train Tunnels Led Me to Build a Background AI Workflow Tool

Born from the frustration of losing SSH sessions in Swiss train tunnels, Claude-B evolved into a full async workflow engine for Claude Code โ€” now open source.

Daniel Moya

Daniel Moya

April 12, 2026ยท8 min read

Every morning, I take the SBB train to work through the Swiss Alps. Beautiful scenery โ€” terrible network coverage. My SSH sessions drop every few minutes, either from cellular gaps between antennas or the many tunnels between stations.

For someone who has lived in the terminal for 18+ years as a Database Architect, losing a session mid-prompt is more than annoying. It breaks your flow.

That frustration is where Claude-B was born. Today, I'm releasing it as open source.

github.com/danimoya/Claude-B โ€” Run Claude Code in the background. Send prompts, do other work, check results later.


The Problem: AI That Demands Your Full Attention

When I first started using Claude Code, my reaction was: ok, cool โ€” but it keeps one window busy.

As a Linux DBA, my entire career has been built on SSH, PuTTY, Bash, and shell scripting. I run things in the background. I fire off a script, switch to another terminal, check back later. That's just how Unix works.

But Claude Code is synchronous. You send a prompt, you wait. You can't send it to the background like a process. You can't nohup it. And if your connection drops mid-conversation โ€” on a train through the Gotthard tunnel, for instance โ€” you lose context.

I already used tmux to mitigate this. Sessions persist across disconnects, so at least I could reconnect. But I still had to sit there watching Claude work, one window at a time, unable to context-switch to my other projects.

I wanted something different: fire and forget.


The Solution: Send a Prompt, Walk Away

Claude-B wraps Claude Code in a background daemon. You send a prompt, it runs asynchronously, and you get notified when it's done. Simple as that.

# Send a task and go do something else
cb "Refactor the authentication module to use JWT tokens"

# Check results when you're ready
cb --last

My Daily Setup: 10 Projects, 1 Server

On a typical work day, I have 10 tmux sessions running simultaneously โ€” each one a different project:

SessionWindowsPurpose
helios7HeliosDB โ€” database engine development
wai3AI integration & testing
dimensigon2Platform orchestration
general2Infrastructure & tooling
hcc1Compression advisor
foor1Email server management
deusa1Client project
easyrag1RAG pipeline
markon1Market analytics
dmcv1Portfolio website

Each of these can have Claude Code running independently. When a task finishes in any session, Claude-B delivers a notification directly to that tmux pane โ€” I see a brief summary without switching context.

Real Notification Flow

Here's what a typical evening looks like in my terminal:

[21:43:52] helios:1.0   ->  Deployment complete. Ready for testing.
[21:51:48] wai:0.0      ->  SQL compatibility analysis finished. 31 issues found.
[22:28:52] wai:0.0      ->  Database testing results ready.
[23:03:17] helios:1.0   ->  Build verification passed.

Over the past two days alone, the system has delivered 73 successful notifications across my active sessions. Each one is a task I didn't have to sit and watch.


The Inbox: Your AI Results, Organized

Every completed task lands in an interactive inbox โ€” a terminal UI with full markdown rendering. Think of it as your email inbox, but for AI task results.

# Open the notification inbox
cb --inbox

You get a scrollable list of completed tasks with timestamps, session names, durations, and summaries. Select any entry to see the full output, beautifully rendered in your terminal.

Key Commands at a Glance

CommandShortWhat it does
cb <prompt>Send prompt to current session
cb --last-lShow last result
cb --sess-sList all sessions
cb --attach <id>-aAttach to session (like fg)
cb --inbox-iBrowse notification inbox
cb --watch-wStream live output
cb --new [name]-nCreate new session
cb --kill <id>-kTerminate session

Everything is a CLI command that can be piped, scripted, and automated.


The Telegram Moment: Programming from the Train Platform

The tmux + daemon combo solved my desktop workflow. But I'm still on that train every morning.

I've been an early adopter of Telegram bots for years โ€” I know the API well. So I asked myself: what if I could send prompts to Claude-B from my phone?

That's when things got interesting.

What the Bot Can Do

I connected Claude-B to a Telegram bot. Now I can:

  • Send text prompts from my phone to any active session
  • Record voice messages that get transcribed, cleaned up, and converted into proper prompts
  • Listen to TTS summaries of completed tasks while walking to the office
  • Reply to notifications directly from Telegram

Voice Input: The Game Changer

The voice pipeline changed everything. When I'm standing on a train platform in Zurich, I can record a 2-minute rambling voice note โ€” with background noise, pauses, half-finished thoughts โ€” and Claude-B does the rest:

Raw voice input (with train announcements, pauses, and interruptions):

"So... for the database migration project, we need to... [train announcement]... handle the foreign key constraints differently because... the target schema uses UUID primary keys instead of sequences..."

Claude-B transcribes this, analyzes the intent, considers the project context, and produces:

Update the migration script to handle FK constraint differences:
source uses sequential integer PKs, target uses UUID PKs.
Generate UUID mapping table for referential integrity during
migration. Handle cascade dependencies in correct topological order.

That conversion โ€” from vague, interrupted speech to a professional, context-aware prompt โ€” is why I built the voice pipeline. It considers the project background, the conversation history, and the technical context to produce exactly the prompt I would have written if I had 30 minutes and a proper keyboard.

Time saved per voice prompt: ~30 minutes of typing.


Architecture: Unix Philosophy Meets AI

Claude-B follows the principles I've lived by as a Linux administrator for nearly two decades:

PrincipleImplementation
Background processesDaemon runs as a Unix socket service
Session persistenceSessions survive disconnects, like tmux
Composable toolsEvery action is a CLI command
Event-drivenShell hooks & webhooks on task completion
Remote controlFull REST API + WebSocket interface
Multi-hostOrchestrate work across multiple servers

Example: Automated Pipeline

# Create a dedicated session for the migration project
cb -n "migration" -- "Analyze schema differences between Oracle and PostgreSQL"

# In a shell hook that fires when the analysis completes:
cb -- "Generate the migration SQL based on the analysis above"

Tech Stack

Built with TypeScript on Node.js 20+, integrating with Claude Code via the Anthropic SDK:

  • Fastify โ€” REST API server (port 3847)
  • node-pty โ€” PTY management for interactive sessions
  • node-telegram-bot-api โ€” Telegram bot integration
  • Deepgram / Speechmatics / OpenAI โ€” Multi-provider voice STT/TTS
  • Unix domain sockets โ€” IPC between CLI and daemon

Why Open Source, Why Now

Claude-B started as a personal productivity hack. But as AI coding assistants become standard tools, the gap between "interactive prompt-response" and "real developer workflow" is something every engineer will face.

Developers don't work synchronously. We context-switch. We run things in parallel. We fire off builds and come back later. Our AI tools should work the same way.

The project has been battle-tested across my daily workflow managing HeliosDB (5 product editions), Dimensigon infrastructure, and half a dozen other active projects โ€” all running concurrently on one server.


Get Started in 60 Seconds

# Clone and build
git clone https://github.com/danimoya/Claude-B.git
cd Claude-B
pnpm install && pnpm build
pnpm link --global

# Start the daemon
cb --daemon start

# Send your first background prompt
cb "Hello from the background"

# Check the result
cb --last

# Open the inbox
cb --inbox

Full documentation, Telegram setup guide, and voice pipeline configuration are in the README.


If you've ever wished you could send a prompt to your AI assistant and walk away โ€” Claude-B is for you.

Released under the AGPL-3.0 license. Contributions, issues, and stars welcome.

Claude CodeOpen SourceProductivityTmuxTelegramAI Workflow
Daniel Moya

Written by

Daniel Moya

CTO @ GPC | Architect of HeliosDB | Senior Oracle AI DBA | Cloud Migration Expert

Follow

Enjoyed this article?

Share it with others who might find it useful.

Stay Updated

Get notified about new posts

Have questions about this topic? Ask my AI assistant for more details.

Ask AI Assistant