Skip to content
safran

Type to search. Enter opens the first result.

    Setting up

    There are two ways to get from a fresh checkout to a Claude Code session that knows your company. /safran:setup asks you questions and runs the commands with your consent. The manual path is the same commands, typed by you. Both end with the same things: a validated safran.yaml, an index of your code, reviewed teams and glossary, and the server connected to Claude Code. This page shows both.

    Either way you need what Requirements lists: Bun, git, a checkout of Safran with bun install done, and for code search an embedder (Ollama with bge-m3 by default).

    With /safran:setup

    Start Claude Code with the plugin, from the checkout:

    claude --plugin-dir /work/safran/plugin

    Claude Code asks for the plugin's one option, profile. Enter the absolute path where the profile will be written, for example /work/acme/safran.yaml. The server cannot start yet, because the file does not exist; that is expected. Then:

    /safran:setup /work/acme/safran.yaml

    The skill works before a profile or a server exists, so it drives the safran command line instead of the MCP tools. It says in three lines what will happen and starts.

    It never asks for a token

    This is the rule the skill is built around, and it is checked by an eval case.

    • The skill asks for the name of the environment variable that will hold each token (JIRA_TOKEN) and writes that name into the profile. It never asks for the value.
    • You set the value yourself, outside the conversation: exported in the shell that starts Claude Code, or as a NAME=value line in a .env file next to the profile, which you create in your editor, keep readable only by you (chmod 600) and never commit.
    • The skill checks presence by name only, through safran profile check, which prints set or not set. It never reads, prints or searches a .env file.
    • If you paste a token anyway, it is not used and not repeated. The skill tells you that it is now part of the conversation transcript and should be revoked and replaced.

    The CLI holds the same line. A value that is not a variable name is refused:

    $ safran profile set trackers.jira.token_env not-a-real-token-0000 --profile safran.yaml
    ✘ trackers.jira.token_env takes the NAME of an environment variable (for example JIRA_TOKEN), never the secret itself
    → The value you passed was not used and is not shown. If it was a real token, treat it as leaked: it is now in your shell history.

    What it asks, and what it does

    One topic at a time, with concrete options. It does not ask what a command can find out.

    StepIt asksIt runs
    PreflightNothingsafran --help, safran doctor; finds out whether this is a fresh start or a setup to continue
    LocationA directory of its own for the profile, outside any code repository; the company slug; the language of tickets and of code
    SourcesTracker(s): type, URL, projects in scope. Code host(s): type and location. Wiki: site and which spaces may be read. Embedder: local Ollama, or a remote endpoint (then source code is sent to it, and it says so). For each: the name of the token variablesafran plugins to offer only the types that are installed
    Profilesafran init with everything collected so far (several trackers, hosts and the wiki in one command), then safran profile check until it passes. Later changes go through safran profile set, add and unset; before the first one it tells you that comments below the top of the file are lost and that the original is kept as safran.yaml.bak
    SecretsTells you which variables to set and what kind of token each needs; waits until you say it is donesafran profile check again to see the names turn to set
    Online check and scopeWhich projects and which repositories are in scope, from the real listssafran profile check --online, safran repos, then safran profile set for projects, include and exclude
    First syncA starter set of three to five repositories, everything, or fetch onlysafran sync, in the background where the client allows it
    Historysafran links refresh, safran links status
    DiscoveryReviews the draft with you one kind at a time: groups, teams (it asks for each team's name), at most twenty glossary candidates, conventionssafran discover; what you accept is written with safran profile add
    What discovery cannot knowTeams that did not show up; five ticket words that are called something else in the code; rules for titles, branches and commits; title prefixes per side of a featuresafran grep to check the code words you gave
    WritesOnce, with "no" first: may agents post through Safran, and which of the four kinds. The risks are stated before your answer is takenFor a yes: one safran profile set writes.… command, then safran writes status to show the result. For a no: nothing
    ConnectPlugin or server alone, and for the server which scopesafran setup claude --print; --run only if you say so
    VerifyOne real ticket key from youget_company_profile in the session, or safran status

    Only checks are pre-approved for the skill. Every command that writes a file, clones repositories or changes the Claude Code configuration goes through a permission prompt.

    Other things it will not do: overwrite an existing profile (init --force and discover --write --force are run only when you asked for exactly that), complete a list from "what companies usually have", copy the discovery draft over the profile wholesale, turn writes on without your explicit answer, or start a model session.

    Resume and change

    Run /safran:setup again at any time. It looks at what exists (a profile, tokens named but not set, nothing cloned, a draft waiting, teams already in the profile) and continues from there, or asks which part you want to change. An existing profile is adjusted, not replaced.

    What you have at the end

    • Written: the profile, the discovery draft, the data directory.
    • Configured: trackers, hosts, doc sources, the embedder; teams, groups, glossary entries and conventions, with counts.
    • Unverified: everything that was not checked: a connector not tried online, a variable still not set, repositories not indexed, team mappings left at low confidence, glossary candidates nobody reviewed.
    • Three prompts built from your own data: a ticket, a code question on one of your glossary terms, and a team view.
    • How to keep it fresh: safran sync and safran links refresh, from your own scheduler. Safran does not schedule itself.

    By hand

    The same result with the CLI. Every block below is real output, captured in a temporary directory; paths are normalised.

    1. Write the profile

    safran init writes a starter profile from flags. It contacts no service and stores no secret. Repeat --tracker, --host and --docs for several connectors; --set fills a connector's fields.

    $ safran init --yes --company acme --language tr --tracker jira --set tracker.url=https://jira.acme.example --set tracker.projects=PAY,MOB,WEB --host azure-repos --set host.id=azure --set host.organization=acme --set host.projects=Platform --docs confluence --set docs.id=wiki --set docs.url=https://jira.acme.example --set docs.spaces=PAY --profile safran.yaml
    ✔ Wrote safran.yaml
    
    Set these environment variables, in your shell or in a .env file next to the profile:
      AZURE_DEVOPS_PAT  ! not set
      CONFLUENCE_EMAIL  ! not set
      CONFLUENCE_TOKEN  ! not set
      JIRA_EMAIL        ! not set
      JIRA_TOKEN        ! not set
    
    Next
      safran profile check --profile safran.yaml  validate the profile and every connector
      safran doctor --profile safran.yaml         check git, the embedder and the index
      safran sync --profile safran.yaml           clone or read the repositories and index them
      safran discover --profile safran.yaml       draft groups, teams and glossary from merged pull requests
      safran setup claude --profile safran.yaml   print the command that connects Claude Code

    Without --yes the same command asks the questions interactively. The second entry of a kind is addressed as tracker.2.url=…. Writes stay off unless --writes names kinds.

    2. Set the tokens, then check

    Export the variables or put them in the .env next to the profile, then:

    safran profile check --profile /work/acme/safran.yaml
    safran profile check --online --profile /work/acme/safran.yaml

    The first validates the file and builds every connector without calling one. --online makes one cheap call per connector and reports each error with its hint.

    3. Change the profile through the validator

    safran profile set, safran profile add and safran profile unset edit the file and write it only when the result is a valid profile. The first edit keeps the original as safran.yaml.bak. Comments in the file are not kept, except the block at the top.

    $ safran profile set code.hosts.azure.exclude '*-archive,sandbox-*' --profile safran.yaml
    ✔ Updated safran.yaml
      = code.hosts.azure.exclude: [*-archive, sandbox-*]
      The file as it was before this first edit is kept as safran.yaml.bak.
    $ safran profile add groups backend payments-api ledger --profile safran.yaml
    ✔ Updated safran.yaml
      + code.groups.backend: [payments-api, ledger]
    $ safran profile add teams Payments --projects PAY --repos payments-api,ledger --profile safran.yaml
    ✔ Updated safran.yaml
      + teams.Payments: name: Payments, projects: [PAY], repos: [payments-api, ledger]
    $ safran profile add glossary İade --code refund,chargeback --profile safran.yaml
    ✔ Updated safran.yaml
      + glossary.İade: term: İade, code: [refund, chargeback]
    $ safran profile add conventions "Branch names follow feature/<TICKET-KEY>-short-description." --profile safran.yaml
    ✔ Updated safran.yaml
      + conventions.0: Branch names follow feature/<TICKET-KEY>-short-description.

    A value in YAML quotes is taken as exactly that text, which is how a prefix with brackets is written:

    $ safran profile set tickets.title_prefixes.backend '"[BE]"' tickets.title_prefixes.mobile '["[iOS]", "[AND]"]' --profile safran.yaml
    ✔ Updated safran.yaml
      = tickets.title_prefixes.backend: ["[BE]"]
      = tickets.title_prefixes.mobile: ["[iOS]", "[AND]"]

    token_expires records when a connector's token runs out, so safran doctor, safran status and get_server_info can warn fourteen days ahead:

    $ safran profile set trackers.jira.token_expires 2027-03-01 --profile safran.yaml
    ✔ Updated safran.yaml
      = trackers.jira.token_expires: 2027-03-01

    A whole connector is added in one command, because all pairs are applied together or not at all. An entry that would be incomplete is refused and the file is left as it was:

    $ safran profile set trackers.linear.type linear --profile safran.yaml
    ✘ The edit would make safran.yaml invalid, so nothing was written:
      - trackers.1.token_env: Invalid input: expected string, received undefined
    → trackers.linear would be a NEW entry: give it every field it needs in the same command, or check the name for a typo. The file is unchanged.
    $ safran profile set trackers.linear.type linear trackers.linear.token_env LINEAR_TOKEN trackers.linear.projects OPS --profile safran.yaml
    ✔ Updated safran.yaml
      = trackers.linear.type: linear
      = trackers.linear.token_env: LINEAR_TOKEN
      = trackers.linear.projects: [OPS]
    $ safran profile unset trackers.linear --profile safran.yaml
    ✔ Updated safran.yaml
      − trackers.linear  (was id: linear, type: linear, token_env: LINEAR_TOKEN, projects: [OPS])

    Editing the YAML in an editor works just as well; run safran profile check afterwards. Every key is in the profile reference.

    4. Index, history, discovery

    safran doctor --profile /work/acme/safran.yaml
    safran sync --profile /work/acme/safran.yaml
    safran links refresh --profile /work/acme/safran.yaml
    safran discover --profile /work/acme/safran.yaml

    safran sync payments-api ledger indexes a starter set first. safran discover writes a draft next to the profile and changes nothing else; review it and move what is right into the profile. A new company walks through these steps with their output, and Discovery explains the draft.

    5. Connect Claude Code

    safran setup claude validates the profile and prints the registration command with this checkout's bin/safran and the absolute profile path. Without --run nothing on the machine is changed.

    $ safran setup claude --profile safran.yaml
    Register the Safran MCP server for acme in Claude Code (scope local: you, in the project you run the command in):
    
      claude mcp add --transport stdio --scope local safran -- /work/safran/bin/safran mcp --profile /work/acme/safran.yaml
    
    Nothing was changed. Run the line above, or let Safran run it: safran setup claude --run --profile safran.yaml
    
    Writes through this server: off: the profile does not enable them, so the server only reads.
    In a session, /mcp shows the server; restart Claude Code if the tools do not appear. Undo: claude mcp remove safran --scope local
    
    Or load the plugin instead: the skills and the same server together. Use one of the two, not both, or every tool is registered twice.
    
      claude --plugin-dir /work/safran/plugin
    
      Its one option, `profile`, takes the absolute path: /work/acme/safran.yaml
      Claude Code asks for it when the plugin is enabled; change it later under /plugin, then reconnect with /mcp.
    FlagMeaning
    --scopeWhere Claude Code stores the registration: local (default), project or user
    --httpRegister a running safran mcp --http server instead of starting one over stdio; --port and --token-env say where it is and which variable holds its bearer token
    --nameThe server's name in Claude Code, default safran
    --runRun the command with the claude on your PATH

    The plugin gives you the sixteen skills and the server together; the server alone gives you the tools. Details: the plugin, the MCP server.

    6. Decide about writes

    Nothing to do for the default: Safran only reads. If people should be able to post through it, read Writes first, then enable the kinds you will use. safran writes status says where you are.

    Common problems

    SymptomCause and fix
    The skill does not startIt ships with the plugin: start Claude Code with --plugin-dir. It does not need the server.
    /mcp shows safran as failed during the setupExpected until the profile exists. Reconnect with /mcp after step "Profile".
    A variable stays not set after you exported itClaude Code reads its environment once, at start. Restart it, or use the .env next to the profile.
    profile set says the entry "would be a NEW entry"The id in the path does not exist. Check it for a typo, or give every required field in the same command.
    profile set rewrote the layout of the fileIt normalises lists to one item per line and drops comments below the top block. The original is in safran.yaml.bak.
    Tools appear twiceThe plugin is enabled and the server is also registered. Remove one (claude mcp remove safran --scope local).