core AGENTS.md

A repository guide for Agent Tower, an application that coordinates coding agents, terminals, tasks, and live collaboration. It documents the project's technologies, folder layout, command-line entries, and event architecture; a monorepo is one repository containing several related packages.

In plain words
What is it for?
Use it when working on Agent Tower's React frontend, Fastify backend, shared package, terminal and session handling, task management, or real-time events.
Why use it?
It gives agents the project context needed to make changes consistently across the frontend, backend, shared code, and documentation.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/agent-tower/core/agents-md
Clone the repo
git clone --depth 1 https://github.com/agent-tower/core

Made for: Codex, OpenCode.

Per session 1,743 This file is loaded in full into every session.
When invoked 1,743 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01743 $0.01743
Opus 5 $0.00872 $0.00872
Sonnet 5 $0.00349 $0.00349
Haiku 4.5 $0.00174 $0.00174

Measured 2d ago against content hash e46530fffbd4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

core AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 140 lines

How it starts

The opening of the file, as written. The whole thing — 140 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Tower

AI Agent 任务管理看板应用,支持多种 AI Agent(Codex、Gemini CLI、Cursor Agent、Codex)的任务编排、终端管理和实时协作。

技术栈

层级 技术
前端 React 19 + Vite 7 + TypeScript 5
样式 TailwindCSS v4 + shadcn/ui (Radix UI)
状态管理 TanStack Query v5 (服务端状态) + Zustand v5 (客户端状态)
路由 react-router-dom v7 (lazy loading)
终端 xterm.js + Monaco Editor
拖拽 @dnd-kit
后端 Fastify 4 + Socket.IO 4
数据库 Prisma 5 + SQLite
进程管理 node-pty
包管理 pnpm monorepo

项目结构

packages/
├── shared/          # 共享类型包 (@agent-tower/shared)
├── server/          # 后端服务 (@agent-tower/server)
└── web/             # 前端应用
design/              # 设计文档
docs/                # 项目文档 (ARCHITECTURE.md, PROJECT_SPEC.md, MCP.md 等)
scripts/             # 构建发布脚本 (build-publish.mjs)

CLI 入口

  • agent-tower — 主服务 (默认端口 12580)
  • agent-tower-mcp — MCP 服务器 (stdio 模式,暴露 projects/tasks/workspaces/sessions/providers tools)

架构设计

Socket.IO

单一命名空间 /events,通过 room-based 订阅区分 topic:

Room 模式 用途
session:{id} / session:all Agent 会话 PTY 流
terminal:{id} / terminal:all 独立终端 PTY 流
task:{id} / task:all 任务状态变更
project:{id} / project:all 项目级任务更新广播
agent:{id} / agent:all Agent 状态通知

核心机制

  • AgentPipeline: PTY + Parser + MsgStore 生命周期管理
  • EventBus: 类型安全的进程内事件总线
  • 服务容器: 单例管理 (SessionManager, TerminalManager, CommitMessageService, NotificationService)
  • 输出解析: Codex / Cursor Agent / Codex 输出解析器,JSON Patch 驱动的 MsgStore
  • Git Worktree: 创建/删除/合并/rebase/冲突检测
  • 任务状态自动推进: Session 全部完成 → Task 进入 IN_REVIEW;Session 重启 → 回退 IN_PROGRESS

前端状态管理

  • TanStack Query: 服务端数据缓存、请求去重、后台刷新
  • Zustand: 客户端 UI 状态、Agent 状态

关键目录

packages/server/src/
├── core/             # 服务容器 (DI) + EventBus
├── pipeline/         # AgentPipeline (PTY + Parser + MsgStore)
├── output/           # 输出解析 (Codex-parser, cursor-agent-parser, codex-parser, msg-store)
├── executors/        # Agent 执行器 (Codex, Gemini CLI, Cursor Agent, Codex)
├── mcp/              # MCP 服务器 (tools: projects, tasks, workspaces, sessions, providers)
├── git/              # Git CLI 封装 + WorktreeManager
├── services/         # 业务服务 (session, workspace, project, task, terminal, tunnel, notifications, commit-message, copy-files)
├── routes/           # REST API (16 个路由文件: projects, tasks, sessions, workspaces, terminals, git, files, filesystem, attachments, notifications, profiles, providers, tunnel, system, demo)
├── socket/           # Socket.IO 网关 (/events 命名空间, room 订阅)
│   └── middleware/   # 认证、错误处理
└── middleware/        # HTTP 中间件 (隧道认证)

packages/web/src/
├── layouts/          # RootLayout, SettingsLayout
├── pages/            # HomePage, ProjectKanbanPage, ProjectSettingsPage, ProfileSettingsPage, ProviderSettingsPage, NotificationSettingsPage, DemoPage, AgentDemoPage
├── components/
│   ├── ui/           # shadcn/ui 组件
│   ├── task/         # 任务看板组件 (TaskList, TaskGroup, TaskDetail, StartAgentDialog, ProviderSelector)
│   ├── workspace/    # 终端、编辑器、文件树、Git 变更视图、冲突解决
│   ├── agent/        # 日志流、Todo 面板、Token 用量
│   └── mobile/       # 移动端适配组件
├── hooks/            # TanStack Query hooks (projects, tasks, sessions, workspaces, git, files, attachments, notifications, profiles, providers, tunnel, todos, mobile, token-usage 等)
├── stores/           # Zustand stores (agent-store, ui-store)
├── lib/
│   ├── api-client.ts # HTTP API 客户端
│   └── socket/       # Socket.IO 客户端 + hooks (useTerminal, useStandaloneTerminal, useNormalizedLogs, useTaskRealtimeSync, useWorkspaceSetupProgress)
└── routes/           # react-router-dom 路由配置

packages/shared/src/
├── types.ts          # 核心业务类型 (Project, Task, Workspace, Session, TodoItem 等)
├── socket/events.ts  # Socket.IO 事件常量与 payload 类型
├── log-adapter.ts    # NormalizedEntry → LogEntry 前端适配
└── dev-port.ts       # 确定性端口计算

Read the full file on GitHub · 140 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 140 lines · 1,743 tokens per session scan A e46530fffbd4

Subscribe to this mod's changes

core AGENTS.md is an instructions file published in the GitHub repository agent-tower/core (338 stars, last pushed 22d ago), licensed Apache-2.0. It adds 1,743 tokens to every session, about $0.0087 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

buildNext

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

Instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,040 tokens

langchain AGENTS.md

Instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens