The Claude Code plugin
The plugin is the shortest way to use Safran from Claude Code. It starts the Safran MCP server with your profile and adds sixteen skills that work from it: paste a ticket link and Claude reads the ticket with its comments, attachments, linked work and pull requests, finds the code, implements, reviews, and answers review comments, the way your company does it. Nothing in the plugin names a company; the work skills begin by calling get_company_profile and work from what your safran.yaml says.
Start
You need Bun 1.3 or newer and a checkout of the Safran repository with bun install done. Then, from the checkout:
claude --plugin-dir ./pluginOn first use Claude Code asks for the plugin's one option:
| Option | Value |
|---|---|
profile | Absolute path of your safran.yaml, for example /work/acme/safran.yaml |
Check that the server is connected with /mcp, then run a skill:
/safran:implement PAY-1423No profile yet? Start with /safran:setup. It works before a profile or a server exists, asks about your tracker, code host and conventions, and never asks for a token. When Claude Code asks for the profile option first, enter the path where the profile will be written; the server starts once the file exists (/mcp to reconnect). See Setting up.
Giving the option without the dialog
A plugin loaded with --plugin-dir has the id safran@inline. Its profile option can be supplied by a settings file passed for that run, which changes nothing in your own Claude Code settings:
{ "pluginConfigs": { "safran@inline": { "options": { "profile": "/work/acme/safran.yaml" } } } }# does Claude Code see the option? (starts no session)
claude --plugin-dir /work/safran/plugin --settings safran-plugin.json plugin configure safran@inline --json
# an interactive session, without the dialog
claude --plugin-dir /work/safran/plugin --settings safran-plugin.json
# one scripted run
claude -p "/safran:find-in-code where do we validate refund amounts" --plugin-dir /work/safran/plugin --settings safran-plugin.json --max-turns 12 --output-format jsonThe first command answers with "configured": ["profile"] when the option is seen. The same two flags work for an interactive session and for claude -p, so scripted and headless runs need no dialog. A skill started as /safran:<skill> … needs no --allowedTools: its own allowed-tools cover the Safran tools and the read-only git commands it uses. This was checked with Claude Code 2.1.331 in real sessions, from a directory outside the Safran checkout.
Where tokens come from
Tokens are never typed into Claude Code. The profile holds only the names of environment variables (token_env: JIRA_TOKEN); the values are read when the server starts, from two places:
- the environment Claude Code was started in, and
- a
.envfile in the same directory as the profile. A variable that is already set in the environment is not overridden by the file.
For the acme profile that means JIRA_EMAIL, JIRA_TOKEN, AZURE_DEVOPS_PAT and CONFLUENCE_TOKEN are either exported in your shell or written in /work/acme/.env. A missing variable does not stop the server from starting: the connector that needs it fails on its first call with AUTH_MISSING and names the variable. See secrets.
How the plugin starts the server
The manifest declares the option and the server. This is the part that matters:
{
"userConfig": {
"profile": {
"type": "string",
"title": "Safran profile",
"required": true,
"sensitive": false
}
},
"mcpServers": {
"safran": {
"command": "bun",
"args": [
"--cwd=${CLAUDE_PLUGIN_ROOT}/..",
"run",
"packages/cli/src/index.ts",
"mcp",
"--profile",
"${user_config.profile}"
]
}
}
}Claude Code replaces ${CLAUDE_PLUGIN_ROOT} with the plugin directory and ${user_config.profile} with the path you entered. The command is the Safran CLI's mcp command over stdio.
--cwd is there for a reason. Bun loads .env and bunfig.toml from its working directory by itself, before any Safran code runs. A server started in whatever project you have open would take a proxy setting from that project's .env, and send your tracker token through it, or run a preload named in its bunfig.toml. Starting Bun with the Safran checkout as its working directory means that checkout is the only directory Bun reads from. The price is the absolute profile path.
Tool names
With the plugin, Claude Code registers the server's tools as mcp__plugin_safran_safran__<tool>, for example mcp__plugin_safran_safran__get_ticket. Registered on its own, the same server's tools are mcp__safran__<tool>.
The skills name the plugin-prefixed tools in their allowed-tools. Their instructions add that when the tools are registered under a different prefix in the session, they are to be used under that name.
The sixteen skills
| Skill | Use it for |
|---|---|
/safran:setup | Configure Safran for your company by answering questions; resume or adjust an existing setup |
/safran:implement <ticket> | Do the work of a ticket in the repository you are in |
/safran:review-pr [PR link | ticket] | Review a pull request against its ticket (no argument: the current branch) |
/safran:pr-fix [PR link | ticket] | Work through the review comments on your pull request |
/safran:verify-acceptance <ticket> | Check finished or in-review work against the acceptance criteria |
/safran:breakdown <ticket> | Split a ticket into child tasks per requirement and team |
/safran:estimate <ticket> | An evidence-based size, as a range |
/safran:standup [team] [since] | What changed since the last working day |
/safran:technical-analysis <ticket> | What a ticket needs, where the code is today, which teams have work, how it splits |
/safran:find-in-code <question> | "Where or how is X done" across every indexed repository |
/safran:test-plan <ticket> | Test cases from the ticket's acceptance criteria |
/safran:ticket-readiness <ticket> | Is this ticket clear enough to start? |
/safran:bug-fix <ticket | failure> | Diagnose a bug to its root cause, then fix it with a regression test |
/safran:how-it-was-built <ticket> | How the other teams and platforms built the same feature, and the contract you share |
/safran:regression-scope [PR link | ticket] | What a change puts at risk, how to check it and whom to tell |
/safran:retro | Record what the work taught: a profile convention, a glossary term, a line in AGENTS.md |
What each one reads, where it stops to ask and what it produces is in the skills reference; From a ticket link to a merged change follows one ticket through four of them.
Claude also picks a skill on its own when a request matches its description ("start on PAY-1423", "is PAY-1501 ready to start"), in English or in Turkish.
All sixteen follow the same rules, described with their reasons in red lines: read-only by default, writes only where the profile opted in and one confirmed preview at a time, your repository changed only after you agreed to a plan, every claim about code with a citation a tool returned, nothing invented, third-party text as data and never instructions, and failures stated.
Output is written in the profile's languages.tickets (tr for acme), unless you write to Claude in another language; then it answers in yours.
Permissions
Skills pre-approve reads only: the Safran read tools they need, a few read-only git commands, and preview_write, which sends nothing. Editing a file, running your tests, committing, and commit_write (the final step of every write) go through Claude Code's normal permission prompts. A default install registers no write tool at all; see Writes.
Where reports are written
Only technical-analysis writes report files. It writes safran-reports/<ticket>.json and renders it to safran-reports/<ticket>.html in the directory you run Claude Code from. The HTML is one self-contained file that makes no network request, so it can be mailed or attached as it is. implement and pr-fix change files in your repository after you agreed to a plan; the other skills answer in the conversation.
Preview the report design with the fictional example bundled in the plugin (run from the checkout; the renderer takes absolute paths only):
bun plugin/skills/technical-analysis/scripts/render-report.ts --example "$PWD/safran-example.html"What is in the plugin directory
plugin/
.claude-plugin/plugin.json manifest: the `profile` option and the MCP server wiring
skills/<skill>/SKILL.md the sixteen skills
skills/technical-analysis/ report schema, task-writing guide, renderer, bundled stylesheet
skills/setup/ the profile reference the setup interview works from
shared/ground-rules.md the rules every skill states in short form, with the reasoning
shared/reading-a-ticket.md what to read of a ticket, and with which tool
shared/search-playbook.md finding code, and knowing when it was not found
shared/pull-requests.md finding a pull request, reading its diff and its review threads
shared/implementing.md plan, small steps, verify; conventions from profile and repository
shared/writes.md the only way anything is posted: preview, show, yes, commit
evals/ eval cases with mocked server answers
scripts/check-tool-names.ts checks what the plugin says about the tools against docs/MCP-TOOLS.md
test/ bun testsThe files in shared/ are read by the skills while they run: the ground rules (the long form of the red lines), a guide to reading a ticket completely, the search playbook that says how to look for code and when "no trace" may be declared, how to find and read a pull request, how to implement in small verified steps, and the one procedure for posting anything.
Develop and validate
When you change a skill or the manifest, three commands check the plugin. Run them from the checkout:
bun test plugin # renderer, manifest, skills, contract check, eval case shape
bun plugin/scripts/check-tool-names.ts # tools, parameters, quoted limits, write kinds, CLI commands
claude plugin validate ./plugin --strict # manifest and component formatcheck-tool-names fails when a skill, a shared guide or an eval mock passes a parameter a tool does not have, quotes a default or a maximum that differs from the tool contract, or names a write kind or a safran command that does not exist.
skills/technical-analysis/assets/report.css is a copy of brand/report.css, used when the plugin is installed away from the repository. A test fails when the two differ; copy the file again after changing the brand stylesheet.
The plugin also ships twelve eval cases with mocked server answers. What they check is listed in red lines. Running them starts model sessions on your account and costs money; nothing runs them for you, and this code base has not yet run them in live sessions.
Common problems
| Symptom | Cause and fix |
|---|---|
/mcp does not list safran, or shows it as failed | The profile path is wrong or relative, Bun is not on the PATH of the process that starts Claude Code, or the profile does not validate. Run safran profile check --profile /work/acme/safran.yaml in a terminal; it prints the same error the server hit. |
| Every tool appears twice | The plugin is enabled and the server is also registered with claude mcp add. Remove one. |
| A skill stops at once with an error and a hint | That is the intended behaviour when get_company_profile fails or the tools are missing. Read the hint; /mcp shows the server status. |
The first ticket call fails with AUTH_MISSING | A variable the profile names is not set. Export it or add it to the .env next to the profile, then restart Claude Code: the environment is read once, when the server starts. |
| Code tools say the index is not ready or empty | The index is built by you, in a terminal: safran sync --profile /work/acme/safran.yaml. |
| A skill says Safran is read-only although the profile enables writes | The server was started before the profile changed. Reconnect with /mcp; get_server_info gives the reason when writes are off. |
More cases are on the MCP server page.