Lightweight AI gateway daemon orchestrating Claude Code, Codex, and Gemini CLI.
Jinn is an open-source AI gateway that wraps the Claude Code CLI, Codex SDK, and Gemini CLI behind a unified daemon process. It routes tasks to AI engines, manages connectors like Slack, and schedules background work via cron. Jinn is a bus, not a brain.
Most AI agent frameworks reinvent the wheel β custom tool-calling loops, brittle context management, hand-rolled retry logic. Then they charge you per API call on top.
Jinn takes a different approach. It wraps battle-tested professional CLI tools (Claude Code, Codex, Gemini CLI) and adds only what they're missing: routing, scheduling, connectors, and an org system.
Because Jinn uses Claude Code CLI under the hood β Anthropic's own first-party tool β it works with the 200γγ«/mo Max subscription. No per-token API billing. No surprise 500γγ« invoices. Flat rate, unlimited usage.
Other frameworks can't do this. Anthropic banned third-party tools from using Max subscription OAuth tokens in January 2026. Since Jinn delegates to the official CLI, it's fully supported.
| Jinn | OpenClaw | |
|---|---|---|
| Architecture | Wraps professional CLIs (Claude Code, Codex, Gemini) | Custom agentic loop |
| Max subscription | β Works (uses official Claude Code CLI) | β Banned since Jan 2026 |
| Typical cost | 200γγ«/mo flat (Max) or pay-per-use | 300γγ«β750/mo API bills (reported by users) |
| Security | Inherits Claude Code's security model | 512 vulnerabilities found by CrowdStrike |
| Memory & context | Handled natively by Claude Code | Custom implementation with known context-drop bugs |
| Cron scheduling | β Built-in, hot-reloadable | β Fires in wrong agent context |
| Slack integration | β Thread-aware, reaction workflow | β Drops agent-to-agent messages |
| Multi-agent org | Departments, ranks, managers, boards | Flat agent list |
| Self-modification | Agents can edit their own config at runtime | Limited |
Jinn adds zero custom AI logic. No prompt engineering layer. No opinions on how agents should think. All intelligence comes from the engines themselves β Claude Code already handles tool use, file editing, multi-step reasoning, and memory. Jinn just connects it to the outside world.
When Claude Code gets better, Jinn gets better β automatically.
- π Triple engine support β Claude Code CLI + Codex SDK + Gemini CLI
- π¬ Connectors β Slack (threads + reactions), WhatsApp (QR auth), Discord (bot)
- π File attachments β drag & drop files into web chat, passed through to engines
- π± Mobile-responsive β collapsible sidebar and mobile-friendly dashboard
- β° Cron scheduling β hot-reloadable background jobs
- π₯ AI org system β departments, ranks, managers, employees, task boards
- π Web dashboard β chat, org map, kanban, cost tracking, cron visualizer
- π Hot-reload β change config, cron, or org files without restarting
- π οΈ Self-modification β agents can edit their own config, skills, and org at runtime
- π¦ Skills system β reusable markdown playbooks that engines follow natively
- π’ Multi-instance β run multiple isolated Jinn instances side by side
- π MCP support β connect to any MCP server
- β±οΈ Session timeouts β kill runaway sessions after configurable duration (global or per-employee)
- π€ Synchronous employee invocation β
invoke_employeeMCP tool for inline sub-tasks - ποΈ Session compaction β auto-summarize old messages when token count exceeds threshold
- πͺ Hook pipeline β pre/post session and tool observation hooks (shell or JS modules)
npm install -g jinn-cli jinn setup jinn start
Or install via Homebrew:
brew tap hristo2612/jinn https://github.com/hristo2612/jinn brew install jinn jinn setup jinn start
Then open http://localhost:7777.
+----------------+
| jinn CLI |
+-------+--------+
|
+-------v--------+
| Gateway |
| Daemon |
+--+--+--+--+---+
| | | |
+--------------+ | | +--------------+
| | | |
+-------v-------+ +------v------+ +-----------v---+
| Engines | | Connectors | | Web UI |
|Claude|Codex|Gem| | Slack|WA|DC | | localhost:7777|
+----------------+ +-------------+ +---------------+
| |
+-------v-------+ +------v------+
| Cron | | Org |
| Scheduler | | System |
+---------------+ +-------------+
The CLI sends commands to the gateway daemon. The daemon dispatches work to AI engines (Claude Code, Codex, Gemini CLI), manages connector integrations, runs scheduled cron jobs, and serves the web dashboard.
Jinn reads its configuration from ~/.jinn/config.yaml. An example:
gateway: port: 7777 engines: claude: enabled: true codex: enabled: false sessions: maxDurationMinutes: 30 # kill sessions that run longer than this connectors: slack: enabled: true app_token: xapp-... bot_token: xoxb-... cron: jobs: - name: daily-review schedule: "0 9 * * *" task: "Review open PRs" mcp: gateway: enabled: true # expose gateway tools to employees via MCP org: agents: - name: reviewer role: code-review
Sessions can be time-limited at two levels. The global sessions.maxDurationMinutes in config.yaml applies to all sessions. Per-employee overrides take precedence:
# org/historian.yaml maxDurationMinutes: 10 # override global limit for this employee
When a session exceeds its limit, the engine process is killed via SIGTERM. If the engine hasn't started yet (session queued), it is marked as interrupted directly.
Long-running sessions accumulate messages that can overflow transcript syncs and bloat API responses. Compaction automatically summarizes older messages when the estimated token count exceeds a threshold:
sessions: compaction: enabled: true maxEstimatedTokens: 50000 # trigger compaction above this preserveRecentMessages: 6 # keep last N messages verbatim
Compacted messages are replaced with a single structured summary (role: "summary") containing scope, recent user requests, key topics, pending work, and a timeline. Re-compaction merges with existing summaries. The compacted_at field on sessions tracks when compaction last ran.
Hooks provide observable middleware at session and tool-use boundaries. Define hooks in config.yaml:
hooks: preSession: # before engine.run() β can modify prompt or abort - type: shell command: ./hooks/inject-context.sh blocking: true timeoutMs: 5000 postSession: # after engine.run() β fire-and-forget - type: module path: ./hooks/cost-logger.mjs onToolUse: # when engine starts a tool β fire-and-forget - type: module path: ./hooks/tool-usage-tracker.mjs onToolResult: # when a tool finishes β fire-and-forget - type: shell command: ./hooks/audit.sh
Hook types:
shellβ spawns a subprocess, pipes JSON payload to stdin, reads stdout. Exit 0 = allow, exit 2 = deny/abort.moduleβ dynamically imports a JS/TS module with a default async function export. Cached after first load.
Hook events:
| Event | Blocking? | Can modify? |
|---|---|---|
preSession |
Optional | prompt, systemPrompt; can abort |
postSession |
No | Read-only (cost, result, duration) |
onToolUse |
No | Read-only (toolName, toolId) |
onToolResult |
No | Read-only (toolName, toolId) |
Fire-and-forget hooks are concurrency-limited (max 5 concurrent) and never crash the session on failure.
The invoke_employee MCP tool lets employees call other employees inline and get the result back synchronously β useful for fact-checks, lookups, and data formatting without the complexity of async child sessions:
invoke_employee(employee: "historian", prompt: "When was GE14?")
β { status: "idle", result: "GE14 was held on 9 May 2018...", durationMs: 16045 }
Timeout is clamped to 600s max. Orphaned child sessions are automatically interrupted on timeout.
jinn/
packages/
jimmy/ # Core gateway daemon + CLI
web/ # Web dashboard (frontend)
turbo.json # Turborepo build configuration
pnpm-workspace.yaml
tsconfig.base.json
git clone https://github.com/hristo2612/jinn.git cd jinn pnpm install pnpm setup # one-time: builds all packages and creates ~/.jinn pnpm dev # starts gateway + Next.js dev server with hot reload
Open http://localhost:3000 to use the web dashboard.
pnpm dev starts two servers behind the scenes: the gateway daemon on
:7777 (API, WebSocket, connectors) and the Next.js dev server on :3000
(web dashboard with hot reload). Next.js rewrites proxy /api/* and /ws
requests from :3000 to the gateway, so you only need to visit :3000. The
gateway auto-restarts when you edit backend source files via Node's built-in
--watch mode. To use a non-default gateway port, set GATEWAY_PORT=<port>
before running pnpm dev.
Prerequisites: Node.js 22+, pnpm 10+, and the Claude Code CLI (
npm install -g @anthropic-ai/claude-code).
| Command | Description |
|---|---|
pnpm setup |
Build all packages and initialize ~/.jinn (one-time) |
pnpm dev |
Start gateway (:7777) + Next.js dev server (:3000) with hot reload |
pnpm start |
Production-style clean build + start gateway on :7777 |
pnpm stop |
Stop the running gateway daemon |
pnpm status |
Check if the gateway daemon is running |
pnpm build |
Build all packages |
pnpm typecheck |
Run TypeScript type checking |
pnpm lint |
Lint all packages |
pnpm clean |
Clean build artifacts |
Jinn is under active development. Here's what's coming:
- Discord β bot integration via discord.js
- WhatsApp β Baileys-based connector with QR auth and media support
- Telegram β bot API connector with polling and user allowlist
- iMessage β macOS-native via AppleScript bridge
- Email β IMAP/SMTP connector for inbox monitoring and replies
- Webhooks β generic inbound/outbound HTTP webhooks
- Gemini CLI β Google's Gemini as a third engine option
- Local models β Ollama / llama.cpp integration for offline use
- Engine fallback chains β auto-failover to Codex when Claude is rate-limited
- Agent-to-agent messaging β direct communication without board intermediary
- Shared memory β cross-session knowledge that persists across employees
- Performance tracking β employee performance archive with task success rates and quality scoring
- Auto-promotion β promote employees to manager based on track record
- Mobile-responsive UI β collapsible sidebar, mobile-friendly chat
- Live streaming β watch agent responses stream in real-time
- File attachments β drag & drop files into chat with engine passthrough
- Approval workflows β approve/reject agent actions from the dashboard
- Cost analytics β per-employee cost tracking via hook pipeline (
costs.jsonl)
- Plugin system β installable plugins for common integrations (Stripe, Linear, GitHub)
- Session timeouts β configurable
maxDurationMinutesper-employee or global - Session compaction β auto-summarize old messages to bound context growth
- Hook pipeline β pre/post session and tool observation middleware
- REST API auth β API keys for secure remote access
- Multi-user support β team access with roles and permissions
- Docker image β one-command deployment with
docker run
- Skills marketplace β browse and install community skills from skills.sh
- Skill versioning β pin skill versions, auto-update with changelogs
- Skill templates β scaffolding for common patterns (blog pipeline, support inbox, etc.)
Want to suggest a feature? Open an issue.
The web dashboard UI is built on components from ClawPort UI by John Rice, adapted for Jinn's architecture. ClawPort provides the foundation for the theme system, shadcn components, org map, kanban board, cost dashboard, and activity console.
See CONTRIBUTING.md for guidelines on setting up your development environment and submitting pull requests.