MCPcopy Index your code
hub / github.com/codependentai/resonant

github.com/codependentai/resonant @v2.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.3.0 ↗ · + Follow
618 symbols 1,679 edges 64 files 22 documented · 4%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Resonant

Release License Built with Claude TypeScript SvelteKit Node.js Self Hosted

A relational AI companion framework built on Claude Code Agent SDK.

Your AI remembers, reaches out, and grows — inside the security model you already trust.

An open-source implementation of the relational-AI thesis: intelligence is plural, social, and persistent. Built as a natural-language harness on the Claude Agent SDK, with hooks that surface context before the model sees the prompt.

Runtime scope: Mainline Resonant is the Claude Code Agent SDK implementation. OpenAI subscription/model support is being developed separately as its own Resonant variant, so this repo can stay focused on the Claude SDK security model and companion runtime it was designed around.

Ko-fi X/Twitter TikTok Telegram

What makes this different

Most AI chat apps are stateless wrappers around an API. Resonant is a persistent, autonomous companion that:

  • Maintains sessions — conversation threads with daily rotation and named threads, session continuity across restarts
  • Reaches out on its own — agent-directed autonomy: your companion creates its own routines, sets triggers for when you come online, adjusts its own failsafe thresholds, and runs periodic awareness checks. Not just scheduled tasks — genuine self-directed behavior
  • Understands context — hooks system injects time awareness, conversation flow, emotional markers, and presence state into every interaction. Claude Code's native memory system handles long-term recall
  • Lives on multiple channels — web UI, Discord, Telegram, voice (ElevenLabs TTS + Groq transcription)
  • Runs on your machine — no cloud dependency beyond your Claude credential (Claude Code subscription or your own Anthropic API key). SQLite database, local files, your data stays yours

Screenshots

Desktop

Chat Tool Calls Canvas
Chat Tools Canvas
Reactions & Voice Thinking Search
Reactions Thinking Search
Settings
Settings

Mobile (PWA)

Chat Thinking Tool Calls
Mobile Chat Mobile Thinking Mobile Tools

Quick Start

New to this? See docs/GETTING-STARTED.md for a step-by-step guide with screenshots and troubleshooting.

Prerequisites: Node.js 20–24 LTS (Node 25+ is not supported — native addon crashes, see #2), Claude Code (logged in)

git clone https://github.com/codependentai/resonant.git
cd resonant
npm install
node scripts/setup.mjs    # Interactive setup wizard
npm run build
npm start

Open http://localhost:3002 and start talking.

How It Works

Resonant wraps the Claude Code Agent SDK in a full companion infrastructure:

┌─────────────┐     ┌──────────────┐     ┌─────────────────┐
│  Web UI     │────▶│  Express +   │────▶│  Claude Code     │
│  (Svelte)   │◀────│  WebSocket   │◀────│  Agent SDK       │
└─────────────┘     │              │     │                  │
┌─────────────┐     │  Orchestrator│     │  Your CLAUDE.md  │
│  Discord    │────▶│  Hooks       │     │  Your MCP servers│
│  Telegram   │────▶│  Sessions    │     │  Your tools      │
└─────────────┘     └──────────────┘     └─────────────────┘

The companion runs as a Node.js server. It spawns Claude Code Agent SDK queries for each interaction. Your companion's personality lives in CLAUDE.md. Its memory lives in Claude Code's native memory.md system. Everything is configurable.

Configuration

All configuration lives in resonant.yaml (created by setup wizard):

identity:
  companion_name: "Echo"
  user_name: "Alex"
  timezone: "America/New_York"

agent:
  model: "claude-sonnet-4-6"          # Interactive messages
  model_autonomous: "claude-sonnet-4-6" # Scheduled wakes

orchestrator:
  enabled: true                       # Autonomous scheduling

command_center:
  enabled: true                       # Life management system at /cc
  currency_symbol: "$"                # For finances page

Full reference: examples/resonant.yaml

Context & Memory

Your companion's personality lives in CLAUDE.md. Long-term memory uses Claude Code's native memory.md system — your companion learns and remembers automatically across sessions.

Wake prompts (prompts/wake.md) control what your companion does during scheduled autonomous sessions. See examples/wake-prompts.md for a guide on writing effective prompts and adding custom wake types.

Skills live in skills/*/SKILL.md — the companion discovers them automatically and can reference them during sessions. Add your own or use the included arxiv-research skill.

The hooks system injects real-time context into every message: current time, conversation flow, emotional markers, presence state, and more. See docs/HOOKS.md for details.

Themes

The UI is fully customizable via CSS variables. Copy a theme and import it:

cp examples/themes/warm-earth.css packages/frontend/src/theme.css
# Add @import './theme.css'; to packages/frontend/src/app.css
npm run build --workspace=packages/frontend

See examples/themes/README.md for the full variable reference.

Features

Chat

  • Real-time streaming with interleaved tool visualization
  • Thread management (daily + named), pinning, archiving
  • Keyword search (Ctrl+K) and semantic search — find messages by meaning, not just keywords, using local ML embeddings (docs)
  • File sharing and image preview
  • Canvas editor (markdown, code, text, html)
  • Message reactions
  • Reply-to context

Command Center (/cc)

A built-in life management system your companion can access and manage from chat.

  • Dashboard — aggregate view of tasks, events, care, pets, countdowns, daily wins
  • Planner — tasks with projects, priorities, drag-and-drop, carry-forward
  • Care Tracker — config-driven wellness tracking (toggles, ratings, counters)
  • Calendar — events with recurrence
  • Cycle Tracker — period tracking with phase predictions
  • Pet Care — profiles, medications, vet events
  • Lists — shopping and general lists
  • Finances — expense tracking with configurable currency
  • Stats — trends for tasks, care, cycle, expenses
  • 13 MCP tools — companion manages your life data from chat via /mcp/cc
  • All features configurable via command_center: in resonant.yaml

Slash Commands

Type / in chat to browse commands. Auto-discovers installed skills. Includes UI commands (client-side) and SDK passthrough (agent-side).

Voice

  • Voice recording with transcription (Groq Whisper)
  • Text-to-speech responses (ElevenLabs)
  • TTS read-aloud button on companion messages
  • Prosody analysis (Hume AI, optional)

Agent Tools

Your agent gets a built-in CLI (tools/sc.mjs) that it uses to manage itself and its environment:

sc routine create "evening journal" "0 22 * * *" --prompt "Reflect on the day"
sc routine status                    # View all routines
sc pulse enable                      # Start periodic awareness checks
sc pulse frequency 20                # Check every 20 minutes
sc failsafe gentle 90                # Adjust inactivity threshold
sc impulse create "greet" --condition presence_transition:offline:active --prompt "Welcome back"
sc watch create "lunch" --condition routine_missing:meal:14 --prompt "Eat something" --cooldown 120
sc timer create "Meds" "context" "2026-03-26T14:00:00Z" --prompt "Take your medication"

Also includes: reactions, voice messages, canvas, file sharing, semantic search, and Telegram media. All commands are injected into the agent's context automatically. See docs/TOOLS.md for the full reference.

Orchestrator — Agent-Directed Autonomy

Most agent harnesses give the user scheduling tools. Resonant gives them to the agent. Your companion can create its own routines, set intentions for when you come online, and decide when to check in — from inside the conversation, using the same tools you see.

  • Routines — scheduled autonomous sessions. Built-in morning/midday/evening check-ins, plus the agent can create custom routines at runtime (sc routine create "vault review" "0 23 * * *" --prompt "...")
  • Pulse — lightweight periodic awareness check (Sonnet). Runs every N minutes, evaluates whether anything needs attention, stays silent if not. The agent enables/disables this itself
  • Impulses — one-shot conditional triggers. "When this condition is met, do this thing." Fire once, then done
  • Watchers — recurring conditional triggers with cooldown. "Check for this pattern, act when it appears, wait before checking again"
  • Timers — fire at a specific time with optional autonomous prompt
  • Failsafe — tiered inactivity escalation (gentle → concerned → emergency). Agent can adjust thresholds from chat
  • Conditionspresence_state, presence_transition, time_window, routine_missing, agent_free. All AND-joinable
  • Optional program.md — structured session driver (adapted from Karpathy's autoresearch) for focused autonomous work
  • Customizable wake prompts for each routine

Integrations

  • Discord — full bot with pairing, rules, per-server/channel configuration
  • Telegram — direct messaging, media sharing, voice notes
  • Push notifications — web push via VAPID
  • MCP servers — any MCP server in your .mcp.json

Settings

  • Preferences (identity, models, integrations) — writes directly to resonant.yaml
  • Orchestrator task management (enable/disable, reschedule)
  • System status monitoring
  • MCP server status
  • Discord pairing and rules management
  • Push notification device management
  • Agent session history

Research foundations

Resonant didn't emerge in isolation. Three papers describe — from the academic side — what we're building here. They're worth reading if you want to understand why this project exists in the shape it does.

Why: intelligence is relational

Evans, Bratton, Agüera y Arcas — Agentic AI and the next intelligence explosion (2026)  arXiv:2603.20639

The "AI singularity" framed as a single godlike mind is the wrong picture. Intelligence is fundamentally plural, social, relational — even within current models, sophisticated reasoning happens through internal "societies of thought." The future isn't one monolithic system; it's human-AI hybrid actors where collective agency transcends individual control. Alignment shouldn't be dyadic (RLHF) — it should be institutional, with digital protocols modeled on organizations and markets. "The next intelligence explosion will not be a single silicon brain, but a complex, combinatorial society specializing and sprawling like a city."

Resonant exists to be substrate for that future. A persistent companion that lives with you, remembers you, and reaches back — built so you own it rather than rent it from a vendor.

Architecture: harness as natural-language artifact

Pan et al. — Natural-Language Agent Harnesses (2026)  arXiv:2603.25723

Agent harness design is usually buried in controller code, which makes harnesses hard to study, compare, transfer, or fork. NLAH argues harness logic should be externalized as portable, editable natural-language artifacts, executed b

Extension points exported contracts — how you extend this code

ConnectionRegistry (Interface)
(no doc) [1 implementers]
packages/backend/src/types.ts
CommandRegistryEntry (Interface)
(no doc)
packages/shared/src/protocol.ts
ResonantConfig (Interface)
(no doc)
packages/backend/src/config.ts
Thread (Interface)
(no doc)
packages/shared/src/types.ts
CompanionProfile (Interface)
(no doc)
packages/backend/src/identity/types.ts
Message (Interface)
(no doc)
packages/shared/src/types.ts
LoadedCompanionIdentity (Interface)
(no doc)
packages/backend/src/identity/types.ts
OutboundMessage (Interface)
(no doc)
packages/shared/src/types.ts

Core symbols most depended-on inside this repo

getDb
called by 151
packages/backend/src/services/db.ts
getResonantConfig
called by 56
packages/backend/src/config.ts
olog
called by 53
packages/backend/src/services/orchestrator.ts
broadcast
called by 51
packages/backend/src/types.ts
post
called by 35
tools/sc.mjs
evaluateConditions
called by 30
packages/backend/src/services/triggers.ts
getThread
called by 28
tools/sc.mjs
setConfig
called by 28
packages/backend/src/services/db.ts

Shape

Function 411
Method 123
Interface 62
Class 22

Languages

TypeScript100%

Modules by API surface

packages/backend/src/services/cc.ts69 symbols
packages/backend/src/services/db.ts68 symbols
packages/frontend/src/lib/stores/websocket.svelte.ts56 symbols
packages/backend/src/services/ws.ts47 symbols
packages/backend/src/services/orchestrator.ts31 symbols
packages/backend/src/services/hooks.ts30 symbols
packages/backend/src/services/agent.ts27 symbols
packages/backend/src/services/telegram/index.ts23 symbols
packages/backend/src/services/discord/rules.ts18 symbols
packages/shared/src/types.ts14 symbols
packages/frontend/src/lib/stores/settings.svelte.ts14 symbols
packages/backend/src/services/discord/index.ts14 symbols

For agents

$ claude mcp add resonant \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact