Harvil1/codeAgent

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.

What it solves

CodeAgent is a terminal-based AI programming assistant designed to automate coding tasks. It allows users to provide instructions in natural language, which the agent then executes by reading code, modifying files, running terminal commands, and searching for information.

How it works

The project implements a full Agent loop (REPL) that integrates with LLMs via OpenAI-compatible or Anthropic protocols. It uses a system of tool registration where modules in the tools/ directory are automatically registered as capabilities. To manage long-term context, it employs a multi-level compression pipeline (L1 to L4) and a memory system based on MEMORY.md and JSONL storage. It also features a "self-learning" mechanism that extracts reusable skills from conversation trajectories to improve over time.

Who it’s for

It is aimed at developers who want a powerful, command-line AI coding assistant (similar to Claude Code) and those interested in learning Agent development, as the code is written with extensive Chinese comments to serve as a pedagogical tool.

Highlights

  • Terminal-First Experience: Features streaming responses, a dedicated approval panel for dangerous commands, and a status bar.
  • Self-Learning Skills: Automatically distills reusable skills from dialogue history to be activated by specific file paths.
  • Security Guardrails: Includes bash injection detection, secret scanning, SSRF protection, and optional bwrap sandboxing on Linux.
  • Advanced Context Management: Implements hierarchical compression and prefix-cache friendly message injection to optimize LLM costs and performance.
  • Agent Orchestration: Supports sub-agents with isolated worktrees, team modes (coordinator/worker), and a deterministic workflow engine with checkpoint recovery.

Related

  • Project
  • Project
  • Project
  • Project