A personal development agent on the owner's laptop. A task arrives in chat, Jarvis takes it to a verified draft PR and follows it until CI is green and the review is approved. All model calls go through the claude CLI on the Max subscription, with no API key.
Everything runs on a single laptop. The engine is the only process that controls the system. Claude does the substantive work, but changes state only through tools the engine provides.
flowchart LR
O([Owner])
subgraph L[Laptop]
W[Web: chat + admin]
subgraph E[Engine · Node]
API[HTTP API + SSE]
UC[Use cases, state machine, limits]
RUN[ClaudeCliRunner]
WT[Watcher · timer]
MCP[Jarvis MCP · tools]
end
PG[(Postgres · Docker)]
D["claude -p · dispatcher"]
K["claude -p · worker"]
FS[(~/.jarvis: artifacts, worktrees)]
end
GH[(GitHub)]
SRC[(Claude Design · Notion · Google Docs)]
S[(Slack · iteration 2)]
O --> W
W -- REST --> API
API -- SSE --> W
API --> UC --> PG
UC --> RUN --> D & K
D & K -- tool calls --> MCP --> API
K --> FS
K -- MCP with tokens --> SRC
K -- git push, gh pr --> GH
WT -- poll --> GH
WT --> UC
S -. Socket Mode .- API
Receives messages, stores state, launches Claude, watches GitHub, streams events to the web. It does not “think” itself.
Each of your messages triggers a short run that resumes the thread's session. It understands the request, creates and manages tasks, and replies. It does not write code.
Works in the task's git worktree: context, spec, plan, code, checks, review, PR. No process exists between stages; the session is resumed.
Once a minute: CI, reviews, comments. It never runs the model. It wakes the worker only when something changed.
Tools per role: create_task, report_stage, ask_owner, approve… There is no tool for merge or push to main.
Threads, decision and permission cards, tasks, artifacts, live run consoles, limits, connections.
sequenceDiagram
actor O as Owner
participant W as Web
participant E as Engine
participant D as Dispatcher
participant K as Worker
participant G as GitHub
O->>W: message (new thread)
W->>E: POST message
E->>D: resume thread session
D->>E: create_task
E->>E: branch jarvis/T-1 + worktree
E->>K: run: context, spec, plan
K->>E: submit_spec_for_approval
E-->>W: Approve / Comment card
Note over K: process exited, slot free
O->>W: Approve
E->>K: resume: code, checks, review
K->>G: push, draft PR
K->>E: report_pr
loop every 60 s
E->>G: checks, reviews, comments
end
G-->>E: CI failed / reviewer comment
E->>K: resume: fix
K->>G: new commit
G-->>E: CI green + approve
E-->>W: summary in thread
While a task waits for you, CI or review, no Claude process runs and no limits are spent. Your message sent while the worker is running goes to its stdin; otherwise it waits for the next run.
stateDiagram-v2
[*] --> Intake
Intake --> Context
Context --> SpecReview: spec and plan ready
SpecReview --> Context: owner comment
SpecReview --> Implementing: Approve
Implementing --> Verifying
Verifying --> Implementing: check red (up to 3 attempts)
Verifying --> Reviewing
Reviewing --> Implementing: blocking comment
Reviewing --> PROpen: draft PR
PROpen --> Fixing: CI failed / comment
Fixing --> PROpen: new commit
PROpen --> Done: CI green + approve
Context --> Blocked: question or no access
Implementing --> Blocked: question
Blocked --> Context: answer
Verifying --> Failed: attempts exhausted
Fixing --> Blocked: rounds exhausted
Done --> [*]
A task can be cancelled (Cancelled) from any state: the branch and PR remain. Only states where a process is actually running occupy a worker slot.
Data is split by who changes it and whether it can be shared. The agent definition is in git and can be shown to participants. Personal and working data live in ~/.jarvis, outside the repository. State is in Postgres. Session transcripts are stored by Claude Code itself.
Who Jarvis is and how it works. It is a Claude Code plugin that the engine attaches to every run via --plugin-dir.
agent/
.claude-plugin/plugin.json
SOUL.md role, principles, style
USER.example.md template of owner preferences
prompts/
dispatcher.md how to interpret messages, when to create a task
worker/context.md · implement.md · fix-ci.md · address-review.md
agents/ worker subagents
context-researcher.md · implementer.md (per lane) · reviewer.md (the gate) · ui-tester.md
skills/ SDD process, PR handling, visual verification
templates/ context · spec · plan · tasks · result
settings/worker.json allow/deny: what is allowed without asking, what is forbidden
settings/dispatcher.jsonPreferences, config, secrets, and everything the agent produces while working.
~/.jarvis/
USER.md your preferences: language, plan format, PR
jarvis.config.json repository, limits, models, allowlist
.env GITHUB_TOKEN, NOTION_TOKEN, Google, DATABASE_URL
mcp/servers.json connector MCP servers; tokens are substituted from .env
dispatcher/ dispatcher working folder (needed for --resume)
worktrees/T-1/ task git worktree in the target repository
tasks/T-1/
context.md spec.md plan.md tasks.md result.md
screenshots/
runs/R-17/ mcp.json and settings.json generated per runThreads, messages, tasks, journal, runs and every run event, permissions, PR watch state, usage. Details below.
Transcripts in ~/.claude/projects/<folder>/<session>.jsonl and the subscription login (Keychain). Jarvis stores only the session_id. A session is bound to the launch folder, so the dispatcher always starts from ~/.jarvis/dispatcher and the worker from its own worktree.
AGENTS.md with check and dev-server commands, conventions, CI. The worker reads them from its worktree. Project rules are not mixed with the owner's profile.
jarvis/* branches, draft PRs, comments and commits from the Jarvis account. This is what other people see.
claude runs start with --setting-sources project,local: your personal plugins, skills and hooks from ~/.claude do not reach the agent. It sees only the Jarvis plugin, the target repository's rules and the MCP servers from --mcp-config (with --strict-mcp-config).| Table | What it stores | Key fields |
|---|---|---|
| threads | Conversations with the owner | title, status, summary (thread memory), dispatcher_session_id, slack_thread_ts |
| messages | Messages in a thread, including cards | thread_id, author (owner / jarvis / system), kind (text, status, decision, question, permission), body, payload |
| tasks | Tasks | thread_id, stage, waiting_for, branch, worktree_path, pr_number, head_sha, worker_session_id, attempt and round counters |
| task_events | Task journal, append-only | task_id, at, type, payload; written in the same transaction as the state change |
| runs | claude runs | role, task_id / thread_id, stage, session_id, pid, model, status, turns, cost_usd (estimate), exit_reason |
| run_events | Every stream-json event — this is the “console” | run_id, seq, type (text, tool_use, tool_result, error, result), payload jsonb |
| permission_requests | Permission requests | run_id, tool, input_preview, status, answered_at |
| watches | PR watch | task_id, pr_number, head_sha, checks jsonb, review_state, last_comment_id, next_poll_at |
| usage_daily | Daily cost estimate | date, cost_usd, runs, paused |
There are no secrets in the database. Run events pass through a redactor that strips tokens before they are written to the database or sent to the web.
cd ~/.jarvis/dispatcher claude -p "<message>" --resume <thread-session> --output-format stream-json --verbose --plugin-dir agent/ --setting-sources project,local --append-system-prompt-file agent/prompts/dispatcher.md --mcp-config runs/R-n/mcp.json --strict-mcp-config --permission-prompt-tool mcp__jarvis__approve --model sonnet --max-turns 15
cd ~/.jarvis/worktrees/T-1 claude -p --resume <task-session> --input-format stream-json --output-format stream-json --verbose --plugin-dir agent/ --setting-sources project,local --append-system-prompt-file agent/prompts/worker/<stage>.md --settings runs/R-n/settings.json --mcp-config runs/R-n/mcp.json --strict-mcp-config --permission-prompt-tool mcp__jarvis__approve --model sonnet --max-turns 60 --max-budget-usd 3
The engine passes child processes only the variables they need: the worker gets GH_TOKEN and connector tokens, the dispatcher gets nothing. If ANTHROPIC_API_KEY is present in the environment, the engine refuses to start, because otherwise -p would silently switch to API billing.
shared/ Zod contracts: HTTP, SSE, MCP, config
engine/src/
domain/ Task and states, Thread, Run, LimitPolicy
application/ PostOwnerMessage, ApproveSpec,
HandleCodeHostChange, ResumeTask…
+ ports: AgentRunner, CodeHost,
TaskRepository, OwnerChannel
infrastructure/ Drizzle, ClaudeCliRunner, git,
GitHub (Octokit), files, config
presentation/ HTTP+SSE, Jarvis MCP, watcher,
Slack (iteration 2)
web/ chat + admin (React)
agent/ plugin: SOUL, prompts, subagents
compose.yaml Postgres
claude, git, gh are run only in infrastructure.jarvis/*; push to the base branch, force-push and merge are denied in settings and have no tools.Allow / Deny card in the thread; with no answer it is denied on timeout.jarvis.config.jsonDollars are a CLI estimate, not the subscription meter. It is a brake, not precise accounting.