โ† Browse

@locoremind/locoagent

A

LocoAgent is an AI-powered social-media agent that autonomously operates real accounts through genuine browser automation.

mcp_servermcp

Install

agr install @locoremind/locoagent --target claude

This artifact does not publish files for Claude.

Document

{ "name": "locoagent", "version": "1.1.0", "description": "LocoAgent - AI-powered social media agent by LocoreMind", "type": "module", "bin": { "claude-clean": "./src/entrypoints/cli.tsx" }, "scripts": { "start": "bun run --preload ./stubs/globals.ts ./src/entrypoints/cli.tsx", "setup-chrome": "bun run scripts/setup-chrome.ts", "setup-chrome:win": "bun run scripts/setup-chrome.ts", "doctor": "bun run scripts/doctor.ts", "run-tasks": "bun run scripts/run-tasks.ts", "run-tasks:dry": "bun run scripts/run-tasks.ts --dry-run", "tail": "bun run scripts/tail-agent.ts", "tail:history": "bun run scripts/tail-agent.ts --from-start", "tail:list": "bun run scripts/tail-agent.ts --list", "workflow": "bun run scripts/workflow-engine.ts", "workflow:list": "bun run scripts/workflow-engine.ts list", "workflow:status": "bun run scripts/workflow-engine.ts status", "workflow:summary": "bun run scripts/workflow-engine.ts summary", "workflow:run": "bun run scripts/workflow-engine.ts run", "workflow:daemon": "bun run scripts/workflow-engine.ts daemon", "typecheck": "tsc --noEmit", "test": "bun test scripts" }, "dependencies": { "@alcalzone/ansi-tokenize": "^0.1.0", "@ant/claude-for-chrome-mcp": "file:./stubs/@ant/claude-for-chrome-mcp", "@ant/computer-use-mcp": "file:./stubs/@ant/computer-use-mcp", "@ant/computer-use-swift": "file:./stubs/@ant/computer-use-swift", "@ant/computer-use-input": "file:./stubs/@ant/computer-use-input", "@anthropic-ai/claude-agent-sdk": "file:./stubs/@anthropic-ai/claude-agent-sdk", "@anthropic-ai/mcpb": "file:./stubs/@anthropic-ai/mcpb", "@anthropic-ai/sandbox-runtime": "file:./stubs/@anthropic-ai/sandbox-runtime", "@anthropic-ai/sdk": "^0.39.0", "@aws-sdk/client-bedrock-runtime": "^3.700.0", "commander": "~13.1.0", "@commander-js/extra-typings": "^13.0.0", "@growthbook/growthbook": "^1.3.0", "@modelcontextprotocol/sdk": "^1.12.0", "@opentelemetry/api": "^1.9.0", "@opentelemetry/api-logs": "^0.200.0", "@opentelemetry/core": "^2.0.0", "@opentelemetry/resources": "^2.0.0", "@opentelemetry/sdk-logs": "^0.200.0", "@opentelemetry/sdk-metrics": "^2.0.0", "@opentelemetry/sdk-trace-base": "^2.0.0", "@opentelemetry/semantic-conventions": "^1.30.0", "ajv": "^8.17.0", "asciichart": "^1.5.0", "auto-bind": "^5.0.0", "axios": "^1.7.0", "bidi-js": "^1.0.0", "chalk": "^5.4.0", "chokidar": "^4.0.0", "cli-boxes": "^3.0.0", "code-excerpt": "^4.0.0", "diff": "^7.0.0", "emoji-regex": "^10.4.0", "env-paths": "^3.0.0", "execa": "^9.5.0", "figures": "^6.1.0", "fuse.js": "^7.0.0", "get-east-asian-width": "^1.3.0", "google-auth-library": "^9.15.0", "highlight.js": "^11.11.0", "https-proxy-agent": "^7.0.0", "ignore": "^7.0.0", "indent-string": "^5.0.0", "ink": "^5.1.0", "jsonc-parser": "^3.3.0", "lodash-es": "^4.17.0", "lru-cache": "^11.0.0", "marked": "^15.0.0", "p-map": "^7.0.0", "picomatch": "^4.0.0", "proper-lockfile": "^4.1.0", "qrcode": "^1.5.0", "react": "^19.0.0", "react-reconciler": "^0.33.0", "semver": "^7.7.0", "shell-quote": "^1.8.0", "signal-exit": "^4.1.0", "stack-utils": "^2.0.0", "strip-ansi": "^7.1.0", "supports-hyperlinks": "^3.1.0", "tree-kill": "^1.2.0", "type-fest": "^4.32.0", "undici": "^7.4.0", "usehooks-ts": "^3.1.0", "vscode-jsonrpc": "^8.2.0", "vscode-languageserver-protocol": "^3.17.0", "vscode-languageserver-types": "^3.17.0", "wrap-ansi": "^9.0.0", "ws": "^8.18.0", "xss": "^1.0.0", "zod": "^3.25.0" }, "devDependencies": { "@types/bun": "latest", "@types/react": "^19.0.0", "@types/lodash-es": "^4.17.0", "@types/semver": "^7.5.0", "@types/ws": "^8.5.0", "@types/diff": "^7.0.0", "@types/shell-quote": "^1.7.0", "@types/proper-lockfile": "^4.1.0", "@types/qrcode": "^1.5.0", "typescript": "^5.7.0" }, "overrides": { "@ant/claude-for-chrome-mcp": "file:./stubs/@ant/claude-for-chrome-mcp", "@ant/computer-use-mcp": "file:./stubs/@ant/computer-use-mcp", "@ant/computer-use-swift": "file:./stubs/@ant/computer-use-swift", "@ant/computer-use-input": "file:./stubs/@ant/computer-use-input", "@anthropic-ai/mcpb": "file:./stubs/@anthropic-ai/mcpb", "@anthropic-ai/sandbox-runtime": "file:./stubs/@anthropic-ai/sandbox-runtime", "@anthropic-ai/claude-agent-sdk": "file:./stubs/@anthropic-ai/claude-agent-sdk", } }

Repository README

Describes LocoreMind/locoagent as a whole, which may contain artifacts other than this one. Where this artifact had no useful description of its own, its summary was taken from here.


๐Ÿ“‘ Table of Contents


โœจ What is LocoAgent?

LocoAgent is an AI-powered social-media agent that autonomously operates real accounts through genuine browser automation. It pairs an LLM-driven agentic loop with the agent-browser CLI to perceive โ†’ decide โ†’ act on live web pages โ€” liking posts, writing replies, following users, and publishing content the way a human would.

Under the hood it is a fork of the Claude Code CLI source tree, re-purposed for social automation: the battle-tested agent loop, ~40 tools, ~90 slash commands, and Ink/React terminal UI are reused, with a thin LocoAgent-specific layer (skills, workflows, persona, operation log) layered on top.

๐ŸŒŸ Why LocoAgent?

FeatureDescription
๐Ÿ–ฅ๏ธReal browser, real sessionsDrives Chrome via CDP with your actual login cookies โ€” no fragile API hacks, no headless fingerprint
๐ŸŽฏPlatform skill systemLoads complete operation playbooks (37 operations for X.com) so the agent finishes composite tasks in a single pass
๐Ÿ”Workflow engineDeterministic, LLM-free browser pipelines that the agent supervises โ€” start, stop, schedule as a daemon
๐Ÿ“’Operation logPersistent cross-session deduplication so the agent never repeats a like, follow, or reply
๐Ÿง Multi-provider LLMAny OpenAI-compatible API โ€” OpenRouter, DeepSeek (thinking mode), OpenAI, Ollama, LM Studio, plus native Anthropic / Bedrock / Vertex
๐ŸŒMulti-platform, concurrentlyDrive X, LinkedIn, and Reddit at the same time โ€” one isolated Chrome per platform, same-platform serial, cross-platform parallel
๐Ÿ–ฅ๏ธCross-OSOne codebase runs on Windows, macOS, and Linux via a host/device abstraction layer

๐Ÿ—๏ธ How It Works

flowchart LR
    User([๐Ÿ‘ค User / Task]) --> Loop

    subgraph Agent["๐Ÿค– LocoAgent Core"]
        Loop["Agentic Loop<br/>(query.ts)"]
        Prompt["System Prompt<br/>(prompts.ts)"]
        Loop <--> Prompt
    end

    Loop <-->|"Anthropic / OpenAI shim"| LLM["๐Ÿง  LLM Provider"]
    Loop --> Tools["๐Ÿ› ๏ธ Tools ยท Bash"]
    Tools --> AB["๐ŸŒ agent-browser CLI"]
    AB --> CDP["Chrome CDP :9222"]
    CDP --> Web[("๐ŸŒ Live Web Page")]

    Skills["๐ŸŽฏ Platform Skills"] -. inject playbook .-> Prompt
    Persona["๐Ÿชช persona/"] -. persona + tasks .-> Prompt
    OpLog[("๐Ÿ“’ Operation Log")] -. dedup .-> Prompt

    WF["๐Ÿ” Workflow Engine"] --> AB

The agent perceives a page with agent-browser snapshot, the LLM decides the next action, a tool acts (click, fill, open), and the result is verified before the loop continues โ€” checking the operation log first so nothing gets done twice.


๐Ÿš€ Installation

โœ… Prerequisites

RequirementVersionNotes
๐ŸฅŸ BunLatestRuntime and package manager (Node is not enough)
๐ŸŸฉ Node.jsโ‰ฅ 18Required by some dependencies
๐ŸŒ agent-browserLatestBrowser-automation CLI
๐Ÿ”ต Google ChromeLatestDriven over CDP
๐ŸŒฟ GitAnyPowers context features

โšก One-click install (recommended)

One command installs Bun + agent-browser, clones the repo, scaffolds .env, and runs the health check. When run in a terminal it asks you to pick a provider (DeepSeek / Anthropic / OpenAI), enter your API key, then pick a model (Enter takes the latest; c lets you type any model name). The base URL is fixed per provider โ€” no need to type it.

macOS / Linux / WSL2

curl -fsSL https://raw.githubusercontent.com/LocoreMind/locoagent/main/install.sh | bash

Windows (PowerShell)

irm https://raw.githubusercontent.com/LocoreMind/locoagent/main/install.ps1 | iex

Installs into the current directory (an empty folder is used as-is; otherwise a ./locoagent subfolder is created; override with LOCO_DIR). The installer prints the exact target and lets you confirm it. Re-running from inside the checkout updates it in place. Afterwards: bun run setup-chrome && bun start. Chrome and Git are detected (not auto-installed) โ€” install them if the script warns.

๐Ÿ“ฅ Manual setup

git clone https://github.com/LocoreMind/locoagent.git
cd locoagent
bun install

# Verify your environment before first run
bun run doctor

โ–ถ๏ธ Run

# Interactive REPL
bun start

# Single query (headless / print mode)
bun start -p "open X.com and like the first post about AI agents"

# With a specific model
bun start --model anthropic/claude-sonnet-4.5

[!TIP] bun run doctor checks Bun, agent-browser, Chrome, and your .env in one shot. Add --check-cdp to probe the CDP port too.


โš™๏ธ Configuration

Create a .env file in the project root โ€” it is auto-loaded at startup (via the preloaded stubs/globals.ts). Configure your provider through the four neutral LLM_* variables; they are translated to the right internal settings at startup, so you never juggle provider-specific variable names:

# โ”€โ”€ LLM Provider โ€” pick ONE โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
LLM_PROVIDER=deepseek        # deepseek | openai | anthropic | custom
LLM_API_KEY=sk-...
LLM_MODEL=deepseek-chat      # blank = provider default
LLM_BASE_URL=                # only for `custom` / self-hosted OpenAI-compatible APIs

# Examples:
#   OpenAI    โ†’ LLM_PROVIDER=openai     LLM_MODEL=gpt-5.5
#   Anthropic โ†’ LLM_PROVIDER=anthropic  LLM_MODEL=claude-sonnet-4-6
#   Custom    โ†’ LLM_PROVIDER=custom     LLM_BASE_URL=http://localhost:1234/v1  LLM_MODEL=...

# โ”€โ”€ Agent behavior โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
SKIP_PERMISSIONS=1                             # required for non-interactive / automated runs

[!TIP] The LLM_* block is the recommended front door. Under the hood it maps to the legacy CLAUDE_CODE_USE_OPENAI / OPENAI_* / ANTHROPIC_* variables, which still work directly for existing setups โ€” an explicitly-set legacy value always wins. DeepSeek, OpenAI, OpenRouter, and every OpenAI-compatible endpoint share the same OPENAI_* namespace internally; the provider is decided by the base URL + model, not by the variable name.

[!NOTE] SKIP_PERMISSIONS=1 makes stubs/globals.ts inject --dangerously-skip-permissions into argv so automated/headless runs don't stop on permission prompts.


๐Ÿง  Model Providers

LocoAgent talks to any OpenAI-compatible API through a built-in translation shim (src/services/api/openaiShim.ts), keeping the rest of the system provider-agnostic.

ProviderBase URLNotes
๐Ÿ”€ OpenRouterhttps://openrouter.ai/api/v1Access 200+ models with one key
๐Ÿณ DeepSeekhttps://api.deepseek.comThinking mode (reasoning_content) fully supported
๐ŸŸข OpenAIhttps://api.openai.com/v1GPT-4o, o-series, etc.
๐Ÿฆ™ Ollamahttp://localhost:11434/v1Local models
๐Ÿ’ป LM Studiohttp://localhost:1234/v1Local models
๐Ÿ…ฐ๏ธ Anthropic(native SDK)Set ANTHROPIC_API_KEY only
โ˜๏ธ AWS Bedrock(native SDK)AWS credentials
๐ŸŒฅ๏ธ Google Vertex AI(native SDK)GCP credentials

Pick any of these with LLM_PROVIDER + LLM_BASE_URL (e.g. LLM_PROVIDER=custom, LLM_BASE_URL=https://openrouter.ai/api/v1). The neutral front door maps to the shim automatically; advanced users can still set CLAUDE_CODE_USE_OPENAI=1 and the OPENAI_* vars directly.

Behind a TLS-intercepting proxy (corporate VPN / campus FortiGate / Zscaler)

If a request fails with unable to get local issuer certificate or untrusted root, your network is re-signing TLS with its own CA. Export that gateway's root certificate to a .pem file and point NODE_EXTRA_CA_CERTS at it in .env โ€” LocoAgent then trusts it on every provider path, including the DeepSeek/OpenAI shim. If the provider host is outright blocked on that network, switch networks (e.g. a phone hotspot) or pick a provider that is allowed.


๐ŸŒ Browser Automation

LocoAgent controls a real Chrome browser over CDP (Chrome DevTools Protocol) using agent-browser.

๐Ÿ”’ Why Chrome CDP?

Social platforms detect and block headless browsers and API automation. LocoAgent runs through a real, full Chrome โ€” same engine, same fingerprint โ€” so it behaves like you actually do. It uses a dedicated, isolated, persistent profile (separate from your everyday Chrome): you log into your accounts once and the session sticks, while your normal browsing is never disturbed.

๐Ÿ› ๏ธ Setup

# One-time: launch the isolated Chrome with CDP (same command on Windows / macOS / Linux).
# It never kills your normal Chrome and never wipes your session.
bun run setup-chrome

# First run only: log into X / your socials in the window that opens โ€” it persists.
# Re-running just reconnects. To wipe the isolated profile and log in fresh:
bun run setup-chrome --reset

# Multi-platform: launch one target, or every target at once (one Chrome each).
bun run setup-chrome --target linkedin
bun run setup-chrome --all

๐Ÿ‘€ The Perceive โ†’ Act โ†’ Verify Loop

agent-browser open https://x.com/home     # ๐Ÿงญ Navigate
agent-browser snapshot -i                  # ๐Ÿ‘€ Perceive โ€” interactive elements with @ref IDs
agent-browser click @e5                     # ๐Ÿ‘† Act โ€” click a like button
agent-browser fill @e3 "Great research!"   # โŒจ๏ธ  Act โ€” type into a reply box
agent-browser screenshot result.png        # โœ… Verify โ€” capture the result

The full agent-browser CLI reference is embedded in the agent's system prompt, so it knows every command natively โ€” skills and workflows reference operations by name rather than re-explaining them.


๐ŸŽฏ Platform Skills

Skills are operation playbooks loaded on demand via slash commands. Loading one injects a complete manual into the agent's context, enabling composite task execution in a single pass.

๐Ÿ“š Available Skills

PlatformCommandOperationsCoverage
๐Ÿฆ X.com (Twitter)/x-com37Browse ยท Engagement ยท Content creation ยท Social graph ยท Profile ยท Navigation ยท Lists

๐Ÿ’ฌ Usage

# Interactive โ€” load the skill, then give a task
> /x-com open home timeline, like first 3 posts about AI, reply to the best one

# Headless
bun start -p "/x-com like 5 posts about 'large language models', then follow the authors"

โž• Adding a New Platform

Create skills/<platform>/SKILL.md with YAML frontmatter:

---
description: "LinkedIn platform operations playbook"
allowed-tools:
  - Bash
user-invocable: true
---

# LinkedIn Operations

## 1. Navigation
...
## 2. Engagement
...

The skill auto-discovers at startup and becomes available as /linkedin. Design each operation as a self-contained section with preconditions, agent-browser commands, a verification step, and known pitfalls (see skills/x-com/SKILL.md for the established format).


๐ŸŒ Multi-Platform Targets

Run several social platforms at the same time โ€” each in its own isolated Chrome, on its own CDP port, behind its own proxy. A single registry, config/browser-targets.json, is the source of truth:

{
  "targets": {
    "x":        { "cdpPort": 9222, "proxy": "http://127.0.0.1:6738" },
    "linkedin": { "cdpPort": 9223, "proxy": null },
    "reddit":   { "cdpPort": 9224, "proxy": null }
  }
}

setup-chrome --all/--target, the workflow engine, and doctor --check-cdp all read from it โ€” add a platform once and every tool picks it up.

bun run setup-chrome --all            # ๐Ÿš€ one isolated Chrome per platform
bun run doctor --check-cdp            # ๐Ÿฉบ probe every target's CDP port

๐Ÿ”€ Same-platform serial ยท cross-platform parallel

The engine reads each workflow's "platform" field and injects the matching target (cdpPort, profile, proxy, device) into the executor โ€” you never hard-code a port. A per-platform file lock then keeps same-platform runs serial (one active tab per profile) while different platforms run concurrently:

# x + x โ†’ serialized; linkedin โ†’ in parallel with them. Automatically.
bun run workflow orchestrate --ids hf-papers-to-x,x-search-reply,linkedin-search-reply

๐Ÿ” Workflow Engine

Workflows are deterministic browser-automation pipelines that run without any LLM in the control flow (an LLM may still be called as a single step). The agent acts as a supervisor โ€” it can inspect status and start/stop runs, while execution stays scripted and reproducible.

๐Ÿ“ฆ Built-in Workflows

WorkflowIDScheduleDescription
๐Ÿ“ฐ HuggingFace Daily Papershf-daily-papersdailyFetch top papers โ€” titles, abstracts, thumbnails โ€” and save to local data files
๐Ÿฆ HF Papers โ†’ X.comhf-papers-to-xdailyFull pipeline: fetch HF papers โ†’ download thumbnails โ†’ post each as an image + text tweet
๐Ÿ” X.com Search & AI Replyx-search-replyhourlySearch X.com Latest โ†’ read each post โ†’ generate a reply via LLM โ†’ post reply
๐Ÿ’ผ LinkedIn Search & AI Commentlinkedin-search-replyhourlySearch LinkedIn Latest โ†’ read each post โ†’ generate a comment via LLM โ†’ post comment

๐Ÿ–ฅ๏ธ CLI

bun run workflow list                          # ๐Ÿ“‹ List all workflows + status
bun run workflow run    --id hf-papers-to-x    # โ–ถ๏ธ  Run once (blocking)
bun run workflow start  --id hf-papers-to-x    # ๐Ÿš€ Run once (background)
bun run workflow daemon --id x-search-reply --interval 3   # ๐Ÿ”„ Run every 3 minutes
bun run workflow orchestrate --ids a,b,c       # ๐ŸŒ Multi-platform: same serial, cross parallel
bun run workflow stop   --id x-search-reply    # ๐Ÿ›‘ Stop at next checkpoint
bun run workflow reset  --id x-search-reply    # โ™ป๏ธ  Clear stopped state โ†’ idle
bun run workflow status                        # ๐Ÿ“Š Status of all workflows
bun run workflow history --id hf-papers-to-x   # ๐Ÿ•˜ Execution history

๐Ÿงฑ Creating a Custom Workflow

Step 1 โ€” Definition (workflows/<id>.json):

{
  "id": "my-workflow",
  "name": "My Custom Workflow",
  "description": "What this workflow does",
  "schedule": "daily",
  "platform": "x",
  "executor": "executors/my-workflow.ts",
  "config": { "searchQuery": "ai agent", "maxPosts": 5 }
}

[!TIP] Set "platform" (e.g. x / linkedin / reddit) โ€” never hard-code cdpPort. The engine injects the target's cdpPort, profile, proxy, and device from config/browser-targets.json into config at run time, and locks the platform for the run.

Step 2 โ€” Executor (workflows/executors/my-workflow.ts):

#!/usr/bin/env bun
import { execSync } from 'node:child_process'

const configArg = process.argv.find((_, i, a) => a[i - 1] === '--config')
const config = JSON.parse(configArg!)

function ab(cmd: string): string {
  return execSync(`agent-browser --cdp ${config.cdpPort} ${cmd}`, {
    encoding: 'utf-8', timeout: 30000,
  }).trim()
}

console.error('[my-workflow] Step 1: ...')        // ๐Ÿ“ logs โ†’ stderr
// ... your automation logic using ab() ...

console.log(JSON.stringify({ stepsCompleted: 1, stepsTotal: 1 }))   // ๐Ÿ“ค summary โ†’ last line of stdout

Step 3 โ€” Test:

bun run workflow run --id my-workflow

[!IMPORTANT] Executor contract: accept --config <json>, log to stderr, and emit a single JSON object ({stepsCompleted, stepsTotal}) as the last line of stdout. Missing or malformed output marks the run as failed.

๐Ÿ“– Full guide: docs/workflow-development-guide.md โ€” covers deduplication, the checkpoint/stop protocol, LLM integration, and daemon mode.


๐Ÿ“’ Operation Log

Persistent memory across sessions. The agent checks the log before acting and records every action after โ€” preventing duplicate likes, follows, and replies. This dedup contract is the core of the agent's identity.

# ๐Ÿ” Check before acting (exit 0 = already done โ†’ skip; exit 1 = not done โ†’ proceed)
bun run scripts/log-operation.ts check \
  --platform x --action like --url "https://x.com/.../status/123"

# โœ… Record after a successful action
bun run scripts/log-operation.ts add \
  --platform x --action like --url "https://x.com/.../status/123" \
  --status success --note "AI agents research post"

# ๐Ÿ•˜ View recent operations
bun run scripts/log-operation.ts recent --limit 20

# ๐Ÿ“Š 30-day summary (auto-injected into the system prompt at startup)
bun run scripts/log-operation.ts summary --days 30

State lives in persona/operation-log.json (human-readable JSON). The 30-day summary is injected into every session's system prompt so the agent always knows its recent history.


๐Ÿ—“๏ธ Task Scheduling

Replace ad-hoc prompts with structured daily/weekly task execution.

๐Ÿ“ Define Tasks โ€” persona/tasks.md

## Daily Tasks
1. Engage with relevant content (like posts matching topic queries)
2. Monitor own project mentions
3. Leave 1 technical comment on the most relevant post

## Weekly Tasks (Monday)
4. Follow 3-5 relevant researchers
5. Post 1 original tweet about recent research findings

## Session Constraints
| Action   | Max per session |
|----------|:---------------:|
| Likes    | 10              |
| Comments | 2               |
| Follows  | 5               |
| Posts    | 1               |

โ–ถ๏ธ Run

bun run run-tasks                   # Execute today's tasks
bun run run-tasks:dry               # Preview the generated prompt without running
bun run run-tasks -- --platform x   # Restrict to one platform

[!NOTE] persona/ is gitignored and absent from a fresh clone. The agent runs fine without it โ€” just without persona, task, and operation-history context in the prompt.


๐Ÿ“ก Trajectory Monitor

--print mode is a black box. The trajectory monitor watches the session log and prints live execution status.

# Terminal 1 โ€” start the monitor
bun run tail

# Terminal 2 โ€” run the agent
bun start -p "/x-com open timeline, like first post"
โ•โ•โ• New Task โ•โ•โ•
/x-com open timeline, like first post

[6:30:47 PM] โšก Bash: agent-browser connect 9222
[6:30:47 PM] โœ“ Result: Done
[6:31:10 PM] โšก Bash: agent-browser open https://x.com/home
[6:31:27 PM] โšก Bash: agent-browser snapshot -i -c -s 'article'
[6:31:44 PM] โ— Agent: Found first post, like button ref=e136
[6:31:44 PM] โšก Bash: agent-browser click e136
[6:31:45 PM] โœ“ Result: Done
bun run tail:history     # ๐Ÿ” Replay latest session from the beginning
bun run tail:list        # ๐Ÿ“‹ List recent sessions
bun run tail <id>        # ๐ŸŽฏ Watch a specific session

๐Ÿฉบ Doctor โ€” Health Check

A cross-platform preflight check and onboarding aid. Run it before your first session or whenever something feels off.

bun run doctor               # Check Bun, agent-browser, Chrome, .env
bun run doctor --check-cdp   # โ€ฆalso probe every platform target's CDP port

It detects your host OS (Windows / macOS / Linux), resolves the Chrome binary path, probes each target in config/browser-targets.json, and reports anything missing or misconfigured.


๐Ÿ“ Project Structure

locoagent/
โ”œโ”€โ”€ src/                          # โฌ†๏ธ Vendored Claude Code CLI source โ€” treat as a dependency
โ”‚   โ”œโ”€โ”€ entrypoints/cli.tsx       #    CLI entry point
โ”‚   โ”œโ”€โ”€ services/api/             #    Multi-provider LLM shim (openaiShim / codexShim)
โ”‚   โ”œโ”€โ”€ services/mcp/             #    MCP server management
โ”‚   โ”œโ”€โ”€ tools/                    #    ~40 tool implementations
โ”‚   โ”œโ”€โ”€ commands/                 #    ~90 slash commands
โ”‚   โ”œโ”€โ”€ components/ ยท hooks/      #    Ink/React terminal UI
โ”‚   โ”œโ”€โ”€ query.ts                  #    Agentic loop engine
โ”‚   โ””โ”€โ”€ constants/prompts.ts      #    ๐Ÿ”Œ The seam โ€” injects LocoAgent state into the prompt
โ”œโ”€โ”€ scripts/                      # ๐Ÿงฉ LocoAgent-specific tooling
โ”‚   โ”œโ”€โ”€ setup-chrome.ts           #    Chrome + CDP launcher (cross-platform)
โ”‚   โ”œโ”€โ”€ doctor.ts                 #    Health check / onboarding
โ”‚   โ”œโ”€โ”€ log-operation.ts          #    Operation-log CLI (dedup)
โ”‚   โ”œโ”€โ”€ run-tasks.ts              #    Task scheduler
โ”‚   โ”œโ”€โ”€ tail-agent.ts             #    Live trajectory monitor
โ”‚   โ”œโ”€โ”€ workflow-engine.ts        #    Workflow lifecycle manager
โ”‚   โ””โ”€โ”€ lib/                      #    Platform layer โ€” host ยท device ยท config ยท target lock
โ”œโ”€โ”€ config/
โ”‚   โ””โ”€โ”€ browser-targets.json      # ๐ŸŒ Per-platform target registry (cdpPort ยท proxy ยท profile)
โ”œโ”€โ”€ skills/<platform>/SKILL.md    # ๐ŸŽฏ Platform operation playbooks (โ†’ /<platform>)
โ”œโ”€โ”€ workflows/
โ”‚   โ”œโ”€โ”€ <id>.json                 #    Workflow definitions
โ”‚   โ”œโ”€โ”€ executors/<id>.ts         #    Scripted pipelines
โ”‚   โ””โ”€โ”€ state.json                #    Runtime state (gitignored)
โ”œโ”€โ”€ persona/                      # ๐Ÿชช Persona, tasks, operation log (gitignored)
โ”œโ”€โ”€ docs/                         # ๐Ÿ“– Public docs (workflow guide, cross-platform guide)
โ”œโ”€โ”€ stubs/                        #    Preloaded globals + local package stubs
โ”œโ”€โ”€ .env                          #    Local config (auto-loaded)
โ””โ”€โ”€ package.json

[!TIP] The LocoAgent layer is small and lives outside src/. The seam is src/constants/prompts.ts, which shells out to inject persona, tasks, operation-log summary, and workflow status into every session's system prompt.


๐Ÿงฉ Tech Stack

ComponentTechnology
๐ŸฅŸRuntimeBun (Node not supported)
๐ŸŸฆLanguageTypeScript (TSX)
โš›๏ธUIReact + Ink terminal renderer
โŒจ๏ธCLICommander.js
๐ŸŒBrowser automationagent-browser + Chrome CDP
๐Ÿง LLM integrationAnthropic SDK + OpenAI-compatible shim
๐Ÿ”ŒExtension protocolMCP (Model Context Protocol)

๐Ÿค Contributing

Contributions welcome! High-impact areas:

  • ๐ŸŽฏ New platform skills โ€” LinkedIn, Reddit, Instagram playbooks
  • ๐Ÿ” New workflows โ€” automated content pipelines (development guide)
  • ๐Ÿ› ๏ธ New tools โ€” extend agent capabilities
  • ๐Ÿ› Bug fixes โ€” especially browser-automation edge cases

Branch โ†’ change โ†’ bun run typecheck โ†’ commit (feat: / fix: / docs:) โ†’ PR with What / Why / How / Testing. See CONTRIBUTING.md for the full guide.

[!NOTE] There is no unit-test suite. Verify with bun run typecheck and a real bun start -p "..." run. bun test scripts runs the platform-layer unit tests.


๐Ÿ“„ License

MIT ยฉ LocoreMind

Trustgrade A

  • passBody integrity

    Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.

  • warnType matchbest-effort: server code not analyzed

    Whether the artifact is really the kind of thing its metadata claims it is.

  • passFreshness

    How long since the source repository was last pushed to.

  • passPrompt injection

    Scans the artifact's own text for instructions aimed at your agent rather than at you.

  • passLicense

    Whether the source repository declares an SPDX license permissive enough to redistribute.

How the grade is calculated

Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:

  • Aevery check passed
  • Bone warning
  • Ctwo warnings
  • Dprompt injection or body integrity failed, or three warnings
  • Fone of those failed, and something else is wrong

These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged โ€” not that the artifact is safe.

Versions

  • git-25fb579ac65d2026-08-06