{"id":47633492,"url":"https://github.com/mochow13/keen-code","last_synced_at":"2026-06-13T04:02:19.346Z","repository":{"id":346191584,"uuid":"1158827208","full_name":"mochow13/keen-code","owner":"mochow13","description":"A context-aware and efficient CLI-based coding agent written in Go","archived":false,"fork":false,"pushed_at":"2026-06-11T01:23:41.000Z","size":106444,"stargazers_count":31,"open_issues_count":4,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-11T03:20:20.871Z","etag":null,"topics":["agentic-ai","ai-agent","ai-assistant","ai-coding-agent","ai-coding-tool","coding-assistant"],"latest_commit_sha":null,"homepage":"https://mochow13.github.io/keen-code/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mochow13.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-16T00:49:00.000Z","updated_at":"2026-06-11T01:53:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mochow13/keen-code","commit_stats":null,"previous_names":["mochow13/keen-code"],"tags_count":54,"template":false,"template_full_name":null,"purl":"pkg:github/mochow13/keen-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochow13%2Fkeen-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochow13%2Fkeen-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochow13%2Fkeen-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochow13%2Fkeen-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mochow13","download_url":"https://codeload.github.com/mochow13/keen-code/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochow13%2Fkeen-code/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34271500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-ai","ai-agent","ai-assistant","ai-coding-agent","ai-coding-tool","coding-assistant"],"created_at":"2026-04-01T23:55:21.038Z","updated_at":"2026-06-13T04:02:19.315Z","avatar_url":"https://github.com/mochow13.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"./assets/keen-code.png\" alt=\"Keen Code\" width=\"500\"/\u003e\n\n[![Latest Release](https://img.shields.io/github/v/release/mochow13/keen-code?style=flat-square\u0026logo=github)](https://github.com/mochow13/keen-code/releases/latest)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/mochow13/keen-code/go.yml?branch=main\u0026style=flat-square\u0026logo=githubactions\u0026logoColor=white)](https://github.com/mochow13/keen-code/actions)\n[![Go Version](https://img.shields.io/github/go-mod/go-version/mochow13/keen-code?style=flat-square\u0026logo=go)](https://go.dev/)\n[![License](https://img.shields.io/github/license/mochow13/keen-code?style=flat-square\u0026logo=opensourceinitiative\u0026logoColor=white)](https://github.com/mochow13/keen-code/blob/main/LICENSE)\n\n\u003ca href=\"https://www.producthunt.com/products/keen-code-a-cli-coding-agent?embed=true\u0026utm_source=badge-featured\u0026utm_medium=badge\u0026utm_campaign=badge-keen-code\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg alt=\"Keen Code - A context-efficient CLI coding agent built by agents | Product Hunt\" width=\"250\" height=\"54\" src=\"https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1162542\u0026theme=dark\u0026t=1780593417757\"\u003e\u003c/a\u003e\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"./assets/keen-demo.gif\" alt=\"Keen Code demo\" style=\"width: 100%; height: auto;\"/\u003e\n\u003c/div\u003e\n\n**Keen Code** is a terminal-based AI coding agent like Claude Code or Codex CLI. Written in Go, it is simpler, lighter, minimalistic but useful coding agent for typical software engineering tasks.\n\nKeen Code is highly opinionated. It avoids features that are not necessarily needed or useful for a regular software engineer. It tries to avoid unnecessary complexity and attempts to keep the agent harness as simple as possible.\n\nFrom requirements to implementation, Keen Code was engineered using a wide range of coding agents and agentic IDEs like Cursor, Windsurf, Claude Code, OpenCode, Codex CLI, and Kimi CLI. At any given time, Keen Code was developed by a single agent, meaning, no multi-agent orchestration was used.\n\nBy far, AI coding agents are the most ubiquitous use case in the era of AI agents. The goal of the project is to showcase how coding agents can be used to develop coding agents themselves. This is why most prompts and output docs are saved as markdown files in the `.ai-interactions` directory. \n\nKeen Code is also an experiment to play with the *new way of working* where engineers work with AI agents to develop software. In this setting, engineers are sometimes referred to as \"orchestrators\".\n\n\u003e **Every line of code in this repo was written by an AI agent.** The full paper trail — prompts, plans, design docs — is preserved in [`.ai-interactions/`](.ai-interactions/). See [TOUR.md](TOUR.md) for the full story.\n\n## Table of Contents\n\n- [Features](#features)\n- [Development Philosophy](#development-philosophy)\n- [Development Cycle Example](#development-cycle-example)\n- [Install Keen Code](#install-keen-code)\n  - [Install with script](#install-with-script)\n  - [Install with npm](#install-with-npm)\n- [Run Keen](#run-keen)\n- [Supported Providers](#supported-providers)\n- [Built-in Tools](#built-in-tools)\n- [How Keen Handles Context](#how-keen-handles-context)\n- [Further Reading](#further-reading)\n\n\n## Features\n\n- **Multi-provider** — Anthropic, OpenAI, Codex (via OAuth), Gemini, DeepSeek, Kimi, GLM, MiniMax, and OpenCode Go. Switch with `/model`. More providers will be added in the future.\n- **6 minimal tools** — `read_file`, `write_file`, `edit_file`, `glob`, `grep`, `bash`. Deliberately lean.\n- **Skills system** — Specialized workflows for planning, debugging, refactoring, code review, and more.\n- **Thinking mode** — Extended reasoning for complex tasks. Use `/thinking` to change the thinking effort level for the current model. All models that support thinking can be configured.\n- **Session management** — Persistent sessions with resume capability.\n- **Conservative context management** — Lean cross-turn memory via `TurnMemory` summaries instead of raw tool traces. More information can be found in [docs/turn-memory.md](docs/turn-memory.md). An analysis of the tradeoffs and rationale can be found in [docs/turn-memory-analysis.md](docs/turn-memory-analysis.md).\n- **User-triggered compaction** - When the context window is nearing the limit, use `/compact` to compact the context.\n\n## How Keen Handles Context\n\nKeen takes a deliberately lean approach to cross-turn context. Within a single assistant turn the model has full access to its tool calls and results, but once the turn completes Keen does **not** carry the raw tool trace forward. Instead, it distills a compact `TurnMemory` summary that records only the outcomes most likely to matter later — currently which files were changed and which bash commands failed.\n\nSubsequent turns therefore receive:\n\n- prior user and assistant messages\n- the compact `TurnMemory` summary from earlier turns\n- any pending state from a turn that failed mid-loop, so the model can resume instead of starting over\n\nThe tradeoff is intentional: smaller context and a better signal-to-noise ratio, at the cost of occasionally re-reading files or re-running searches when older observations are needed again. Read-only facts are cheap to recompute; mutated state and failures are what deserve durable memory.\n\nFor the full rationale, lifecycle, and comparison with other coding agents, see [`docs/turn-memory.md`](docs/turn-memory.md).\n\n## Development Philosophy\n\nDeveloping Keen Code is guided by the following philosophy:\n\n- All the code is written by AI agents, not humans\n- The project is developed iteratively using spec-task-code-review cycle by a human engineer\n- The human engineer has a very strict set of roles:\n  - Specifiy and clarify the requirements\n  - Review design docs and influence design decisions\n  - Review changes made by the agents\n    - Changes can also be reviewed by the agents themselves\n  - Ensure the quality and correctness of the code\n  - Focus on best practices and standards relevant to the programing language (Go in this case)\n  - Thoroughly review and test the product after each iteration\n  - Continously provide feedback to the agents to improve the product\n- Prompts are saved as markdown files in the `.ai-interactions/prompts` directory\n  - Almost all of the prompts are stored to showcase how the project evolved from the initial requirements to the current state\n  - Prompts are pretty much chronologically ordered which demonstrates the thought process and iterative nature of the development\n- All the outputs are saved as markdown files in the `.ai-interactions/outputs` directory\n  - These outputs are basically plans, design docs, and breakdowns of the tasks\n  - These outputs are the \"specs\" that the agents later use to implement the tasks\n\n## Development Cycle Example\n\nAll features follow a **spec → plan → task → review** cycle. Here's a concrete example — the `read_file` tool from Phase 3:\n\n**Spec** — [`prompts/phase-3/prompt-3_read-file-tool.md`](.ai-interactions/prompts/phase-3/prompt-3_read-file-tool.md)\nRequirements defined upfront: ask permission before reading, respect FileGuard path rules, text files only, 1 MB limit, support relative and absolute paths.\n\n**Plan** — [`outputs/phase-3/output-3_read-file-tool.md`](.ai-interactions/outputs/phase-3/output-3_read-file-tool.md)\nDesign doc produced by the agent: how `Guard.CheckPath` maps to the REPL permission prompt, exact struct contracts, permission flow diagram.\n\n**Task** — [`prompts/phase-3/prompt-2_phase-3-tasks.md`](.ai-interactions/prompts/phase-3/prompt-2_phase-3-tasks.md)\nImplementation broken into steps — tool contract, permission bridge, REPL selector, unit tests — each approved before the next began.\n\n**Review** — (inline feedback during implementation)\nThe LLM was rejecting `.go` files because MIME detection flagged them as binary. Review caught this; switched to character-based text validation. The fix landed in the same iteration.\n\n## Install Keen Code\n### Install with script\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/mochow13/keen-code/main/scripts/install.sh | bash\n```\n\nTo pin a specific version:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/mochow13/keen-code/main/scripts/install.sh | bash -s -- -v v0.16.1\n```\n\nInstalls to `/usr/local/bin` if writable, otherwise `$HOME/.local/bin`.\n\n### Install with `npm`\n\nInstall the CLI globally:\n\n```bash\nnpm install -g keen-code\n```\n\nCheck that the install worked:\n\n```bash\nkeen --version\nwhich keen\n```\n\nYou can also run it without a global install:\n\n```bash\nnpx keen-code --version\n```\n\n## Run Keen\n\nStart Keen in your current directory:\n\n```bash\nkeen\n```\n\n## Supported Providers\n\n- Anthropic\n- OpenAI\n- Codex (ChatGPT OAuth)\n- Google AI (Gemini)\n- Moonshot AI (Kimi)\n- DeepSeek\n- Z.ai (GLM)\n- MiniMax\n- OpenCode Go\n\n\u003e Use `/model` to switch providers. The ChatGPT/Codex option opens a browser-based OpenAI sign-in flow and stores OAuth credentials in `~/.keen/auth.json`.\n\nMiniMax uses its Anthropic-compatible API and includes MiniMax M2.7 and M2.5.\nOpenCode Go uses an API key and includes GLM, Kimi, DeepSeek, MiMo, MiniMax, and Qwen models.\n\n## Built-in Tools\n\nKeen Code aims to support minimal set of useful tools for coding. Currently, these tools are built in:\n\n- `read_file` — read a UTF-8 text file\n- `glob` — find files by glob patterns\n- `grep` — search for text patterns in files\n- `write_file` — create or overwrite files\n- `edit_file` — replace specific text in existing files\n- `bash` — run shell commands\n\n## Further Reading\n\n- [TOUR.md](TOUR.md) — the full story of how this project was built\n- [CHANGELOG.md](CHANGELOG.md) — release history\n- [ROADMAP.md](ROADMAP.md) — what's planned next\n- [CONTRIBUTING.md](CONTRIBUTING.md) — how to contribute\n- [`docs/`](docs/) — architecture, tools, sessions, skills, and more\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmochow13%2Fkeen-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmochow13%2Fkeen-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmochow13%2Fkeen-code/lists"}