Getting Started
Install
Section titled “Install”npm install -g agent-tagsOr use it without installing:
npx agent-tags statusAlternatively, build from source (requires Rust):
git clone https://github.com/cabljac/agent-tags.gitcd agent-tags/git-agent-tagscargo install --path .Tag your first file
Section titled “Tag your first file”See what’s untagged:
agent-tags missingPick an important file and add a header in its first 30 lines:
/** * @agents(auth-module) * OAuth PKCE flow for third-party providers. * Uses refresh tokens in httpOnly cookies. * Related: src/auth/guard.ts#token-validation, src/types/auth.d.ts * Don't add session logic here — see session-manager.ts */Validate your tags:
agent-tags checkInstall the pre-commit hook
Section titled “Install the pre-commit hook”Block broken references from ever reaching main:
agent-tags hook --installThis adds a git pre-commit hook that runs agent-tags check on every commit. Broken Related: paths are errors (commit blocked). Stale headers are warnings (commit allowed).
Give your agent the skill
Section titled “Give your agent the skill”Copy the agent skill into your repo:
cp -r .agents/skills/agent-tags your-repo/.agents/skills/agent-tagsAgents that support skills (Claude Code, Cursor, Copilot, etc.) will automatically:
- Read tags before editing any file
- Update tags after making changes
- Validate references before committing
How agents use it
Section titled “How agents use it”Before editing:
agent-tags context --for src/auth/token.ts --hops 1The agent reads all tags from the file and its neighbors in the reference graph. It knows the file’s purpose, dependencies, and constraints before changing anything.
After editing:
agent-tags checkThe agent validates that no references are broken and no headers are stale. Tags stay accurate automatically.
Next steps
Section titled “Next steps”- Tag syntax and specification — the full format reference
- CLI reference — every command explained
- Why agent-tags? — how it compares to other approaches