by Harvil1
CodeAgent is an open-source coding agent that lives in your terminal. It understands your repository, plans multi-step changes, writes and edits files, runs commands and tests, and iterates until the task is done — all with a transparent, extensible tool loop.
# Add to your Claude Code skills
git clone https://github.com/Harvil1/codeAgentSee how codeAgent compares with popular alternatives.
codeAgent is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by Harvil1. CodeAgent is an open-source coding agent that lives in your terminal. It understands your repository, plans multi-step changes, writes and edits files, runs commands and tests, and iterates until the task is done — all with a transparent, extensible tool loop. It has 219 GitHub stars.
codeAgent's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/Harvil1/codeAgent" and add it to your Claude Code skills directory (see the Installation section above).
codeAgent is primarily written in Python. It is open-source under Harvil1 on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh codeAgent against similar tools.
No comments yet. Be the first to share your thoughts!
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
自学习 AI Agent 命令行工具——交互体验对标 claude code,Windows 优先,开箱即用。
English | 简体中文
CodeAgent 是一个跑在终端里的 AI 编程助手:你用自然语言下指令,它读代码、改文件、跑命令、查资料,把活干完。它有自己的一套「长本事」机制——从对话轨迹里沉淀可复用的技能,越用越顺手。
不是套壳,也不是翻译——是从交互界面到 Agent 主循环一行行手写出来的完整实现,注释全是中文:
终端体验(对标 claude code)
● Bash(...) + ⎿ 结果)模型与工具
tools/ 下模块 import 即登记,按「套餐」(toolset)控制发给模型的工具集.mcp.json 声明即接入,首次连接需审批安全防线
$()、进程替换等「所见非所执行」形态升审批)、删除路径红线、自我保护记忆与自学习
MEMORY.md 索引 + JSONL 存储 + 检索结果临时注入(不污染正式历史)/plugin 管理),支持按触碰文件路径条件激活协作与自动化
/rewind)上下文工程

前提:Python 3.11+ 和 uv(Python 包管理器)。
# 1) 安装 uv(已有可跳过)
# Windows (PowerShell): powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# macOS / Linux: curl -LsSf https://astral.sh/uv/install.sh | sh
# 2) 拉代码 + 装依赖
git clone https://github.com/Harvil1/codeAgent.git
cd codeAgent
uv sync
# 3) 配置 API key(二选一)
# a) 环境变量——按所用厂商设置其一即可,程序会自动识别:
# DEEPSEEK_API_KEY / OPENAI_API_KEY / ANTHROPIC_API_KEY /
# OPENROUTER_API_KEY / ZHIPUAI_API_KEY(BIGMODEL_API_KEY 亦可)
# b) 写入 ~/.codeAgent/settings.json 的 models.<名字>.api_key
# (首次运行会自动生成默认配置文件,默认模型为 DeepSeek)
# 4) 跑起来
uv run python main.py # 交互模式
uv run python main.py -c # 自动恢复最近一次会话
提示:换模型 / 换厂商在会话里输
/model按引导配置,或直接编辑~/.codeAgent/settings.json。
会话内 40+ 个 slash 命令,常用如下:
| 命令 | 作用 |
|---|---|
/help |
命令帮助 |
/model |
切换 / 配置模型(按引导填厂商、key、端点) |
/new /resume /sessions |
新会话 / 恢复 / 会话列表 |
/rewind |
回溯到某个 checkpoint 重来 |
/skills /plugin |
管理技能 / 插件市场 |
/memory |
查看维护长期记忆 |
/permission /sandbox /approved |
权限模式 / 沙箱开关 / 已批准命令白名单 |
/doctor |
自诊断(配置、网络、组件健康检查) |
/plan |
计划模式:先出方案批准再动手 |
/stats /usage /trace |
花费统计 / 用量 / 调用链追踪 |
运行时数据统一放在 ~/.codeAgent/(环境变量 CODEAGENT_HOME 可覆盖,测试 / 多配置隔离用):
| 路径 | 内容 |
|---|---|
settings.json |
全部配置(默认值单一源头在代码里,落盘深合并,手改安全) |
sessions.db/ |
会话持久化(JSONL) |
MEMORY.md + 记忆库 |
长期记忆索引与正文 |
skills/ |
用户技能 |
plugins/ |
插件(含官方市场 claude-plugins-official) |
logs/ |
运行日志(滚动,5MB × 3) |
调用链一句话:main.py(点火:控制台编码、终端自举)→ cli.main → run_interactive(REPL + slash 命令 + RuntimeContext 装配)→ AIAgent.run_conversation(主循环心脏)。
主循环每轮:组装消息(注入后台 / 定时 / 团队 / 计划等临时消息)→ 上下文压缩 → 刷新工具集 → 调 LLM → 分发工具调用,模型不再要工具即收尾。
| 子系统 | 模块 |
|---|---|
| LLM | llm_client.py(OpenAI 兼容 / Anthropic 协议)、aux_llm.py(辅助小模型路由) |
| 记忆 | memory_store.py、memory_retriever.py |
| 上下文 | context_compressor.py(分级压缩)、context_pipeline.py |
| 子代理 / 团队 | tools/delegate_tool.py、agent/team/ |
| 工作流 | workflow_engine.py + workflow_journal.py |
| 技能 | ~/.codeAgent/skills/ + agent/skill_learning/(自学习) |
| 安全 | bash_injection.py、ssrf_guard.py、secret_scanner.py、sandbox_runner.py、permission.py |
| 持久化 | session_store.py、task_store.py、hooks.py |
uv run python scripts/verify.py # 60+ 项回归检查(改完代码先跑这个)
uv run ruff check . # lint
/model 或改 settings.json 即可,key 支持环境变量与配置文件两种方式。~/.codeAgent/,删掉目录即完全重置。MIT © 2026 Harvil1