Skip to content

Getting Started

Terminal window
npm install -g agent-tags

Or use it without installing:

Terminal window
npx agent-tags status

Alternatively, build from source (requires Rust):

Terminal window
git clone https://github.com/cabljac/agent-tags.git
cd agent-tags/git-agent-tags
cargo install --path .

See what’s untagged:

Terminal window
agent-tags missing

Pick 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:

Terminal window
agent-tags check

Block broken references from ever reaching main:

Terminal window
agent-tags hook --install

This 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).

Copy the agent skill into your repo:

Terminal window
cp -r .agents/skills/agent-tags your-repo/.agents/skills/agent-tags

Agents that support skills (Claude Code, Cursor, Copilot, etc.) will automatically:

  1. Read tags before editing any file
  2. Update tags after making changes
  3. Validate references before committing

Before editing:

Terminal window
agent-tags context --for src/auth/token.ts --hops 1

The 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:

Terminal window
agent-tags check

The agent validates that no references are broken and no headers are stale. Tags stay accurate automatically.