What is kapathy?
kapathy is a set of coding behavior guidelines for LLMs, inspired by Andrej Karpathy's programming philosophy. It is designed to keep AI-assisted coding disciplined, readable, and focused on solving the actual problem.
Core Principles
1
Think before you codeClarify your assumptions before you start. If anything is unclear, ask instead of guessing.
2
Simplicity firstWrite only the minimal code that solves the problem. No speculative features, no unnecessary abstractions.
3
Precise editsChange only what is necessary. Do not refactor code along the way just because you are already touching the file.
4
Goal-drivenStop when the task is done. Do not over-optimize or keep polishing beyond what was asked.
When to Use It
These guidelines apply to all AI-assisted coding tasks, and they are especially useful with tools like Claude Code and Cursor. If you rely on AI to write or edit code, following this rule set keeps the output small, predictable, and easy to review.
Source: This article is translated from an AI-generated note and provided for reference only.