Agent Habits
Standing instructions for AI agents: habits (rules) and SOPs (procedures), one markdown file each, with a library of example habits to adopt and a small generated system-prompt block.
About This Project
Agent-Habits is a Python-based tool for maintaining standing instructions for AI agents such as Claude Code. It distinguishes between two kinds of instruction: habits, which are rules governing how an agent behaves regardless of the task, and SOPs, which are step-by-step procedures triggered by a specific recurring job. Each habit or SOP is stored as a single markdown file with YAML front matter, and a script generates a short index block for the system prompt file (CLAUDE.md or AGENTS.md) that points the agent to the full texts, which it reads only when relevant. The project reports that this approach reduces per-session context from roughly 18,500 characters to about 4,500 characters for fourteen habits, with a configurable character budget enforced by a context-check command.
The repository contains the machinery (scripts, skills, schema, references and templates) alongside a public library of example habits, including variables that are filled in on adoption, and two example SOPs. User content is kept separate in a private folder, following a convention that prevents personal instructions from entering the public repository. The command-line interface, implemented in habits.py and sop.py, supports listing, adopting, installing, and checking habits, while a set of agent skills covers setup, syncing, editing, and validation.
This project may be of interest to developers who use AI coding agents and want to keep their instructions organised, versioned, and compact rather than maintaining a long monolithic system prompt. It is also relevant to those designing conventions for agent configuration who want a concrete example of separating public tooling from private user data.