Strix is a stateful AI assistant built with the Claude Agent SDK and Telegram. It maintains persistent memory through file-based state management and can autonomously use tools to communicate and manage its own memory.
- Claude Agent SDK: Autonomous agent with built-in file operations
- Telegram (via grammY): User interface
- File-based Memory: Three-tier memory system (identity, working memory, temporal awareness)
- Custom Tools: Telegram communication tools (send_message, send_reaction, send_image)
Dependencies are already installed. You have:
- Claude Code CLI (globally installed)
- @anthropic-ai/claude-agent-sdk
- grammy (Telegram bot framework)
- zod (schema validation)
- dotenv (environment variables)
Edit .env file and add your API keys:
# Get from https://console.anthropic.com
ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
# Get from @BotFather on Telegram
TELEGRAM_BOT_TOKEN=123456789:your-token-hereTo create a Telegram bot:
- Open Telegram and search for @BotFather
- Send
/newbotcommand - Follow prompts to choose a name and username
- Copy the token to your
.envfile
bun run index.tsYou should see:
๐ฆ Starting Strix...
๐ก Connecting to Telegram...
โ
Strix is now running!
๐ฌ Send a message to your bot on Telegram to begin
- Find your bot on Telegram (search for the username you chose)
- Send
/startto get a welcome message - Send any message - Strix will respond using the Claude Agent SDK
- Check
state/files to see memory updates - Check
logs/journal.jsonlfor interaction logs
User sends Telegram message
โ
grammY receives message
โ
Handler loads memory context from state files
โ
Claude Agent SDK processes with memory + custom tools
โ
Agent autonomously uses tools:
- send_message to respond to user
- Read/Write/Edit to manage state files
- Bash to commit changes to Git
โ
Interaction logged to journal
Persistent Identity (.claude/CLAUDE.md):
- Loaded automatically by Agent SDK
- Defines Strix's persona and operational guidelines
Working Memory (state/*.md):
inbox.md- Unprocessed itemstoday.md- Current taskscommitments.md- Promises madepatterns.md- Learned behaviors
Temporal Awareness (logs/*.jsonl):
journal.jsonl- Conversation historyevents.jsonl- System events
Strix can use these Telegram-specific tools:
send_message: Send text to user (can call multiple times)send_reaction: React with emojisend_image: Send images with captions
Plus all Claude Agent SDK built-in tools:
Read,Write,Edit: File operationsBash: Run commands (for Git commits)Grep,Glob: Search capabilities
strix/
โโโ .claude/
โ โโโ CLAUDE.md # Strix's persona (loaded by Agent SDK)
โโโ src/
โ โโโ agent/tools/
โ โ โโโ telegram-tools.ts # Custom Telegram tools
โ โโโ bot/
โ โ โโโ telegram.ts # Bot initialization
โ โ โโโ handlers.ts # Message handlers (main integration)
โ โโโ memory/
โ โโโ loader.ts # Memory context builder
โ โโโ journal.ts # Journal utilities
โโโ state/ # Working memory (Git tracked)
โ โโโ inbox.md
โ โโโ today.md
โ โโโ commitments.md
โ โโโ patterns.md
โโโ logs/ # Temporal awareness
โ โโโ journal.jsonl
โ โโโ events.jsonl
โโโ index.ts # Main entry point
โโโ .env # API keys (not in Git)
Before running, you need to:
-
Add your API keys to
.env:- Get Anthropic API key from https://console.anthropic.com
- Get Telegram bot token from @BotFather
-
Run the bot:
bun run index.ts -
Test on Telegram: Send messages to your bot
This project was created using bun init in bun v1.2.19. Bun is a fast all-in-one JavaScript runtime.