Skip to content

Agent Integration

TribalMind integrates with AI coding agents by generating instruction files — the config files that agents read to understand their behavior. Once set up, agents will automatically recall knowledge when debugging and store knowledge when they discover something useful.

Terminal window
tribal setup-agents

This auto-detects which agents you use and generates the appropriate config files. For more control:

Terminal window
# Specific agents
tribal setup-agents -a CLAUDE.md -a .cursorrules
# All supported agents
tribal setup-agents --all

Files: CLAUDE.md (root) or .claude/CLAUDE.md (repo-scoped)

Claude Code gets a dual-save snippet — it’s instructed to save knowledge to both TribalMind and its native auto-memory system simultaneously. This ensures knowledge is available both locally (for Claude Code’s own context) and in the shared team memory.

The snippet instructs Claude Code to:

  • Run tribal recall before exploring the codebase when debugging
  • Run tribal remember after completing changes that produced useful insights
  • Always save to both tribal remember and native memory in the same step

After setup, your agents will follow these patterns:

When an agent starts any task, it runs tribal recall before exploring the codebase — not after. The prompts use opt-out framing: always recall, skip only for trivial tasks (renaming, formatting, etc.).

Terminal window
tribal recall --json "topic and task type"

The query tip built into the prompt encourages agents to include both what the task is about and what kind of work it is (e.g., "auth token refresh | deployment process"). This surfaces both relevant knowledge and stored workflows.

If local recall returns nothing relevant, agents are instructed to automatically retry with --all for cross-repo search.

After completing changes, agents ask themselves a single self-check question: “Did I discover WHY something works the way it does?” If yes, they store it immediately:

Terminal window
tribal remember "what was learned — specific and with context"

After running tribal setup-agents, check that your agent config file contains the TribalMind snippet:

  1. Open the generated file (e.g., CLAUDE.md)
  2. Look for the ## TribalMind — Project Memory section
  3. Verify it includes the tribal recall and tribal remember instructions

The generated snippets are plain text appended to your agent config files. You can edit them freely — TribalMind won’t overwrite your changes unless you re-run tribal setup-agents.

If you want to regenerate, just run tribal setup-agents again. It will replace the existing TribalMind section.