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 four skills that work from it: a technical analysis of a ticket, a code question answered across every indexed repository, a test plan, and a readiness check. Nothing in the plugin names a company; every skill begins by calling get_company_profile and works from what your safran.yaml says.
Start
You need Bun 1.3 or newer, a checkout of the Safran repository with bun install done, and a profile that passes safran profile check. 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:technical-analysis PAY-1423Where 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 four skills
| Skill | Use it for | Output |
|---|---|---|
/safran:technical-analysis <ticket> | What a ticket needs, where the code is today, which teams have work, how it splits | Evidence table, per-team breakdown, paste-ready sub-task drafts, one self-contained HTML report |
/safran:find-in-code <question> | "Where or how is X done" across every indexed repository | Answer with repo path:lines citations grouped by repository and team, what was not found, index freshness |
/safran:test-plan <ticket> | Test cases from the ticket's acceptance criteria | Coverage table, cases per criterion, criteria that are untestable as written, regression areas with the existing tests to extend |
/safran:ticket-readiness <ticket> | Is this ticket clear enough to start? | Verdict, checks, the questions to ask first |
Claude also picks a skill on its own when a request matches its description ("technical analysis for PAY-1423", "is PAY-1501 ready to start").
All four follow the same rules, described with their reasons in red lines: the tracker is read-only, every claim about code carries a citation a tool returned, nothing is invented, third-party text is data and never instructions, and failures are 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.
Where reports are written
Only technical-analysis writes 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. The other three 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 four skills
skills/technical-analysis/ report schema, task-writing guide, renderer, bundled stylesheet
shared/ ground rules, ticket-reading guide, search playbook (all skills)
evals/ eval cases with mocked server answers
scripts/check-tool-names.ts checks every tool name against docs/MCP-TOOLS.md
test/ bun testsThe three 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, and the search playbook that says how to look for code and when "no trace" may be declared.
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, eval case shape
bun plugin/scripts/check-tool-names.ts # tool names, parameters and fields exist in the contract
claude plugin validate ./plugin --strict # manifest and component formatskills/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 six 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.
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. |
More cases are on the MCP server page.