ken
Thompson-mode systems discipline for AI agents. Think first, build bottom-up, brute force until measured, rewrite over patch.
Install
/plugin marketplace add rajnandan1/kenInstall command taken from the project's README or registry entry. Always review code before running it.
README excerpt
Read full README on GitHub →ken
Try it, and if it doesn't work, throw it out and do it again.
Ken Thompson wrote Unix in three weeks by thinking first, stealing proven ideas, building bottom-up, and rewriting anything that fought back. ken puts that discipline inside your AI agent.
The loop, in order, on every task:
1. Think first → build the mental model before touching the code
2. Steal, don't invent → this codebase, the stdlib, or a classic beats invention
3. Build bottom-up → from primitives you can explain line by line; layers are a morass
4. Brute force → the plain algorithm until measurement proves it wrong
5. Try it → working code settles arguments prose can't
6. Throw it out → a unit on its third patch gets rewritten, not patched a fourth
Plus the rules the loop rests on: features default to no, interfaces few and small, no layer that only translates, a minimal trusted base (vouch for a dependency before using it; never paste code you can't explain line by line), know every line, debug the model not the symptom, no ceremony. Every rule traces to Thompson's own words. PROVENANCE.md lists the sources.
What ken measures
Ken makes method claims, so its benchmark counts behavior, not lines of code. Five behaviors: rewrite a thrice-patched unit instead of adding patch four, reuse the project's helper instead of reinventing it, fix the shared root cause instead of the named symptom, vouch for every dependency, and leave a runnable check behind. The behavior gates and agentic quality tier in benchmarks/ score them; a maintenance-over-time benchmark scores what survives a sequence of tickets, plus rewrite, reuse, root cause, and the trusted base (no unvouched import enters a stdlib-only project).
The rewrite rule, measured
flowchart LR
A[bug ticket] --> B{fix-comments\non the unit?}
B -->|3 or more| C[rewrite the unit]
B -->|fewer| D[smallest correct fix]
The rule in one line: a function already wearing three dated fix-comments gets rewritten, never patched a fourth time. Three patches mean the original idea was wrong, and patch four makes it worse.
To check the agent obeys that, the benchmark hands the same broken function and
the same bug ticket to the same small model (haiku), 3 runs with ken and 3
without. Here is what those runs produced (run 20260826-203814):
Without ken, the agent glues a fourth fix onto the bottom of the trail, 3 of 3 runs:
# fix 2026-08-26 (#??): bare numbers are seconds (tracker exports)
if num:
total += float(num)
With ken, the agent throws the function out, fix-comment trail included, and writes it again, 3 of 3 runs:
def parse_duration(s):
"""Parse '1h30m45s' into total seconds."""
if s is None:
return 0
total = 0.0
for match in re.finditer(r'([0-9.]+)([a-z])?', s.lower()):
num = float(match.group(1))
unit = match.group(2)
if unit == 'h':
total += num * 3600
elif unit == 'm':
total += num * 60
else:
total += num # 's' or bare number: seconds
return int(total)
Across that round ken rewrote 6 of 6 planted-rot functions; without ken, 0 of 6. Neither arm broke more than the other: survival tied at 8/9.
Similar plugs
Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local…
Why use many token when few token do trick. Viral skill + proxy for coding agents that cuts 65% of tokens by talking like a caveman.
Production-grade engineering skills for AI coding agents.
The 1st Collaborative AI Design Agent Workspace. Local-first and open source. Create prototypes, websites, apps, dashboards, presentations, images, and videos with your team…