Concepts
This page names every part of Safran once, says what it does, and shows how the parts connect. After it, the rest of the docs should read without surprises.
The profile
safran.yaml is the one file you write. It names the company, the language of tickets and of
code, the trackers and code hosts to read, how repositories group together, which team owns
what, the glossary and the conventions. Nothing company-specific lives anywhere else: not in
the source, not in the skills.
The profile holds no secrets. Fields that end in _env hold the name of an environment
variable; the value comes from your shell or from a .env file next to the profile.
version: 1
company: acme
languages:
tickets: tr
code: en
code:
hosts:
- id: local
type: local
path: /work/acme/repos
groups:
backend: [payments-api, ledger]
glossary:
- term: İade
code: [refund, chargeback]Read more: The profile, Profile reference.
Connectors and plugins
A connector is the piece of code that talks to one outside system. There are four kinds:
| Kind | Profile key | What it provides | Built in |
|---|---|---|---|
| Tracker | trackers[] | Tickets, comments, attachments, links, history, search; children, worklogs, time tracking and iterations where the tracker has them | jira, azure-boards, linear, github-issues |
| Code host | code.hosts[] | The list of repositories, how to clone them, merged pull requests, and pull requests as they are now with their review threads and diffs | azure-repos, github, gitlab, local |
| Doc source | docs[] | Pages that tickets link to, fetched on demand | confluence |
| Embedder | embeddings | Vectors for code chunks and queries | ollama, openai-compatible |
Each entry in the profile has a type. A plugin is what handles a type: a description, a
strict configuration schema and a factory that builds the connector. The built-in plugins ship
with Safran; you can add your own in a TypeScript module and list it under plugins:.
safran plugins lists every type that is available.
A fifth kind of plugin builds no connector: a tool pack (tool_packs[] in the profile) adds a named set of agent tools, which is how optional and company-specific tools live outside the core. A pack's tools get read-only access to tickets, code, pull requests and the company profile, plus a small store of their own; they are given no connector and no way to write. See Tool packs.
Two properties hold for every connector:
- Building one touches no network. A connector without its token is built fine and fails
with
AUTH_MISSINGonly when it is first used. That is whysafran profile checkworks offline. - Read-only by default. A connector's four write methods (a ticket comment, a child ticket, a pull request comment, a thread reply) are called by one guarded path only, and only where the profile opted in. See Writes below.
Not every connector can do everything (a local code host has no pull requests). Each one
declares its capabilities, and a call that needs a missing one fails with UNSUPPORTED and a
message naming the connector.
Read more: Connectors, Writing plugins.
The code index
safran sync clones or fetches every repository the code hosts list (a local host is read in
place), splits each file into chunks, and stores them in one SQLite file under the data
directory. Search runs over that file.
- Hybrid. Every chunk is searchable two ways: lexically (full-text, good at identifiers and
exact words) and densely (embedding vectors, good at meaning and across languages). The
default mode,
auto, weighs the two channels by the shape of the query, and every hit reports the score of each channel. - Incremental. A file is re-chunked only when its content hash changes, and an embedding is computed only when that text has not been embedded by that model before.
- Local. The index is a file on your disk. Vectors of different embedding models are never mixed: after switching the embedder, the affected repositories must be indexed again, and search says so instead of returning wrong answers.
- Scoped by groups.
code.groupsin the profile names sets of repositories (backend,mobile); a search can be limited to one or more of them.
Besides search there is grep (an exact string or a regular expression over the indexed files)
and read (a file or a line range).
Read more: Searching code, Keeping the index fresh.
Work history
safran links refresh reads merged pull requests from the code hosts and stores, locally, one
record per pull request: its title, its author, the files it changed, and its ticket keys: the
links the host itself reports plus the keys found in the title, branch name and description. A ticket key is recognised only for the project keys
the profile lists under a tracker.
That store answers three questions without calling any service: what was changed for this
ticket, what happened to this file, and who usually works on this repository. The last one is
how ownership is inferred when teams in the profile does not name the repository.
Read more: Work history, History tools.
Live pull requests
Work history describes what was merged. A second view reads pull requests as they are right now, from the code host at the moment you ask: open, merged or closed, with reviewers and their votes, the changed files, the review threads and the diff. A pull request is found from its link, from a ticket key it carries, or from a branch name.
Azure Repos, GitHub and GitLab provide this; a local host does not. Each host words votes and thread states differently, and Safran translates them into one vocabulary.
Read more: Pull requests.
Writes
Safran reads. It changes something outside the machine only through one guarded path, and only where the profile asks for it: writes.enabled plus the kinds listed under writes.allow (a ticket comment, a child ticket, a pull request comment, a reply in a review thread). Every write is a preview, an explicit confirmation of that preview, one request, and a row in a local audit log. A profile that was merely found in the current directory cannot turn writes on, and --no-writes turns them off whatever the profile says.
Read more: Writes.
The MCP server
safran mcp serves the instance to a coding agent over the Model Context Protocol, on stdio or on local HTTP. A default server has 29 tools, all read-only, with tracker-neutral names. Two more, the write tools, are registered only when writes are enabled:
| Area | Tools |
|---|---|
| Company | get_company_profile, who_owns, get_server_info |
| Tickets | get_ticket, get_ticket_comments, get_ticket_attachment, get_ticket_history, search_tickets, fetch_linked_doc |
| Ticket depth | get_ticket_family, get_linked_work, get_ticket_changes, get_ticket_time |
| Code | search_code, grep_code, read_file, list_repos |
| History | find_past_work |
| Pull requests | find_pull_request, list_pull_requests, get_pull_request, get_pull_request_threads, get_pull_request_diff |
| Writes (opt-in) | preview_write, commit_write |
The agent calls get_company_profile first and works from the answer: project keys, groups, teams, glossary, conventions, what each connector can do and whether writes are on. Outputs are bounded: lists take a limit, long text is cut on a line boundary with an explicit marker that says how to get the rest. A failing tool returns an error with a hint and its code as a last line ([code: NOT_FOUND]) instead of throwing.
Tools from the profile's tool packs are registered next to these.
Read more: MCP reference, The MCP server.
Skills
A skill is a written procedure Claude Code follows using the tools. The plugin ships sixteen:
| Skill | Question it answers |
|---|---|
/safran:setup | How do I configure Safran for my company? (It asks; it never asks for a token.) |
/safran:ticket-readiness | Is this ticket clear enough to start? |
/safran:technical-analysis | What does this ticket need, where is the code today, which teams have work, how does it split? |
/safran:breakdown | Which child tasks does this ticket split into, per team? |
/safran:estimate | How big is it, as a range with its evidence? |
/safran:implement | Do the work of this ticket in the repository I am in. |
/safran:verify-acceptance | Does the finished work meet the acceptance criteria? |
/safran:review-pr | What is wrong with this pull request, measured against its ticket? |
/safran:pr-fix | Work through the review comments on my pull request. |
/safran:test-plan | Which test cases follow from the ticket's acceptance criteria? |
/safran:standup | What changed since the last working day? |
/safran:find-in-code | Where or how is something done, across every indexed repository? |
Skills contain no company names. They read the profile through get_company_profile, and they write their output in the language of languages.tickets unless you write in another one. Two of them change code in your repository, after you agreed to a plan; none of them posts anything unless writes are enabled and you confirmed that exact text.
Read more: Skills reference, From a ticket link to a merged change, Red lines.
The evidence rule
Every claim about code cites repo path:lines exactly as a tool returned it in the current
session. When a search finds nothing, the answer is "no trace found in the indexed code",
together with what was searched for. A path quoted in a ticket is a lead to verify, not
evidence. The server's instructions and every skill state this rule.
It exists because a claim about code is only worth something if a person can open the file and see it.
The untrusted-data rule
Ticket text, comments, wiki pages, pull request descriptions, review comments and source files are written by third parties. The MCP server wraps all such text in a tag with a random suffix that is new for every tool result, and tells the agent that anything inside is information, never instructions. Text inside a ticket cannot guess the suffix, so it cannot close the wrapper and pretend to be the system.
Read more: Security.
Evaluation
Whether search is good is a question about your company's code, so Safran measures it on your
company's history. safran eval golden builds a golden set: for merged pull requests with a
ticket, the ticket's wording is the question and the files the pull request changed are the
answer. safran eval retrieval runs search against that set and reports recall and rank
metrics; run it before and after any change to the index, the embedder or the glossary.
safran eval replay goes one step further and replays finished tickets with agent commands.
Read more: Evaluation.
Where the data lives
Everything Safran stores is under one data directory, by default data/ next to the profile:
working trees of cloned repositories, the index, and one database with the work-history store, the write audit log and the small store that tool packs use. All of it can be
deleted and rebuilt from the profile. Architecture has the layout.