Welcome to Tanagram. This documentation helps you get the most out of it.

What is Tanagram?#

Tanagram generates and enforces rules in coding agents and code reviews, freeing you from sounding like a broken record. It's built for tech leads, founding engineers, and staff+ engineers who are trying to scale your knowledge and influence.

Tanagram has three parts:

  • Rules Engine: Tanagram watches your codebase and automatically generates rules. You can also write your own rules.

  • Agent Integration: Tanagram rules automatically feed into Claude and Cursor so they can generate better code in the first place.

  • Code Review Automation: Tanagram automates the mental checklist that you'd normally run through in code reviews.

Getting Started#

  1. Sign up at web.tanagram.ai.
  2. Connect your GitHub repos.
  3. Install the CLI.

After connecting your repository, Tanagram will analyze your existing repos to generate rule suggestions. Depending on the size of your repos, this typically takes 2–5 minutes. We'll send you an email when suggestions are ready for your review.

See Suggested Rules for more details.

Rules#

Rules are the core of Tanagram. They capture your team's coding conventions, best practices, and current architecture.

What Rules Should I Have?#

Most rules reflect security, reliability, performance, or business logic patterns. For example:

  • API endpoints with a documentID parameter (directly or via a parent router) must call verifyAccessOrRaise() before doing anything else to ensure that the authenticated user has been granted permissions to a document.
  • Tier 0 and tier 1 services must specify a staged rollout that can't exceed 10% of traffic for the first 30 minutes. to enforce a company-wide reliability directive.
  • If you add a new transaction type to app/core/transactions.ts, also add that transaction type to the big switch in src/HandleRecord.scala to enforce changes that must happen together — unlike tradational linters, Tanagram rules can span different languages.
  • For third-party libraries that are critical to our application (e.g. FastAPI itself), pin them to an exact version instead of using ^ — Tanagram rules can encode fuzzy logic.

Rules can prevent compliance or operational problems. For example:

  • One of our users suffered outages from contractors replacing environment-variable reads with hard-coded values for testing and forgetting to reset those changes, so they added a rule to never replace an environment-variable read with a hard-coded value.
  • On our own team, we used to use database migrations to backfill or correct invalid data. These migrations started failing when we expanded to multiple environments, so we added Never backfill data in a database migration to our own set of rules.

Rules can also be used to push forward strictness requirements or new architecture patterns. For example:

  • One of our users migrated from an in-house "task" system to a new "workflow" system based on Temporal. They added a rule to accelerate this migration: Do not add new Tasks, which are now deprecated. Instead, create Workflows, which are built on our new Temporal service.

Creating Rules#

You can write a new rule from the "Add Rule" button on the website, or by asking @tanagram in a github comment on a connected repo.

Rules can be as short as a single sentence, although more detail will help improve accuracy. Tanagram will internally "rewrite" rules with context gathered from your codebase, including existing examples of violations and non-violations, which helps improve accuracy.

Updating Rules#

You can update existing rules from the existing website by clicking into the "Description" input.

You can also disable, delete, or re-run the rewriting process by clicking on the ellipsis icon next to the rule name.

Suggested Rules#

Tanagram analyzes your repos' history to suggest rules. Suggestions show up at the top of your list of rules, with more visible on the "All Suggestions" page.

Suggestions are automatically generated when you first connect a repo, and then periodically in the background.

Each suggestion links to the data sources that inspired the suggestion.

You can accept a suggestion, which will turn it into a full rule. Once accepted, a suggestion also gets rewritten with additional context gathered from your codebase.

Agent Integration#

Install from npm:

npm install -g @tanagram/cli
tanagram login

(More docs coming soon)

Code Review Automation#

Once you connect a repo, Tanagram automatically reviews every pull request when the pull request is opened, and on subsequent pushes.

If the PR contains code that violates a rule, Tanagram will add an inline comment, just like you manually would have. If a subsequent push fixes the problem, Tanagram will automatically resolve the comment thread.