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 | jira, azure-boards, linear, github-issues |
| Code host | code.hosts[] | The list of repositories, how to clone them, merged pull requests | 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.
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. - Trackers are read-only. No connector has a method that writes to a tracker.
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.
The MCP server
safran mcp serves the instance to a coding agent over the Model Context Protocol, on stdio
or on local HTTP. It has thirteen tools, all read-only, with tracker-neutral names:
| Area | Tools |
|---|---|
| Company | get_company_profile, who_owns |
| Tickets | get_ticket, get_ticket_comments, get_ticket_attachment, get_ticket_history, search_tickets, fetch_linked_doc |
| Code | search_code, grep_code, read_file, list_repos |
| History | find_past_work |
The agent calls get_company_profile first and works from the answer: project keys, groups,
teams, glossary, conventions. 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 code and a hint instead of throwing.
Read more: MCP reference, The MCP server.
Skills
A skill is a written procedure Claude Code follows using the tools. The plugin ships four:
| Skill | Question it answers |
|---|---|
/safran:technical-analysis | What does this ticket need, where is the code today, which teams have work, how does it split? |
/safran:find-in-code | Where or how is something done, across every indexed repository? |
/safran:test-plan | Which test cases follow from the ticket's acceptance criteria? |
/safran:ticket-readiness | Is this ticket clear enough to start? |
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.
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 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 the work-history store. All of it can be
deleted and rebuilt from the profile. Architecture has the layout.