clean-agent-standalone is a clean-room, terminal-first AI agent project that rebuilds a modern agent runtime without copying proprietary source code.
It is designed as an independent TypeScript project with:
- a conversational terminal UX
- session persistence and replay
- tool execution and delegation
- team/coordinator workflows
- skills, profiles, and output styles
- runtime diagnostics, snapshots, and recovery
- an experience-transfer foundation for cross-task generalization
This project is not just a toy REPL.
It is a standalone runtime that tries to capture the useful architecture of a full agent system:
- agent loop
- tool orchestration
- sub-agent delegation
- session recovery
- team task coordination
- skill loading
- structured runtime services
- observable terminal UX
The implementation is clean-room and intentionally independent from the source repository being studied.
- Terminal chat UX with welcome screen, input box, and lightweight conversation styling
- Animated terminal waiting state with a stick-figure runner
- Session persistence under
.clean-agent/sessions - Resume by latest session or explicit session id
- Full transcript preview on resume
- Session search, inspect, clone, and replay flows
- Runtime snapshots under
.clean-agent/snapshots - Runtime log and doctor diagnostics
- Heuristic local model for offline use
- OpenAI-compatible model adapter for real providers
- Built-in tools for shell, files, search, delegation, tasks, and web fetch/search
- Team and coordinator mode with mailbox and task board
- Skills, agent profiles, and output styles loaded from local directories
- Experience transfer / repair framework already wired into the runtime
For the full implemented surface area, see:
cd /home/ubuntu/dev/clean-agent-standalone
npm install
npm run build
npm startUse an OpenAI-compatible provider:
CLEAN_AGENT_MODEL="openai" \
OPENAI_API_KEY="your_key" \
OPENAI_BASE_URL="https://api.deepseek.com" \
OPENAI_MODEL="deepseek-chat" \
npm startResume the latest session:
npm start -- --resume-latestResume a specific session:
npm start -- --resume <session-id>Equivalent legacy form:
npm start -- --session <session-id>Example with a real model:
CLEAN_AGENT_MODEL="openai" \
OPENAI_API_KEY="your_key" \
OPENAI_BASE_URL="https://api.deepseek.com" \
OPENAI_MODEL="deepseek-chat" \
npm start -- --resume <session-id>The project already has a real skills layer, not just a placeholder.
Current skill capabilities:
- load skills dynamically from
.clean-agent/skills - support
skill.json - support
skill.md/*.skill.mdwith YAML frontmatter - support
includecomposition - support
parameterssubstitution - allow skills to register tools
- allow skills to register slash commands
Why this matters for generalization:
- skills are not hardcoded into one specific task
- the same skill package can be reused across different sessions and goals
- skill instructions can be parameterized instead of duplicated
- loaded skills plug into the same runtime used by the main agent, delegated agents, and team flows
This means the project already supports reusable task capability packs, even though stronger automatic skill selection and deeper experience-guided orchestration are still being improved.
- multi-step agent loop
- tool call execution
- permission gate
- context compression
- token/cost tracking
- delegated agent support
- save sessions
- inspect sessions
- preview sessions
- search sessions
- clone sessions
- replay sessions
- bridge export/import/restore
Built-in tool families include:
- shell tools
- file tools
- search tools
- task tools
- delegation tools
- session export tools
- web fetch/search tools
- team creation and member registration
- task board
- task dispatch and claiming
- worker completion reporting
- coordinator planning and assignment
- proactive scan loop
- runtime snapshots
- runtime logs
- environment/version inspection
- conversation summary
- doctor diagnostics
- worktree inspection
/sessions/resume/resume inspect <session-id>/resume preview <session-id> [limit]/session-info [session-id]/session-search <query>/replay clone <session-id> [target]/replay run <session-id> <prompt>
/doctor/logs/logs tail [count]/env/version/summary/services
/persist [name]/snapshots/snapshots show <name>
/tool-search/decompose <goal>/compact/cost
/provider/permissions/hooks-control/settings/flags
/skills/skills-search/agents/output-style
/team/team-member/team-tasks/team-add-task/team-claim/team-complete/team-inbox/team-message/coordinator/proactive
/tasks/task <id>/stop-task <id>/task-runs/task-run <prompt>
/mcp-connect <name> <command> [args...]/mcp-disconnect <name>/mcp-list
Key directories:
src/agent: agent loop, sessions, permissions, tool executionsrc/skills: dynamic skill loading and catalogsrc/experience: transfer, repair, and write-back logicsrc/team: team manager, mailbox, task boardsrc/tools: built-in tool definitionssrc/services: runtime services and diagnosticssrc/tasks: local task runner and task frameworksrc/bridge: session bridge import/export/restoresrc/model: heuristic and OpenAI-compatible model clientssrc/utils: snapshots, shell info, release info, summaries, worktree helpers
At runtime, local state is stored under:
.clean-agent/settings.json.clean-agent/sessions/.clean-agent/snapshots/.clean-agent/runtime.log.clean-agent/tasks/.clean-agent/skills/.clean-agent/agents/.clean-agent/output-styles/
The project is already substantial, but there are still boundaries:
- heuristic mode is still limited compared with a real model
- skill generalization is real, but stronger automatic skill selection can be improved
- experience transfer is wired in, but the write-back and matching quality can still be deepened
- terminal UX is intentionally lightweight, not a full graphical interface
- background service behavior is still simpler than a full daemonized production runtime