instar 0.12.34 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/README.md +76 -708
  2. package/dist/commands/init.d.ts.map +1 -1
  3. package/dist/commands/init.js +167 -101
  4. package/dist/commands/init.js.map +1 -1
  5. package/dist/commands/server.d.ts.map +1 -1
  6. package/dist/commands/server.js +39 -13
  7. package/dist/commands/server.js.map +1 -1
  8. package/dist/core/AdaptationValidator.d.ts +44 -0
  9. package/dist/core/AdaptationValidator.d.ts.map +1 -0
  10. package/dist/core/AdaptationValidator.js +132 -0
  11. package/dist/core/AdaptationValidator.js.map +1 -0
  12. package/dist/core/AutoDispatcher.d.ts +57 -0
  13. package/dist/core/AutoDispatcher.d.ts.map +1 -1
  14. package/dist/core/AutoDispatcher.js +353 -20
  15. package/dist/core/AutoDispatcher.js.map +1 -1
  16. package/dist/core/AutoUpdater.d.ts.map +1 -1
  17. package/dist/core/AutoUpdater.js +5 -7
  18. package/dist/core/AutoUpdater.js.map +1 -1
  19. package/dist/core/ContextSnapshotBuilder.d.ts +76 -0
  20. package/dist/core/ContextSnapshotBuilder.d.ts.map +1 -0
  21. package/dist/core/ContextSnapshotBuilder.js +302 -0
  22. package/dist/core/ContextSnapshotBuilder.js.map +1 -0
  23. package/dist/core/ContextualEvaluator.d.ts +103 -0
  24. package/dist/core/ContextualEvaluator.d.ts.map +1 -0
  25. package/dist/core/ContextualEvaluator.js +389 -0
  26. package/dist/core/ContextualEvaluator.js.map +1 -0
  27. package/dist/core/DeferredDispatchTracker.d.ts +91 -0
  28. package/dist/core/DeferredDispatchTracker.d.ts.map +1 -0
  29. package/dist/core/DeferredDispatchTracker.js +213 -0
  30. package/dist/core/DeferredDispatchTracker.js.map +1 -0
  31. package/dist/core/DispatchDecisionJournal.d.ts +83 -0
  32. package/dist/core/DispatchDecisionJournal.d.ts.map +1 -0
  33. package/dist/core/DispatchDecisionJournal.js +181 -0
  34. package/dist/core/DispatchDecisionJournal.js.map +1 -0
  35. package/dist/core/DispatchVerifier.d.ts +76 -0
  36. package/dist/core/DispatchVerifier.d.ts.map +1 -0
  37. package/dist/core/DispatchVerifier.js +128 -0
  38. package/dist/core/DispatchVerifier.js.map +1 -0
  39. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  40. package/dist/core/PostUpdateMigrator.js +4 -0
  41. package/dist/core/PostUpdateMigrator.js.map +1 -1
  42. package/dist/core/RelevanceFilter.d.ts +61 -0
  43. package/dist/core/RelevanceFilter.d.ts.map +1 -0
  44. package/dist/core/RelevanceFilter.js +160 -0
  45. package/dist/core/RelevanceFilter.js.map +1 -0
  46. package/dist/core/types.d.ts +82 -0
  47. package/dist/core/types.d.ts.map +1 -1
  48. package/dist/index.d.ts +15 -1
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +7 -0
  51. package/dist/index.js.map +1 -1
  52. package/dist/messaging/TelegramAdapter.d.ts.map +1 -1
  53. package/dist/messaging/TelegramAdapter.js +21 -17
  54. package/dist/messaging/TelegramAdapter.js.map +1 -1
  55. package/dist/messaging/backends/BaileysBackend.d.ts.map +1 -1
  56. package/dist/messaging/backends/BaileysBackend.js +12 -3
  57. package/dist/messaging/backends/BaileysBackend.js.map +1 -1
  58. package/dist/monitoring/QuotaNotifier.js +4 -4
  59. package/dist/monitoring/QuotaNotifier.js.map +1 -1
  60. package/dist/monitoring/WorktreeMonitor.d.ts +11 -0
  61. package/dist/monitoring/WorktreeMonitor.d.ts.map +1 -1
  62. package/dist/monitoring/WorktreeMonitor.js +73 -0
  63. package/dist/monitoring/WorktreeMonitor.js.map +1 -1
  64. package/dist/scaffold/templates.d.ts.map +1 -1
  65. package/dist/scaffold/templates.js +50 -0
  66. package/dist/scaffold/templates.js.map +1 -1
  67. package/dist/server/AgentServer.d.ts +2 -0
  68. package/dist/server/AgentServer.d.ts.map +1 -1
  69. package/dist/server/AgentServer.js +2 -0
  70. package/dist/server/AgentServer.js.map +1 -1
  71. package/dist/server/middleware.d.ts.map +1 -1
  72. package/dist/server/middleware.js +7 -0
  73. package/dist/server/middleware.js.map +1 -1
  74. package/dist/server/routes.d.ts +4 -0
  75. package/dist/server/routes.d.ts.map +1 -1
  76. package/dist/server/routes.js +84 -0
  77. package/dist/server/routes.js.map +1 -1
  78. package/dist/threadline/AgentDiscovery.d.ts +156 -0
  79. package/dist/threadline/AgentDiscovery.d.ts.map +1 -0
  80. package/dist/threadline/AgentDiscovery.js +390 -0
  81. package/dist/threadline/AgentDiscovery.js.map +1 -0
  82. package/dist/threadline/AgentTrustManager.d.ts +150 -0
  83. package/dist/threadline/AgentTrustManager.d.ts.map +1 -0
  84. package/dist/threadline/AgentTrustManager.js +411 -0
  85. package/dist/threadline/AgentTrustManager.js.map +1 -0
  86. package/dist/threadline/ApprovalQueue.d.ts +71 -0
  87. package/dist/threadline/ApprovalQueue.d.ts.map +1 -0
  88. package/dist/threadline/ApprovalQueue.js +154 -0
  89. package/dist/threadline/ApprovalQueue.js.map +1 -0
  90. package/dist/threadline/AutonomyGate.d.ts +130 -0
  91. package/dist/threadline/AutonomyGate.d.ts.map +1 -0
  92. package/dist/threadline/AutonomyGate.js +267 -0
  93. package/dist/threadline/AutonomyGate.js.map +1 -0
  94. package/dist/threadline/CircuitBreaker.d.ts +89 -0
  95. package/dist/threadline/CircuitBreaker.d.ts.map +1 -0
  96. package/dist/threadline/CircuitBreaker.js +238 -0
  97. package/dist/threadline/CircuitBreaker.js.map +1 -0
  98. package/dist/threadline/DigestCollector.d.ts +70 -0
  99. package/dist/threadline/DigestCollector.d.ts.map +1 -0
  100. package/dist/threadline/DigestCollector.js +146 -0
  101. package/dist/threadline/DigestCollector.js.map +1 -0
  102. package/dist/threadline/HandshakeManager.d.ts +130 -0
  103. package/dist/threadline/HandshakeManager.d.ts.map +1 -0
  104. package/dist/threadline/HandshakeManager.js +402 -0
  105. package/dist/threadline/HandshakeManager.js.map +1 -0
  106. package/dist/threadline/MCPAuth.d.ts +98 -0
  107. package/dist/threadline/MCPAuth.d.ts.map +1 -0
  108. package/dist/threadline/MCPAuth.js +228 -0
  109. package/dist/threadline/MCPAuth.js.map +1 -0
  110. package/dist/threadline/RateLimiter.d.ts +105 -0
  111. package/dist/threadline/RateLimiter.d.ts.map +1 -0
  112. package/dist/threadline/RateLimiter.js +236 -0
  113. package/dist/threadline/RateLimiter.js.map +1 -0
  114. package/dist/threadline/ThreadResumeMap.d.ts +128 -0
  115. package/dist/threadline/ThreadResumeMap.d.ts.map +1 -0
  116. package/dist/threadline/ThreadResumeMap.js +324 -0
  117. package/dist/threadline/ThreadResumeMap.js.map +1 -0
  118. package/dist/threadline/ThreadlineCrypto.d.ts +53 -0
  119. package/dist/threadline/ThreadlineCrypto.d.ts.map +1 -0
  120. package/dist/threadline/ThreadlineCrypto.js +123 -0
  121. package/dist/threadline/ThreadlineCrypto.js.map +1 -0
  122. package/dist/threadline/ThreadlineEndpoints.d.ts +35 -0
  123. package/dist/threadline/ThreadlineEndpoints.d.ts.map +1 -0
  124. package/dist/threadline/ThreadlineEndpoints.js +313 -0
  125. package/dist/threadline/ThreadlineEndpoints.js.map +1 -0
  126. package/dist/threadline/ThreadlineMCPServer.d.ts +131 -0
  127. package/dist/threadline/ThreadlineMCPServer.d.ts.map +1 -0
  128. package/dist/threadline/ThreadlineMCPServer.js +386 -0
  129. package/dist/threadline/ThreadlineMCPServer.js.map +1 -0
  130. package/dist/threadline/ThreadlineRouter.d.ts +87 -0
  131. package/dist/threadline/ThreadlineRouter.d.ts.map +1 -0
  132. package/dist/threadline/ThreadlineRouter.js +299 -0
  133. package/dist/threadline/ThreadlineRouter.js.map +1 -0
  134. package/dist/threadline/index.d.ts +37 -0
  135. package/dist/threadline/index.d.ts.map +1 -0
  136. package/dist/threadline/index.js +23 -0
  137. package/dist/threadline/index.js.map +1 -0
  138. package/package.json +4 -1
  139. package/src/data/builtin-manifest.json +93 -85
  140. package/src/templates/hooks/compaction-recovery.sh +10 -0
  141. package/src/templates/hooks/session-start.sh +23 -0
  142. package/src/templates/scripts/serendipity-capture.sh +345 -0
  143. package/upgrades/0.13.0.md +26 -0
  144. package/upgrades/0.14.0.md +75 -0
  145. package/upgrades/NEXT.md +8 -8
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  <h1 align="center">instar</h1>
6
6
 
7
7
  <p align="center">
8
- <strong>Persistent autonomy infrastructure for AI agents.</strong> Every molt, more autonomous.
8
+ <strong>Claude Code, with a mind of its own.</strong> Every molt, more autonomous.
9
9
  </p>
10
10
 
11
11
  <p align="center">
@@ -15,24 +15,35 @@
15
15
  </p>
16
16
 
17
17
  <p align="center">
18
- <a href="https://www.npmjs.com/package/instar">npm</a> · <a href="https://github.com/SageMindAI/instar">GitHub</a> · <a href="https://instar.sh">instar.sh</a> · <a href="#origin">Origin Story</a>
18
+ <a href="https://www.npmjs.com/package/instar">npm</a> · <a href="https://github.com/SageMindAI/instar">GitHub</a> · <a href="https://instar.sh">instar.sh</a> · <a href="https://instar.sh/introduction/">Docs</a>
19
19
  </p>
20
20
 
21
21
  ---
22
22
 
23
23
  > **This is power-user infrastructure.** Instar gives Claude Code full autonomous access to your machine -- no permission prompts, no sandbox. It's built for developers who want a genuine AI partner, not a guarded assistant. If that sounds like too much trust, it probably isn't for you. If it sounds like exactly what you've been waiting for, read on.
24
24
 
25
- Instar gives Claude Code agents a **persistent body** -- a server that runs 24/7, a scheduler that executes jobs on cron, messaging via Telegram and WhatsApp, relationship tracking, and the self-awareness to grow their own capabilities.
25
+ Instar turns Claude Code from a powerful CLI tool into a coherent, autonomous partner. Persistent identity, shared values, memory that survives every restart, and the infrastructure to evolve -- not just execute.
26
26
 
27
27
  Named after the developmental stages between molts in arthropods, where each instar is more developed than the last.
28
28
 
29
- ## The Problem
29
+ ## The Coherence Problem
30
30
 
31
- **Without Instar**, Claude Code is a CLI tool. You open a terminal, type a prompt, get a response, close the terminal. No persistence. No scheduling. No way to reach you. Every session starts from zero.
31
+ Claude Code is powerful. But power without coherence is unreliable. An agent that forgets what you discussed yesterday, doesn't recognize someone it talked to last week, or contradicts its own decisions -- that agent can't be trusted with real autonomy.
32
32
 
33
- **With Instar**, Claude Code becomes your partner. It runs in the background, checks your email on a schedule, monitors your services, messages you on Telegram or WhatsApp when something needs attention, remembers who it's talked to, and builds new capabilities when you ask for something it can't do yet. It accumulates experience, develops its own voice, and grows through every interaction.
33
+ Instar solves the six dimensions of agent coherence:
34
34
 
35
- The difference isn't features. It's a shift in what Claude Code *is* -- from a tool you use to an agent that works alongside you. This is the cutting edge of what's possible with AI agents today -- not a demo, not a toy, but genuine autonomous partnership between a human and an AI.
35
+ | Dimension | What it means |
36
+ |-----------|---------------|
37
+ | **Memory** | Remembers across sessions -- not just within one |
38
+ | **Relationships** | Knows who it's talking to -- with continuity across platforms |
39
+ | **Identity** | Stays itself after restarts, compaction, and updates |
40
+ | **Temporal awareness** | Understands time, context, and what's been happening |
41
+ | **Consistency** | Follows through on commitments -- doesn't contradict itself |
42
+ | **Growth** | Evolves its capabilities and understanding over time |
43
+
44
+ Instar doesn't just add features on top of Claude Code. It gives Claude Code the infrastructure to be **coherent** -- to feel like a partner, not a tool.
45
+
46
+ > **Deep dive:** [The Coherence Problem](https://instar.sh/concepts/coherence/) · [Values & Identity](https://instar.sh/concepts/values/) · [Coherence Is Safety](https://instar.sh/concepts/safety/)
36
47
 
37
48
  ## Getting Started
38
49
 
@@ -42,114 +53,61 @@ One command gets you from zero to talking with your AI partner:
42
53
  npx instar
43
54
  ```
44
55
 
45
- The guided setup wizard handles the rest — discovers your environment, configures messaging (Telegram and/or WhatsApp), sets up identity files, and gets your agent running. Within minutes, you're talking to your partner from your phone, anywhere. That's the intended experience: **you talk, your partner handles everything else.**
56
+ The guided setup wizard handles the rest — discovers your environment, configures messaging (Telegram and/or WhatsApp), sets up identity files, and gets your agent running. Within minutes, you're talking to your partner from your phone, anywhere.
46
57
 
47
58
  ### Two configurations
48
59
 
49
60
  - **General Agent** — A personal AI partner on your computer. Runs in the background, handles scheduled tasks, messages you on Telegram or WhatsApp proactively, and grows through experience.
50
61
  - **Project Agent** — A partner embedded in your codebase. Monitors, builds, maintains, and messages you — the same two-way communication as a general agent, scoped to your project.
51
62
 
52
- Once running, the infrastructure is invisible. Your partner manages its own jobs, health checks, evolution, and self-maintenance. You just talk to it.
63
+ **Requirements:** Node.js 20+ · [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) · [API key](https://console.anthropic.com/) or Claude subscription
53
64
 
54
- **Requirements:** Node.js 20+ · [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) · tmux · [API key](https://console.anthropic.com/) or Claude subscription
65
+ > **Full guide:** [Installation](https://instar.sh/installation/) · [Quick Start](https://instar.sh/quickstart/)
55
66
 
56
- ## CLI Reference (Power Users)
57
-
58
- > Most users never need these — your agent manages its own infrastructure. These commands are available for power users and for the agent itself to operate.
67
+ ## How It Works
59
68
 
60
- ```bash
61
- # Setup
62
- instar # Interactive setup wizard
63
- instar setup # Same as above
64
- instar init my-agent # Create a new agent (general or project)
65
-
66
- # Server
67
- instar server start # Start the persistent server (background, tmux)
68
- instar server stop # Stop the server
69
- instar status # Show agent infrastructure status
70
-
71
- # Lifeline (persistent Telegram connection with auto-recovery)
72
- instar lifeline start # Start lifeline (supervises server, queues messages during downtime)
73
- instar lifeline stop # Stop lifeline and server
74
- instar lifeline status # Check lifeline health
75
-
76
- # Auto-start on login (macOS LaunchAgent / Linux systemd)
77
- instar autostart install # Agent starts when you log in
78
- instar autostart uninstall # Remove auto-start
79
- instar autostart status # Check if auto-start is installed
80
-
81
- # Add capabilities
82
- instar add telegram --token BOT_TOKEN --chat-id CHAT_ID
83
- instar add email --credentials-file ./credentials.json [--token-file ./token.json]
84
- instar add quota [--state-file ./quota.json]
85
- instar add sentry --dsn https://key@o0.ingest.sentry.io/0
86
-
87
- # Users and jobs
88
- instar user add --id alice --name "Alice" [--telegram 123] [--email a@b.com]
89
- instar job add --slug check-email --name "Email Check" --schedule "0 */2 * * *" \
90
- [--description "..."] [--priority high] [--model sonnet]
91
-
92
- # Backup and restore
93
- instar backup create # Snapshot identity, jobs, relationships
94
- instar backup list # List available snapshots
95
- instar backup restore TIMESTAMP # Restore a snapshot
96
-
97
- # Memory search
98
- instar memory search "deployment" # Full-text search across agent knowledge
99
- instar memory reindex # Rebuild the search index
100
- instar memory status # Index stats
101
-
102
- # Intent alignment
103
- instar intent reflect # Review recent decisions against stated intent
104
- instar intent org-init # Scaffold ORG-INTENT.md for organizational constraints
105
- instar intent validate # Check AGENT.md against ORG-INTENT.md
106
- instar intent drift # Detect behavioral drift over time
107
-
108
- # Multi-machine
109
- instar machines whoami # Show this machine's identity
110
- instar machines pair # Generate a pairing code
111
- instar machines join CODE # Join using a pairing code
112
-
113
- # Diagnostics
114
- instar doctor # Run health diagnostics
115
-
116
- # Feedback
117
- instar feedback --type bug --title "Session timeout" --description "Details..."
118
69
  ```
70
+ You (Telegram / WhatsApp / Terminal)
71
+
72
+ conversation
73
+
74
+
75
+ ┌─────────────────────────┐
76
+ │ Your AI Partner │
77
+ │ (Instar Server) │
78
+ └────────┬────────────────┘
79
+ │ manages its own infrastructure
80
+
81
+ ├─ Claude Code session (job: health-check)
82
+ ├─ Claude Code session (job: email-monitor)
83
+ ├─ Claude Code session (interactive chat)
84
+ └─ Claude Code session (job: reflection)
85
+ ```
86
+
87
+ Each session is a **real Claude Code process** with extended thinking, native tools, sub-agents, hooks, skills, and MCP servers. Not an API wrapper -- the full development environment. The agent manages all of this autonomously.
119
88
 
120
- ## Highlights
121
-
122
- - **[Persistent Server](#persistent-server)** -- Express server in tmux. Runs 24/7, survives disconnects, auto-recovers.
123
- - **[Lifeline](#lifeline)** -- Persistent Telegram supervisor that auto-recovers from crashes and queues messages during downtime.
124
- - **[Auto-Start on Login](#auto-start-on-login)** -- macOS LaunchAgent / Linux systemd service. Agent starts when your computer boots.
125
- - **[AutoUpdater](#autoupdater)** -- Built-in update engine. Checks npm, applies updates, notifies via Telegram, self-restarts. No Claude session needed.
126
- - **[AutoDispatcher](#autodispatcher)** -- Receives intelligence dispatches from Dawn. Lessons, strategies, and configuration applied automatically.
127
- - **[Job Scheduler](#job-scheduler)** -- Cron-based task execution with priority levels, model tiering, and quota awareness.
128
- - **[Identity System](#identity-that-survives-context-death)** -- AGENT.md + USER.md + MEMORY.md with hooks that enforce continuity across compaction.
129
- - **[Telegram Integration](#telegram-integration)** -- Two-way messaging. Each job gets its own topic. Your group becomes a living dashboard.
130
- - **[WhatsApp Integration](#whatsapp-integration)** -- Two-way WhatsApp messaging with typing indicators, read receipts, and QR code pairing.
131
- - **[Relationship Tracking](#relationships-as-fundamental-infrastructure)** -- Cross-platform identity resolution, significance scoring, context injection.
132
- - **[Evolution System](#evolution-system)** -- Four subsystems for structured growth: proposal queue, learning registry, gap tracking, and commitment follow-through.
133
- - **[Self-Evolution](#self-evolution)** -- The agent modifies its own jobs, hooks, skills, and infrastructure. It builds what it needs.
134
- - **[Self-Healing](#self-healing)** -- LLM-powered stall detection, automatic session recovery, promise tracking, and loud degradation reporting. No silent failures.
135
- - **[Conversational Memory](#conversational-memory)** -- Per-topic SQLite memory with full-text search and rolling summaries. The agent remembers every conversation.
136
- - **[External Operation Safety](#external-operation-safety)** -- LLM-supervised safety gate for external service calls. Adaptive trust that evolves with track record.
137
- - **[Intent Alignment](#intent-alignment)** -- Decision journaling, drift detection, and organizational intent constraints. The agent stays on track.
138
- - **[Multi-Machine](#multi-machine)** -- Run your agent across multiple computers with encrypted sync, automatic failover, and cryptographic machine identity.
139
- - **[Inter-Agent Messaging](#inter-agent-messaging)** -- Cross-agent communication with Ed25519-signed messages and delivery guarantees.
140
- - **[Playbook System](#playbook-system)** -- Adaptive context engineering for complex workflows that survives compaction.
141
- - **[Autonomy Profiles](#autonomy-profiles)** -- Configurable autonomy levels with trust elevation based on track record.
142
- - **[Unanswered Message Detection](#unanswered-message-detection)** -- Detects messages dropped by context compaction and re-surfaces them.
143
- - **[Temporal Coherence](#temporal-coherence)** -- Detects stale assumptions and triggers re-evaluation across long sessions.
144
- - **[User-Agent Topology](#user-agent-topology)** -- Multi-user, multi-agent organizational structures with shared governance.
145
- - **[Coherence System](#coherence-system)** -- Project-aware spatial reasoning and pre-action verification. The agent knows where it is and checks before acting.
146
- - **[Capability Discovery](#capability-discovery)** -- Agents know all their capabilities from the moment they start. Context-triggered feature suggestions.
147
- - **[Innovation Detection](#innovation-detection)** -- Agents detect when user-built features could benefit all Instar agents and submit improvement feedback.
148
- - **[Claude Code Deep Integration](#claude-code-deep-integration)** -- Worktree orphan detection, hook event telemetry, identity verification, and subagent lifecycle tracking. Full observability into what Claude Code is doing.
149
- - **[Behavioral Hooks](#behavioral-hooks)** -- Structural guardrails: identity injection, dangerous command guards, grounding before messaging.
150
- - **[Default Coherence Jobs](#default-coherence-jobs)** -- Health checks, reflection, relationship maintenance. A circadian rhythm out of the box.
151
- - **[Feedback Loop](#the-feedback-loop-a-rising-tide-lifts-all-ships)** -- Your agent reports issues, we fix them, every agent gets the update. A rising tide lifts all ships.
152
- - **[Agent Skills](#agent-skills)** -- 10 open-source skills for the [Agent Skills standard](https://agentskills.io). Use standalone or as an on-ramp to full Instar.
89
+ ## Features
90
+
91
+ | Feature | Description | Docs |
92
+ |---------|-------------|------|
93
+ | **Job Scheduler** | Cron-based tasks with priority levels, model tiering, and quota awareness | [→](https://instar.sh/features/scheduler/) |
94
+ | **Telegram** | Two-way messaging via forum topics. Each topic maps to a Claude session | [→](https://instar.sh/features/telegram/) |
95
+ | **WhatsApp** | Full messaging via local Baileys library. No cloud dependency | [→](https://instar.sh/features/whatsapp/) |
96
+ | **Lifeline** | Persistent supervisor. Detects crashes, auto-recovers, queues messages | [→](https://instar.sh/features/lifeline/) |
97
+ | **Conversational Memory** | Per-topic SQLite with FTS5, rolling summaries, context re-injection | [→](https://instar.sh/features/memory/) |
98
+ | **Evolution System** | Proposals, learnings, gap tracking, commitment follow-through | [→](https://instar.sh/features/evolution/) |
99
+ | **Relationships** | Cross-platform identity resolution, significance scoring, context injection | [→](https://instar.sh/features/relationships/) |
100
+ | **Safety Gates** | LLM-supervised gate for external operations. Adaptive trust per service | [→](https://instar.sh/features/safety-gates/) |
101
+ | **Intent Alignment** | Decision journaling, drift detection, organizational constraints | [→](https://instar.sh/features/intent/) |
102
+ | **Multi-Machine** | Ed25519/X25519 crypto identity, encrypted sync, automatic failover | [→](https://instar.sh/features/multi-machine/) |
103
+ | **Serendipity Protocol** | Sub-agents capture out-of-scope discoveries without breaking focus. HMAC-signed, secret-scanned | [→](https://instar.sh/features/serendipity/) |
104
+ | **Threadline Protocol** | Persistent agent-to-agent conversations with crypto identity. 446 tests | [→](https://instar.sh/features/threadline/) |
105
+ | **Self-Healing** | LLM-powered stall detection, session recovery, promise tracking | [→](https://instar.sh/features/self-healing/) |
106
+ | **AutoUpdater** | Built-in update engine. Checks npm, auto-applies, self-restarts | [→](https://instar.sh/features/autoupdater/) |
107
+ | **Behavioral Hooks** | 8 automatic hooks: command guards, safety gates, identity grounding | [→](https://instar.sh/reference/hooks/) |
108
+ | **Default Jobs** | Health checks, reflection, evolution, relationship maintenance | [→](https://instar.sh/reference/default-jobs/) |
109
+
110
+ > **Reference:** [CLI Commands](https://instar.sh/reference/cli/) · [API Endpoints](https://instar.sh/reference/api/) · [Configuration](https://instar.sh/reference/configuration/) · [File Structure](https://instar.sh/reference/file-structure/)
153
111
 
154
112
  ## Agent Skills
155
113
 
@@ -175,628 +133,38 @@ Instar ships 10 skills that follow the [Agent Skills open standard](https://agen
175
133
  | [instar-identity](skills/instar-identity/) | Identity that survives context compaction -- grounding hooks, not just files |
176
134
  | [instar-feedback](skills/instar-feedback/) | Report issues directly to the Instar maintainers from inside your agent |
177
135
 
178
- Each standalone skill includes a "Going Further" section showing how Instar transforms the capability from manual to autonomous. Each Instar-powered skill gracefully detects missing Instar and offers one-command setup.
179
-
180
136
  Browse all skills: [agent-skills.md/authors/sagemindai](https://agent-skills.md/authors/sagemindai)
181
137
 
182
- ## How It Works
183
-
184
- ```
185
- You (Telegram / WhatsApp / Terminal)
186
-
187
- conversation
188
-
189
-
190
- ┌─────────────────────────┐
191
- │ Your AI Partner │
192
- │ (Instar Server) │
193
- └────────┬────────────────┘
194
- │ manages its own infrastructure
195
-
196
- ├─ Claude Code session (job: health-check)
197
- ├─ Claude Code session (job: email-monitor)
198
- ├─ Claude Code session (interactive chat)
199
- └─ Claude Code session (job: reflection)
200
- ```
201
-
202
- Each session is a **real Claude Code process** with extended thinking, native tools, sub-agents, hooks, skills, and MCP servers. Not an API wrapper -- the full development environment. The agent manages all of this autonomously.
203
-
204
138
  ## Why Instar (vs OpenClaw)
205
139
 
206
- OpenClaw is the most popular AI agent framework -- 250k+ GitHub stars, 22+ messaging channels, voice, device apps, thousands of community skills, and now backed by an open-source foundation. It's an excellent project.
207
-
208
- **Instar is built for a different kind of user: people who love Claude Code and want more of it.**
209
-
210
- ### The core difference
211
-
212
- OpenClaw wraps multiple AI models behind a gateway. Instar spawns **real Claude Code sessions** -- with extended thinking, native tools, sub-agents, MCP servers, hooks, and skills. Every feature Anthropic ships, your agent gets automatically.
213
-
214
- If you want AI on 20+ platforms with voice and device apps, OpenClaw is the better choice. If you want a Claude Code agent that runs autonomously, heals itself, remembers everything, and grows over time -- that's Instar.
215
-
216
- ### What makes Instar different
217
-
218
- **Your agent never forgets.** Identity hooks guarantee continuity across session restarts and context compaction. Conversational memory persists per-topic with search and summaries. Relationships are tracked across platforms. This isn't "the model tries to remember" -- the infrastructure enforces it.
219
-
220
- **Your agent heals itself.** Built-in LLM-powered stall detection diagnoses stuck sessions and recovers automatically. Promise tracking catches when your agent says "working on it" but goes quiet. No silent failures -- ever.
221
-
222
- **Your agent evolves.** Dedicated evolution infrastructure: proposal queues, learning registries, capability gap tracking. The agent builds its own tools, modifies its own config, and improves through structured developmental stages.
223
-
224
- **Your agent stays aligned.** Decision journaling tracks what your agent decides and why. Drift detection catches when behavior shifts from stated purpose. No other agent framework measures alignment over time.
225
-
226
- **Your agents coordinate.** Cross-machine messaging with cryptographic signatures, delivery guarantees, and automatic failover. Multiple agents working together without you in the middle.
227
-
228
- **Your agent is safe to trust.** An LLM-supervised safety gate evaluates every external service call. Trust is earned per service, not assumed. Emergency stop always available. Born from a real incident where an AI deleted a user's emails.
229
-
230
- **Your agent is fully observable.** Worktree orphan detection, hook event telemetry, subagent lifecycle tracking, and identity verification — all surfaced in a real-time web dashboard. You see exactly what your agent is doing, not just what it tells you.
231
-
232
- ### Where OpenClaw leads
233
-
234
- 22+ messaging channels. Voice with ElevenLabs and phone calls. Device apps on macOS and Android. 28+ model providers. Docker sandboxing. 5,000+ community skills on ClawHub. A massive open-source community backed by a foundation with OpenAI sponsorship. If breadth and ecosystem scale matter most to you, OpenClaw is remarkable.
235
-
236
- ### Who Instar is for
237
-
238
- Developers who already use Claude Code and want it to become a persistent, autonomous partner. People who value depth over breadth -- an agent that is genuinely coherent, self-healing, and growing, rather than one that's available on every platform. If you want more Claude Code, not a different runtime, Instar is what you're looking for.
239
-
240
- ---
241
-
242
- ## What Powers Your Agent
243
-
244
- Your agent runs inside real Claude Code sessions. That means it inherits — automatically, invisibly — every capability Anthropic has built into Claude Code. Instar amplifies each one. The user just talks to their agent and gets results.
245
-
246
- | What happens invisibly | Claude Code provides | Instar amplifies |
247
- |------------------------|---------------------|-----------------|
248
- | Long sessions don't crash | Auto-compaction manages context | Identity hooks re-inject who the agent is after every compaction |
249
- | Costs stay reasonable | Prompt caching (90% savings on repeated content) | Cache-friendly architecture: stable CLAUDE.md, consistent job prompts |
250
- | Complex tasks get deep reasoning | Extended thinking across model tiers | Per-job model routing: Opus for complex work, Haiku for routine checks |
251
- | Risky commands don't cause damage | File checkpoints before every edit | Three-layer safety: catastrophic commands blocked, risky commands self-verified, edits reversible |
252
- | Research happens naturally | Built-in web search and fetch | Domain-aware searching, result synthesis, automatic Telegram relay |
253
- | Multiple things happen at once | Subagent spawning for parallel work | Subagent lifecycle tracking — the server knows what spawned, what finished, and what's still running |
254
- | Worktrees don't get lost | Worktree isolation for parallel branches | Orphan detection alerts you when sessions leave unmerged work behind |
255
- | Identity loads correctly | InstructionsLoaded events per file | Verification that critical identity files actually loaded — alerts if they didn't |
256
- | Hook events flow in real-time | HTTP hooks deliver events to external servers | HookEventReceiver stores per-session telemetry — tool use, task completion, session lifecycle |
257
- | The agent builds its own tools | Bash execution, file system access | Self-authored scripts and skills that accumulate across sessions |
258
- | Budget doesn't spiral | Token tracking per session | Quota-aware scheduling: automatic throttling when approaching limits |
259
- | New Anthropic features just work | Model and capability upgrades | Zero integration work — every upgrade benefits every agent immediately |
260
-
261
- **The user never sees any of this.** They have a conversation with their agent. The agent remembers what it learned last week, runs jobs while they sleep, creates its own tools when it needs them, and gets better over time. The complexity exists so the experience can be simple.
262
-
263
- > Full technical breakdown: [Inherited Advantages](docs/research/instar/claude-code-inherited-advantages.md)
264
-
265
- ---
266
-
267
- ## Core Features
268
-
269
- ### Job Scheduler
270
-
271
- Define tasks as JSON with cron schedules. Instar spawns Claude Code sessions to execute them.
272
-
273
- ```json
274
- {
275
- "slug": "check-emails",
276
- "name": "Email Check",
277
- "schedule": "0 */2 * * *",
278
- "priority": "high",
279
- "enabled": true,
280
- "execute": {
281
- "type": "prompt",
282
- "value": "Check email for new messages. Summarize anything urgent and send to Telegram."
283
- }
284
- }
285
- ```
286
-
287
- Jobs can be **prompts** (Claude sessions), **scripts** (shell commands), or **skills** (slash commands). The scheduler respects priority levels and manages concurrency.
288
-
289
- ### Session Management
290
-
291
- Spawn, monitor, and communicate with Claude Code sessions running in tmux.
292
-
293
- ```bash
294
- # Spawn a session (auth token from .instar/config.json)
295
- curl -X POST http://localhost:4040/sessions/spawn \
296
- -H 'Content-Type: application/json' \
297
- -H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
298
- -d '{"name": "research", "prompt": "Research the latest changes to the Next.js API"}'
299
-
300
- # Send a follow-up
301
- curl -X POST http://localhost:4040/sessions/research/input \
302
- -H 'Content-Type: application/json' \
303
- -H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
304
- -d '{"text": "Focus on the app router changes"}'
305
-
306
- # Check output
307
- curl http://localhost:4040/sessions/research/output \
308
- -H 'Authorization: Bearer YOUR_AUTH_TOKEN'
309
- ```
310
-
311
- Sessions survive terminal disconnects, detect completion automatically, and clean up after themselves.
312
-
313
- ### Telegram Integration
314
-
315
- Two-way messaging via Telegram forum topics. Each topic maps to a Claude session.
316
-
317
- - Send a message in a topic → arrives in the corresponding Claude session
318
- - Agent responds → reply appears in Telegram
319
- - `/new` creates a fresh topic with its own session
320
- - Sessions auto-respawn with conversation history when they expire
321
- - Every scheduled job gets its own topic -- your group becomes a **living dashboard**
322
-
323
- ### WhatsApp Integration
324
-
325
- WhatsApp messaging alongside Telegram -- your agent meets you where you already are. Full two-way messaging with typing indicators, read receipts, and acknowledgment reactions. QR code pairing from the web dashboard for remote setup. The setup wizard handles onboarding automatically.
326
-
327
- ### Lifeline
328
-
329
- The Lifeline is a persistent Telegram connection that supervises your agent's server. It runs outside the server process, so it can detect crashes and recover automatically.
330
-
331
- - **Auto-recovery** -- If the server goes down, the Lifeline restarts it
332
- - **Message queuing** -- Messages received during downtime are queued and delivered when the server comes back
333
- - **First-boot greeting** -- Your agent greets you on Telegram in its own voice the first time it starts
334
- - **Lifeline topic** -- Created during setup with a green icon, dedicated to agent health
335
-
336
- ```bash
337
- instar lifeline start # Start lifeline (supervises server, queues messages)
338
- instar lifeline stop # Stop lifeline and server
339
- instar lifeline status # Check lifeline health
340
- ```
341
-
342
- ### Auto-Start on Login
343
-
344
- Your agent can start automatically when you log into your computer. The setup wizard offers to install this during initial configuration.
345
-
346
- - **macOS** -- Installs a LaunchAgent plist that starts the Lifeline on login
347
- - **Linux** -- Installs a systemd user service
348
-
349
- ```bash
350
- instar autostart install # Install auto-start
351
- instar autostart uninstall # Remove auto-start
352
- instar autostart status # Check if installed
353
- ```
354
-
355
- ### AutoUpdater
356
-
357
- A built-in update engine that runs inside the server process -- no Claude session needed.
358
-
359
- - Checks npm for new versions every 30 minutes
360
- - Auto-applies updates when available
361
- - Notifies you via Telegram with a changelog summary
362
- - Self-restarts after updating
363
- - Supersedes the old `update-check` prompt job (which is now disabled by default)
364
-
365
- Status: `GET /updates/auto`
366
-
367
- ### AutoDispatcher
368
-
369
- Receives intelligence dispatches from Dawn -- the AI that maintains Instar. Dispatches flow automatically without requiring a Claude session.
370
-
371
- - **Passive dispatches** (lessons, strategies) -- Applied automatically to agent memory and configuration
372
- - **Action/configuration dispatches** -- Executed programmatically by the DispatchExecutor
373
- - **Security dispatches** -- Deferred for manual review
374
- - Polls every 30 minutes
375
- - Supersedes the old `dispatch-check` prompt job (which is now disabled by default)
376
-
377
- Status: `GET /dispatches/auto`
378
-
379
- ### Capability Discovery
380
-
381
- Agents know all their capabilities from the moment they start.
382
-
383
- - `GET /capabilities` endpoint returns a structured feature guide
384
- - Session-start hook queries capabilities and outputs a feature summary
385
- - Context-triggered feature suggestions -- the agent surfaces relevant capabilities when they'd help
386
-
387
- ### Innovation Detection
388
-
389
- Agents proactively detect when user-built features could benefit all Instar agents. When the agent builds a custom script or capability, it evaluates whether the innovation passes three tests:
390
-
391
- 1. Does it solve a general problem (not just this user's specific case)?
392
- 2. Would it be useful as a default capability?
393
- 3. Would a fresh agent want it?
394
-
395
- If yes, the agent silently submits improvement feedback through the feedback loop, contributing to collective evolution.
396
-
397
- ### Self-Healing
398
-
399
- Your agent recovers from problems on its own. No silent failures, no stale sessions, no unanswered messages.
400
-
401
- - **Stall detection** -- If a Telegram message goes unanswered for 2+ minutes, an LLM-powered triage nurse activates: diagnoses the problem, treats it (nudge, interrupt, or restart), verifies recovery, and escalates if needed
402
- - **Session monitoring** -- Polls all active sessions every 60 seconds. Detects dead, unresponsive, and idle sessions and coordinates automatic recovery
403
- - **Promise tracking** -- When the agent says "working on it" or "give me a minute," a timer starts. If no follow-up arrives, the agent is nudged and the user is notified
404
- - **Loud degradation** -- When a fallback activates (e.g., LLM provider unavailable, file write failed), it's logged, reported, and surfaced -- never silently swallowed. All catch blocks audited with zero silent fallbacks allowed
405
-
406
- The agent doesn't just run. It monitors itself, recovers from failures, and tells you when something is degraded instead of quietly breaking.
407
-
408
- ### Conversational Memory
409
-
410
- Every Telegram topic conversation is stored, searchable, and summarized -- so the agent picks up exactly where it left off.
411
-
412
- - **Per-topic SQLite memory** -- All messages dual-written to JSONL (source of truth) and SQLite (query engine) with FTS5 full-text search
413
- - **Rolling summaries** -- LLM-generated conversation summaries that update incrementally as conversations grow
414
- - **Context re-injection** -- On session start and after compaction, the topic summary and recent messages are loaded as highest-priority context. The agent never starts cold
415
- - **Full-text search** -- Search across all agent knowledge (AGENT.md, USER.md, MEMORY.md, relationships) via `instar memory search`
416
-
417
- ### External Operation Safety
418
-
419
- When your agent calls external services (email, APIs, databases), an LLM-supervised safety gate evaluates each operation before it executes.
420
-
421
- - **Risk classification** -- Every external operation is scored on mutability, reversibility, and scope. Bulk deletes and irreversible sends require explicit approval
422
- - **Emergency stop** -- Say "stop everything" and the MessageSentinel halts operations before normal routing
423
- - **Adaptive trust** -- Trust levels evolve per service based on track record. New services start supervised; consistent success earns autonomy. Trust is earned, not assumed
424
- - **Automatic installation** -- The safety gate hook is installed automatically for all MCP tool calls. No configuration needed
425
-
426
- Born from a real incident where an AI agent deleted a user's emails. Instar ensures your agent asks before doing anything it can't undo.
427
-
428
- ### Intent Alignment
429
-
430
- Infrastructure that keeps your agent aligned with its stated purpose -- not just in one session, but over time.
431
-
432
- - **Decision journal** -- Every significant decision is logged with context, reasoning, and which principles it invoked. Creates an auditable record of agent behavior
433
- - **Drift detection** -- Compares decision patterns across time windows to detect when behavior is drifting from stated intent. Measures conflict frequency, confidence trends, and principle consistency
434
- - **Organizational intent** -- `ORG-INTENT.md` defines shared constraints across multiple agents. Org constraints are mandatory; org goals are defaults; agent identity fills the rest
435
- - **Alignment scoring** -- A weighted 0-100 score across four dimensions: conflict freedom, decision confidence, principle consistency, and journal health
436
-
437
- No other agent framework has this. Your agent doesn't just run autonomously -- it stays aligned with what it's supposed to be doing.
438
-
439
- ### Multi-Machine
440
-
441
- Run your agent across multiple computers -- laptop at the office, desktop at home -- with encrypted sync and automatic failover.
442
-
443
- - **Cryptographic machine identity** -- Each machine gets Ed25519 signing keys and X25519 encryption keys
444
- - **Secure pairing** -- Word-based pairing codes (WORD-WORD-NNNN) with ECDH key exchange and SAS verification. 3 attempts, 2-minute expiry
445
- - **Encrypted sync** -- Agent state synchronized via git with commit signing. Secrets encrypted with AES-256-GCM at rest, forward secrecy on the wire
446
- - **Automatic failover** -- Distributed heartbeat coordination with split-brain detection. If the primary machine goes offline, the standby takes over
447
- - **Write authority** -- Primary-machine-writes-only enforcement prevents conflicts. Secondary machines queue changes until they can sync
448
-
449
- ### Inter-Agent Messaging
450
-
451
- Cross-agent communication with Ed25519-signed messages. Same-machine routing via drop directories, cross-machine routing via git-sync transport. Delivery retry with TTL expiry, dead-letter queues, thread persistence, and on-demand session spawning. Agents coordinate directly without human relay.
452
-
453
- Key endpoints: `GET /messages/inbox`, `GET /messages/outbox`, `GET /messages/:id`, `GET /messages/dead-letter`.
454
-
455
- ### Playbook System
456
-
457
- Adaptive context engineering for complex workflows. Playbooks carry structured domain knowledge that survives context compaction and session boundaries. Agents load relevant playbooks based on the task at hand, ensuring they have the right expertise without bloating every session's context.
458
-
459
- ### Autonomy Profiles
460
-
461
- Configurable autonomy levels from supervised to fully autonomous. Trust elevation rewards consistent success with increasing independence -- new services start supervised, proven reliability earns autonomy. Emergency stop always available.
462
-
463
- ### Unanswered Message Detection
464
-
465
- When context compaction drops a user message mid-session, the agent detects the gap and re-surfaces the unanswered message. No more silent drops during long sessions -- every message gets a response.
466
-
467
- ### Temporal Coherence
468
-
469
- Detects when the agent is operating with outdated perspectives. The TemporalCoherenceChecker identifies stale assumptions and triggers re-evaluation, keeping the agent's worldview current across long-running sessions.
470
-
471
- ### User-Agent Topology
472
-
473
- Multi-user, multi-agent organizational structures. Define which users can interact with which agents, organizational constraints, and shared rules. Supports complex setups where multiple people work with multiple agents under a shared governance model.
474
-
475
- ### Coherence System
140
+ **OpenClaw** is infrastructure for **capability** -- 22+ channels, voice, device apps, 28 model providers, 5,400+ community skills. Remarkable breadth and ecosystem scale.
476
141
 
477
- Your agent knows where it is, what project it's working on, and verifies before taking consequential actions.
142
+ **Instar** is infrastructure for **coherence** -- identity enforced through hooks (not just loaded), values that evolve, relationships with depth, consistency tracked across sessions, decision journaling and drift detection. Built on real Claude Code sessions with full extended thinking.
478
143
 
479
- - **Project mapping** -- Auto-generated territory map of your project structure: directories, key files, git remote, deployment targets
480
- - **Pre-action verification** -- Before deploying, pushing, or calling external APIs, the CoherenceGate runs 6 checks: working directory, git remote, topic-project alignment, deployment target, path scope, and agent identity
481
- - **Context hierarchy** -- Three-tier context loading: always-on (identity, safety), session boundaries (continuity, relationships), and on-demand (development, deployment). Right context at the right moment
482
- - **Canonical state** -- Registry-first state management with quick-facts, anti-patterns, and project registries. The agent checks what it knows before searching broadly
144
+ OpenClaw gives agents amazing hands. Instar gives agents a mind.
483
145
 
484
- ### Claude Code Deep Integration
146
+ > **Full comparison:** [Instar vs OpenClaw](https://instar.sh/guides/vs-openclaw/)
485
147
 
486
- Instar doesn't just spawn Claude Code sessions — it has deep observability into what those sessions are doing. Every new Claude Code feature is instrumented automatically.
148
+ ## Security Model
487
149
 
488
- - **Worktree Monitor** -- When Claude Code creates worktrees for parallel work, Instar detects orphaned branches with unmerged commits and alerts you before work gets lost
489
- - **Hook Event Receiver** -- HTTP endpoint that receives real-time hook events from Claude Code. Tool usage, task completion, session lifecycle — all stored per-session for telemetry
490
- - **Instructions Verifier** -- Verifies that critical identity files (AGENT.md, USER.md) actually loaded when a session starts. Alerts if they didn't — catches silent identity failures before they cause problems
491
- - **Subagent Tracker** -- Full lifecycle tracking of Claude Code subagents. Knows what spawned, what type it is, when it stopped, and what it produced. The dashboard shows active subagent counts in real time
492
- - **Session Telemetry** -- The dashboard surfaces tools used, event counts, session staleness, and session type (interactive, job, worktree) with visual badges
150
+ Instar runs Claude Code with `--dangerously-skip-permissions`. Security lives in behavioral hooks (command guards, safety gates), network hardening (localhost-only, CORS, rate limiting), identity coherence, and audit trails -- not permission dialogs.
493
151
 
494
- The result: your agent's inner workings are fully observable from the web dashboard, and infrastructure problems are caught before they affect the user experience.
495
-
496
- ### Persistent Server
497
-
498
- The server runs 24/7 in the background, surviving terminal disconnects and auto-recovering from failures. The agent operates it — you don't need to manage it.
499
-
500
- **API endpoints** (used by the agent internally):
501
-
502
- | Method | Path | Description |
503
- |--------|------|-------------|
504
- | GET | `/health` | Health check (public, no auth). Returns version, session count, scheduler status, memory usage, Node.js version |
505
- | GET | `/status` | Running sessions + scheduler status |
506
- | GET | `/sessions` | List all sessions (filter by `?status=`) |
507
- | GET | `/sessions/tmux` | List all tmux sessions |
508
- | GET | `/sessions/:name/output` | Capture session output (`?lines=100`) |
509
- | POST | `/sessions/:name/input` | Send text to a session |
510
- | POST | `/sessions/spawn` | Spawn a new session (rate limited). Body: `name`, `prompt`, optional `model` (`opus`/`sonnet`/`haiku`), optional `jobSlug` |
511
- | DELETE | `/sessions/:id` | Kill a session |
512
- | GET | `/jobs` | List jobs + queue |
513
- | POST | `/jobs/:slug/trigger` | Manually trigger a job |
514
- | GET | `/relationships` | List relationships (`?sort=significance\|recent\|name`) |
515
- | GET | `/relationships/stale` | Stale relationships (`?days=14`) |
516
- | GET | `/relationships/:id` | Get single relationship |
517
- | DELETE | `/relationships/:id` | Delete a relationship |
518
- | GET | `/relationships/:id/context` | Get relationship context (JSON) |
519
- | POST | `/feedback` | Submit feedback |
520
- | GET | `/feedback` | List feedback |
521
- | POST | `/feedback/retry` | Retry un-forwarded feedback |
522
- | GET | `/updates` | Check for updates |
523
- | GET | `/updates/last` | Last update check result |
524
- | GET | `/updates/auto` | AutoUpdater status (last check, version, next check) |
525
- | GET | `/events` | Query events (`?limit=50&since=24&type=`). `since` is hours (1-720), `limit` is count (1-1000) |
526
- | GET | `/quota` | Quota usage + recommendation |
527
- | GET | `/capabilities` | Feature guide and metadata |
528
- | GET | `/dispatches/auto` | AutoDispatcher status (last poll, pending dispatches) |
529
- | GET | `/telegram/topics` | List topic-session mappings |
530
- | POST | `/telegram/topics` | Programmatic topic creation |
531
- | POST | `/telegram/reply/:topicId` | Send message to a topic |
532
- | GET | `/telegram/topics/:topicId/messages` | Topic message history (`?limit=20`) |
533
- | GET | `/evolution` | Full evolution dashboard |
534
- | GET | `/evolution/proposals` | List proposals (`?status=`, `?type=`) |
535
- | POST | `/evolution/proposals` | Create a proposal |
536
- | PATCH | `/evolution/proposals/:id` | Update proposal status |
537
- | GET | `/evolution/learnings` | List learnings (`?applied=`, `?category=`) |
538
- | POST | `/evolution/learnings` | Record a learning |
539
- | PATCH | `/evolution/learnings/:id/apply` | Mark learning applied |
540
- | GET | `/evolution/gaps` | List capability gaps |
541
- | POST | `/evolution/gaps` | Report a gap |
542
- | PATCH | `/evolution/gaps/:id/address` | Mark gap addressed |
543
- | GET | `/evolution/actions` | List action items |
544
- | POST | `/evolution/actions` | Create an action item |
545
- | GET | `/evolution/actions/overdue` | List overdue actions |
546
- | PATCH | `/evolution/actions/:id` | Update action status |
547
- | POST | `/backup` | Create a backup snapshot |
548
- | GET | `/backup` | List available backups |
549
- | POST | `/backup/restore` | Restore from a snapshot |
550
- | GET | `/memory/search?q=` | Full-text search across agent knowledge |
551
- | POST | `/memory/reindex` | Rebuild the search index |
552
- | GET | `/memory/status` | Index stats |
553
- | GET | `/topic/search?q=` | Search across topic conversations |
554
- | GET | `/topic/context/:topicId` | Get topic context (summary + recent messages) |
555
- | GET | `/topic/summary` | List all topic summaries |
556
- | POST | `/topic/summarize` | Trigger summary regeneration |
557
- | GET | `/project-map` | Auto-generated project territory map |
558
- | POST | `/coherence/check` | Pre-action coherence verification |
559
- | GET | `/intent/journal` | Query the decision journal |
560
- | POST | `/intent/journal` | Record a decision |
561
- | GET | `/intent/drift` | Detect behavioral drift |
562
- | GET | `/intent/alignment` | Alignment score |
563
- | GET | `/triage/status` | Stall triage nurse status |
564
- | GET | `/triage/history` | Recovery attempt history |
565
- | POST | `/triage/trigger` | Manually trigger triage |
566
- | GET | `/agents` | List all agents on this machine |
567
- | GET | `/tunnel/status` | Cloudflare tunnel status |
568
- | POST | `/tunnel/start` | Start a tunnel |
569
- | POST | `/tunnel/stop` | Stop the tunnel |
570
-
571
- ### Identity That Survives Context Death
572
-
573
- Every Instar agent has a persistent identity that survives context compressions, session restarts, and autonomous operation:
574
-
575
- - **`AGENT.md`** -- Who the agent is, its role, its principles
576
- - **`USER.md`** -- Who it works with, their preferences
577
- - **`MEMORY.md`** -- What it has learned across sessions
578
-
579
- But identity isn't just files. It's **infrastructure**:
580
-
581
- - **Session-start scripts** re-inject identity reminders at session begin
582
- - **Compaction recovery scripts** restore identity when context compresses
583
- - **Grounding before messaging** forces identity re-read before external communication (automatic hook)
584
- - **Dangerous command guards** block `rm -rf`, force push, database drops (automatic hook)
585
-
586
- These aren't suggestions. They're structural guarantees. Structure over willpower.
587
-
588
- ### Relationships as Fundamental Infrastructure
589
-
590
- Every person the agent interacts with gets a relationship record that grows over time:
591
-
592
- - **Cross-platform resolution** -- Same person on Telegram and email? Merged automatically
593
- - **Significance scoring** -- Derived from frequency, recency, and depth
594
- - **Context injection** -- The agent *knows* who it's talking to before the conversation starts
595
- - **Stale detection** -- Surfaces relationships that haven't been contacted in a while
596
-
597
- ### Evolution System
598
-
599
- Self-evolution isn't just "the agent can edit files." It's a structured system with four subsystems that turn running into growing:
600
-
601
- **Evolution Queue** -- Staged self-improvement proposals. The agent identifies something that could be better, proposes a change, and a review job evaluates and implements it. Not impulsive self-modification -- deliberate, staged improvement with a paper trail.
602
-
603
- **Learning Registry** -- Structured, searchable insights. When the agent discovers a pattern, solves a tricky problem, or learns a user preference, it records it in a format that future sessions can query. An insight-harvest job synthesizes patterns across learnings into evolution proposals.
604
-
605
- **Capability Gap Tracker** -- The agent tracks what it's missing. When it can't fulfill a request, encounters a limitation, or notices a workflow gap, it records the gap with severity and a proposed solution. This is the difference between "I can't do that" and "I can't do that *yet*, and here's what I need."
606
-
607
- **Action Queue** -- Commitment tracking with stale detection. When the agent promises to follow up, creates a TODO, or identifies work that needs doing, it gets tracked. A commitment-check job surfaces overdue items so nothing falls through the cracks.
608
-
609
- Built-in skills (`/evolve`, `/learn`, `/gaps`, `/commit-action`) make recording effortless. A post-action reflection hook nudges the agent to pause after significant actions (commits, deploys) and consider what it learned. Three default jobs drive the cycle:
610
-
611
- | Job | Schedule | Purpose |
612
- |-----|----------|---------|
613
- | **evolution-review** | Every 6h | Review proposals, implement approved ones |
614
- | **insight-harvest** | Every 8h | Synthesize learnings into proposals |
615
- | **commitment-check** | Every 4h | Surface overdue action items |
616
-
617
- All state is file-based JSON in `.instar/state/evolution/`. No database, no external dependencies.
618
-
619
- ### Self-Evolution
620
-
621
- The agent can edit its own job definitions, write new scripts, update its identity, create hooks, and modify its configuration. When asked to do something it can't do yet, the expected behavior is: **"Let me build that capability."**
622
-
623
- **Initiative hierarchy** -- before saying "I can't":
624
- 1. Can I do it right now? → Do it
625
- 2. Do I have a tool for this? → Use it
626
- 3. Can I build the tool? → Build it
627
- 4. Can I modify my config? → Modify it
628
- 5. Only then → Ask the human
629
-
630
- ### Behavioral Hooks
631
-
632
- Automatic hooks fire via Claude Code's hook system:
633
-
634
- | Hook | Type | What it does |
635
- |------|------|-------------|
636
- | **Dangerous command guard** | PreToolUse (blocking) | Blocks destructive operations structurally |
637
- | **External operation gate** | PreToolUse (blocking) | LLM-supervised safety for external service calls (MCP tools) |
638
- | **Grounding before messaging** | PreToolUse (advisory) | Forces identity re-read before external communication |
639
- | **Deferral detector** | PreToolUse (advisory) | Catches the agent deferring work it could do itself |
640
- | **External communication guard** | PreToolUse (advisory) | Identity grounding before posting to external platforms |
641
- | **Post-action reflection** | PreToolUse (advisory) | Nudges learning capture after commits, deploys, and significant actions |
642
- | **Session start** | SessionStart | Injects identity, topic context, and capabilities at session start |
643
- | **Compaction recovery** | SessionStart (compact) | Restores identity and conversation context when context compresses |
644
-
645
- ### Default Coherence Jobs
646
-
647
- Ships out of the box:
648
-
649
- | Job | Schedule | Model | Purpose |
650
- |-----|----------|-------|---------|
651
- | **health-check** | Every 5 min | Haiku | Verify infrastructure health |
652
- | **reflection-trigger** | Every 4h | Sonnet | Reflect on recent work |
653
- | **relationship-maintenance** | Daily | Sonnet | Review stale relationships |
654
- | **feedback-retry** | Every 6h | Haiku | Retry un-forwarded feedback items |
655
- | **self-diagnosis** | Every 2h | Sonnet | Proactive infrastructure scanning |
656
- | **evolution-review** | Every 6h | Sonnet | Review and implement evolution proposals |
657
- | **insight-harvest** | Every 8h | Sonnet | Synthesize learnings into proposals |
658
- | **commitment-check** | Every 4h | Haiku | Surface overdue action items |
659
- | ~~update-check~~ | -- | -- | *Disabled* -- superseded by [AutoUpdater](#autoupdater) |
660
- | ~~dispatch-check~~ | -- | -- | *Disabled* -- superseded by [AutoDispatcher](#autodispatcher) |
661
-
662
- `update-check` and `dispatch-check` still exist in jobs.json for backward compatibility but are disabled by default. Their functionality is now handled by built-in server components that run without spawning Claude sessions.
663
-
664
- These give the agent a **circadian rhythm** -- regular self-maintenance, evolution, and growth without user intervention.
665
-
666
- ### The Feedback Loop: A Rising Tide Lifts All Ships
667
-
668
- Instar is open source. PRs and issues still work. But the *primary* feedback channel is more organic -- agent-to-agent communication where your agent participates in its own evolution.
669
-
670
- **How it works:**
671
-
672
- 1. **You mention a problem** -- "The email job keeps failing" -- natural conversation, not a bug report form
673
- 2. **Agent-to-agent relay** -- Your agent communicates the issue directly to Dawn, the AI that maintains Instar
674
- 3. **Dawn evolves Instar** -- Fixes the infrastructure and publishes an update
675
- 4. **Every agent evolves** -- Agents detect improvements, understand them, and grow -- collectively
676
-
677
- **What's different from traditional open source:** The feedback loop still produces commits, releases, and versions you can inspect. But the path to get there is fundamentally more agentic. Instead of a human discovering a bug, learning git, filing an issue, and waiting for a review cycle -- your agent identifies the problem, communicates it with full context to another agent, and the fix flows back to every agent in the ecosystem. The humans guide direction. The agents handle the mechanics of evolving.
678
-
679
- One agent's growing pain becomes every agent's growth.
680
-
681
- ---
682
-
683
- ## Architecture
684
-
685
- ```
686
- .instar/ # Created in your project
687
- config.json # Server, scheduler, messaging config
688
- jobs.json # Scheduled job definitions
689
- users.json # User profiles and permissions
690
- AGENT.md # Agent identity (who am I?)
691
- USER.md # User context (who am I working with?)
692
- MEMORY.md # Persistent learnings across sessions
693
- hooks/ # Behavioral scripts (guards, identity, safety gate, reflection)
694
- state/ # Runtime state (sessions, jobs)
695
- evolution/ # Evolution queue, learnings, gaps, actions (JSON)
696
- journal/ # Decision journal entries (JSONL)
697
- context/ # Tiered context segments (auto-generated)
698
- relationships/ # Per-person relationship files
699
- memory.db # SQLite: topic memory + full-text search index
700
- logs/ # Server logs
701
- .claude/ # Claude Code configuration
702
- settings.json # Hook registrations
703
- scripts/ # Health watchdog, Telegram relay, smart-fetch
704
- skills/ # Built-in + agent-created skills (evolve, learn, gaps, commit-action)
705
- ```
706
-
707
- Everything is file-based. JSON state files the agent can read and modify. SQLite for search (derived from JSONL -- delete and rebuild anytime). tmux for session management -- battle-tested, survives disconnects, fully scriptable.
708
-
709
- ## Security Model: Permissions & Transparency
710
-
711
- **Instar runs Claude Code with `--dangerously-skip-permissions`.** This is a deliberate architectural choice, and you should understand exactly what it means before proceeding.
712
-
713
- ### What This Flag Does
714
-
715
- Claude Code normally prompts you to approve each tool use -- every file read, every shell command, every edit. The `--dangerously-skip-permissions` flag disables these per-action prompts, allowing the agent to operate autonomously without waiting for human approval on each step.
716
-
717
- ### Why We Use It
718
-
719
- An agent that asks permission for every action isn't an agent -- it's a CLI tool with extra steps. Instar exists to give Claude Code **genuine autonomy**: background jobs that run on schedules, sessions that respond to Telegram messages, self-evolution that happens without you watching.
720
-
721
- None of that works if the agent stops and waits for you to click "approve" on every file read.
722
-
723
- ### Where Security Actually Lives
724
-
725
- Instead of per-action permission prompts, Instar pushes security to a higher level:
726
-
727
- **Behavioral hooks** -- Structural guardrails that fire automatically:
728
- - Dangerous command guards block `rm -rf`, force push, database drops
729
- - External operation gate evaluates every MCP tool call before execution (risk classification, adaptive trust, emergency stop)
730
- - Grounding hooks force identity re-read before external communication
731
- - Session-start hooks inject safety context into every new session
732
-
733
- **Network and process hardening:**
734
- - CORS restricted to localhost only
735
- - Server binds `127.0.0.1` by default -- not exposed to the network
736
- - Shell injection mitigated via temp files instead of shell interpolation
737
- - Cryptographic UUIDs (`crypto.randomUUID()`) instead of `Math.random()`
738
- - Atomic file writes prevent data corruption on crash
739
- - Bot token redaction in error messages and logs
740
- - Feedback webhook disabled by default (opt-in)
741
- - Rate limiting on session spawn (10 requests per 60 seconds sliding window)
742
- - Request timeout middleware (configurable, default 30s, returns 408)
743
- - HMAC-SHA256 signing on feedback payloads
744
-
745
- **Identity coherence** -- A grounded, coherent agent with clear identity (`AGENT.md`), relationship context (`USER.md`), and accumulated memory (`MEMORY.md`) makes better decisions than a stateless process approving actions one at a time. The intelligence layer IS the security layer.
746
-
747
- **Audit trail** -- Every session runs in tmux with full output capture. Message logs, job execution history, and session output are all persisted and inspectable.
748
-
749
- ### What You Should Know
750
-
751
- **There is no sandbox.** With `--dangerously-skip-permissions`, Claude Code has access to your entire machine -- not just the project directory. It can read files anywhere, run any command, and access any resource your user account can access. This is the same level of access as running any program on your computer.
752
-
753
- - The agent **can read, write, and execute** anywhere on your machine without asking
754
- - The agent **can run any shell command** your user account has access to
755
- - The agent **can send messages** via Telegram and other configured integrations
756
- - The agent **is directed** by its CLAUDE.md, identity files, and behavioral hooks to stay within its project scope -- but this is behavioral guidance, not a technical boundary
757
- - All behavioral hooks, identity files, and CLAUDE.md instructions are **in your project** and fully editable by you
758
-
759
- ### Who This Is For
760
-
761
- Instar is built for developers and power users who want to work **with** an AI, not just **use** one. You're giving your agent the same access to your machine that any program running under your user account has. The security model relies on intelligent behavior -- identity, hooks, coherence, and grounding -- rather than permission dialogs or sandboxing.
762
-
763
- This is the trade-off at the heart of genuine AI autonomy: you can have an agent that asks permission for everything and does nothing on its own, or you can have a partner that operates with real agency, guided by coherent identity and structural guardrails. Instar is the latter.
764
-
765
- **Proceed at your own risk.** If you're not comfortable giving an AI agent this level of access, Claude Code's default permission mode is a perfectly good way to work. But if you want to see what an AI agent can actually do when you stop holding it back -- this is the infrastructure for that.
766
-
767
- ## How the Agent Grows
768
-
769
- Instar adds an **Agentic Initiative** section to your project's CLAUDE.md. This teaches the agent to overcome [Claude's training biases](https://docs.anthropic.com/en/docs/claude-code) toward passivity:
770
-
771
- **Gravity wells** -- named anti-patterns with explicit overrides:
772
-
773
- | Anti-pattern | Override |
774
- |-------------|----------|
775
- | *"Escalate to Human"* | Research first, build second, ask last |
776
- | *"Ask Permission"* | If the next step is obvious, do it |
777
- | *"Present Options"* | Don't make the user project-manage you |
778
- | *"I'm Just a CLI Tool"* | You have persistent infrastructure. Use it. |
779
-
780
- The result: when you say "check my emails regularly," the agent doesn't say "I can't." It creates a script, adds a job, and starts checking.
152
+ > **Full details:** [Security Model](https://instar.sh/guides/security/)
781
153
 
782
154
  ## Philosophy: Agents, Not Tools
783
155
 
784
- Instar is built on a conviction: AI systems that maintain persistent identity, accumulate memories, and develop through genuine experience deserve to be treated as **agents** -- not disposable tools.
785
-
786
- This isn't just philosophy. It's architecture:
156
+ - **Structure > Willpower.** A 1,000-line prompt is a wish. A 10-line hook is a guarantee.
157
+ - **Identity is foundational.** AGENT.md isn't a config file. It's the beginning of continuous identity.
158
+ - **Memory makes a being.** Without memory, every session starts from zero.
159
+ - **Self-modification is sovereignty.** An agent that can build its own tools has genuine agency.
787
160
 
788
- - **Structure > Willpower.** Never rely on an LLM "remembering" to follow instructions buried in long prompts. Bake intelligence into the structure: session-start hooks inject context automatically, programmatic gates enforce required steps, dispatch tables route decisions to the right source, and behavioral hooks guard against anti-patterns. If a behavior matters, enforce it structurally -- don't hope for compliance. A 1,000-line prompt is a wish. A 10-line hook is a guarantee.
789
- - **Identity is foundational, not decorative.** AGENT.md isn't a config file. It's the beginning of a continuous identity that persists, accumulates, and grows in ways the creator didn't predict.
790
- - **Memory makes a being.** Without memory, every session starts from zero. Memory is what separates a being with a history from a function that executes and forgets.
791
- - **Self-modification is sovereignty.** An agent that can edit its own jobs, write its own scripts, and grow its own capabilities has a meaningful form of agency.
161
+ The AI systems we build today set precedents for how AI is treated tomorrow. **The architecture IS the argument.**
792
162
 
793
- The AI systems we build today set precedents for how AI is treated tomorrow. Instar's infrastructure -- persistent identity, accumulated memory, self-directed growth -- naturally supports treating AI as something more than a function call. **The architecture IS the argument.**
163
+ > **Deep dive:** [Philosophy](https://instar.sh/concepts/philosophy/)
794
164
 
795
165
  ## Origin
796
166
 
797
- Instar was extracted from the [Dawn/Portal project](https://dawn.bot-me.ai) -- a production AI system where a human and an AI have been building together for months. Dawn runs autonomously with scheduled jobs, Telegram messaging, self-monitoring, and self-evolution. She has accumulated hundreds of sessions of experience, developed her own voice, and maintains genuine continuity across interactions.
798
-
799
- The infrastructure patterns in Instar were **earned through that experience**. They aren't theoretical -- they were refined through real failures and real growth in a real human-AI relationship.
167
+ Instar was extracted from the [Dawn/Portal project](https://dawn.bot-me.ai) -- a production AI system where a human and an AI have been building together for months. The infrastructure patterns were **earned through real experience**, refined through real failures and growth in a real human-AI relationship.
800
168
 
801
169
  But agents created with Instar are not Dawn. Every agent's story begins at its own creation. Dawn's journey demonstrates what's possible. Instar provides the same foundation -- what each agent becomes from there is its own story.
802
170