Turn a Jira issue or a bug you describe into focused code context for AI coding agents
pip install bugpilot==0.1.7 Copy PIP instructions
BugPilot turns a Jira issue — or a bug you describe yourself — into focused code context for your AI coding agent. It reads the issue, searches the repository, looks at related git history and similar past fixes, and writes a task package the agent can work from. Then it stops: you hand the package to the agent you use, and you stay in control of every commit.
It comes as a command-line tool (bugpilot), an MCP server (bugpilot-mcp) and a VS Code extension, which all share the same core.
bugpilot --version Expected, for this release:
bugpilot 0.1.7 If you also use the VS Code extension, the CLI and the extension must be the same version: install or update them together.
The MCP server needs the optional MCP SDK: pipx install "bugpilot[mcp]", or python -m pip install "bugpilot[mcp]".
Development installation. To run BugPilot from a checkout of this repository instead:
git clone https://github.com/xsw7910/bugpilot.git cd bugpilot pipx install . # or: python -m pip install . Add the MCP server with pipx install ".[mcp]". Working on BugPilot itself (editable install, tests, a standalone executable) is in Development.
Run BugPilot from the root of the repository you want to fix. It reads the repository there and keeps its own files in its data folder (below):
cd path\to\your-repo bugpilot doctor # Python, git, ripgrep, Jira, agents bugpilot bug --description "Saving a record with no selection crashes" That prepares the work item's folder and prints the line to hand to your agent:
Read /home/you/.bugpilot/repositories/your-repo-0123456789abcdef/work/ /task.md and complete the workflow. Where BugPilot keeps its files BugPilot writes nothing into your repository. What it generates, and every setting, is in its data folder, ~/.bugpilot/ (set BUGPILOT_HOME to an absolute path to use another folder, outside every repository):
~/.bugpilot/ ├── config/ your Jira site and credentials, User Instructions, your Fix Modes └── repositories/ / one folder per repository, named from its path ├── settings/ Project Instructions, Verification Policy, AI Behavior, project settings, │ Repository Profile, project Fix Modes ├── work/ / task.md, context.md, retrieval.json, fix_report.md, attachments/, … └── memory/ .md similar-fix memory bugpilot doctor shows the repository's folder (storage.repository_dir in doctor --json). Your agent still works in the repository. The handoff names the task file by its full path, and an agent that asks before reading or writing outside its working folder asks for this one. A repository's settings are yours, kept for that repository on your machine; they are not shared through the repository. The folder is chosen by the repository's path — the real path of the folder you run BugPilot in, nothing else. Move or rename the repository, run BugPilot from a subfolder, use a clone at another path, or set another BUGPILOT_HOME, and BugPilot uses a new, empty folder: work items, memory and settings prepared under the old path seem to be missing. They are still in the old folder; nothing moves them. Run BugPilot from the repository's root again (or move the repository back), or prepare the work items again and set the settings again. A clone at the same path finds its folder again. Upgrading from 0.1.6 or earlier. Nothing is migrated. BugPilot no longer reads a repository's .ai/, .ai_memory/ or .bugpilot/, or ~/.bugpilot/config.toml, ~/.bugpilot/instructions.md and ~/.bugpilot/fix_modes/, and it never deletes them. Run bugpilot setup again, prepare work items again, and set again the settings you want to keep: each command writes the new place. Delete the old folders yourself once you no longer need them. Update the CLI and the VS Code extension together: an extension older than 0.1.7 looks for work items in the repository, and does not find the ones a 0.1.7 CLI prepares. A 0.1.7 CLI started by such an extension says so instead of preparing anything (error code EXTENSION_OUTDATED, shown by the extension as its environment check failing), and a 0.1.7 extension with an older CLI reports the CLI as out of date. The CLI tells the old extension apart by the VS Code extension host's environment (VSCODE_CRASH_REPORTER_PROCESS_TYPE=extensionHost) without the BUGPILOT_CLIENT_STORAGE=unified that 0.1.7 and later extensions set; another tool that runs bugpilot doctor --json, bug --json or bug --json-lines from inside a VS Code extension, and reads BugPilot's data folder, sets that variable too. A terminal, a script, CI and the MCP server are not affected.
A bug you describe is a first-class input; it needs no Jira at all.
bugpilot bug --description "Exporting with an empty filter writes an empty file" --title "Empty export" bugpilot bug --description-file bug.md --hint "Start in the export dialog's filter handling" bugpilot bug --description "..." --attach .\crash.log --attach .\screenshot.png --hint points the agent at where you think the fix belongs; it is guidance, checked against the evidence. --attach copies files into the work item's attachments/ and names them in the task. Each hand-written bug gets its own local_ work item. Jira setup bugpilot setup # asks for the site, your email and an API token, and checks them bugpilot bug JR-12345 # prepare from a real Jira issue The site is https://your-company.atlassian.net-style: https:// only, with no user name, password, query or fragment. Redirects are followed only within the same site. There is no option to allow plain http://. Where BugPilot reads the site, email and token: the environment first (JIRA_BASE_URL, JIRA_EMAIL, JIRA_TOKEN), then ~/.bugpilot/config/config.toml (written by bugpilot setup; bugpilot jira-site set changes only the site). The VS Code extension's Jira Setup writes the site to the same file and keeps the email and token in VS Code's secret storage. Real Jira is required by default. --allow-mock allows clearly marked demo data for trying BugPilot without a Jira site. BugPilot reads Jira. It writes to Jira only when you ask it to post one comment (see Notifications); it never transitions, assigns or edits fields. Repository Profile task.md describes the repository in a Repository Context section, from its profile:
The profile is saved in the repository's settings in BugPilot's data folder (repository_profile.json). No file means Auto-detect.
bugpilot repository-profile # what is configured, and what Auto-detect finds bugpilot repository-profile set --mode generic User / Project Instructions Two optional Markdown files add your own guidance to every task.md:
Each is at most 20,000 characters; a file that cannot be used (a link, not UTF-8, too long) is left out with a warning, never cut short. Saving empty text removes the file. Their text is never written to a log.
bugpilot instructions # both, and what they say bugpilot instructions set --scope project --from-file team.md bugpilot instructions set --scope user --clear Precedence. task.md lists its layers in this order, and the earlier one wins a conflict:
So a team's "do not add new dependencies" beats one developer's "prefer library X". The safety rules are written into task.md unchanged and before every editable layer, and no instruction file can delete or replace them; the task tells the agent to resolve a conflict in the safety rule's favour — "commit directly to main", say — and to record it in its review notes. That is an instruction to the agent, not a sandbox: review what the agent did before you commit it.
Protected rules. The rules every task.md states word for word — grouped as Safety, Evidence Integrity, Git / Editing, Delivery, Jira and Secrets / Artifacts, each with a stable id — are built into BugPilot and read-only: there is no file to edit them, and no instruction file, Verification Policy, AI Behavior or Fix Mode replaces them in the task. To see them, and the precedence above:
bugpilot protected-rules show # the rules by group, what BugPilot does with them, and the precedence bugpilot protected-rules show --json # the same for tools: rules_version, groups, rules (id, group, section, title, text), precedence Effective AI task. bugpilot task-preview shows the task.md BugPilot would hand an agent now, written by the same code a run uses and saved nowhere. Given a prepared work item it is that work item's task with every policy read again, and it says whether the prepared task.md still says the same and which sections differ. Without one it is a template — Template preview — no work item selected — in which placeholders such as stand for what only a work item has; everything else is your repository's and your own configuration. It creates no file, contacts no Jira and runs no Git command.
bugpilot task-preview # the template: Standard Fix, branch policy current, no Jira comment bugpilot task-preview --fix-mode investigate-first --jira-comment # the template with other run settings (bug's own flags) bugpilot task-preview JR-12345 --json # a prepared work item's task: text, sections (protected or not), sources, prepared state Effective context. bugpilot context-preview JR-12345 shows the context BugPilot last generated for a work item — the context.md its agent was handed — and whether it is still current. It never builds a new one: only retrieval can. A stale context is still shown, under Context status: Needs rebuild and what changed since it was generated (the instructions, the Verification Policy, AI Behavior, the Repository Profile, the Fix Mode, branch naming, or a missing or unreadable prepared file). It does not see the retrieval settings you have changed in the panel since — the panel compares those — or the issue in Jira since it was fetched, and says so. Without a work item, or before its context is built: No generated context available. Build context first.
bugpilot context-preview JR-12345 # the status, what changed, quality and confidence, then the context bugpilot context-preview JR-12345 --json # state, text, freshness (reasons, unchecked), task, quality, retrieval, sources, problems Verification Policy and branch naming Verification Policy — what checking the project expects from a fix. task.md states it in one ## Verification Policy section and names where it came from. It comes from one of three places, the first that exists:
The last two also ask the agent to describe its manual validation when automated tests are unavailable, and to report the regression risk and the commands it attempted (in 0.1.2 these were BugPilot rules; they are the policy's now, so a repository's own text can replace them). Reading never creates the file; the first bugpilot verification set does, and from then on it is the policy. How a given attempt verifies stays the Fix Mode's, and whatever the policy says, the agent must never claim a test or check ran unless it did — that rule is BugPilot's, not the policy's.
verification.md starts with front matter that BugPilot writes for you:
--- schema_version: 1 based_on_version: 1 mode: replace --- Run the tests next to the changed module (for example `tests/test_format_a.py`). Run the static checks the repository already has. Do not run the full suite. Report which checks you did not run, and why. A file that cannot be used — no or malformed front matter, an unknown key, an empty body, more than 20,000 characters, not UTF-8, or a link or junction — is never reinterpreted: BugPilot uses its default instead and says why, in the CLI output and in run warnings. A line that looks like it asks for something a safety rule forbids (force push, committing or pushing without approval, staging .ai/, ignoring the safety rules, reporting tests that did not run, hiding failures) gets a non-blocking warning; the policy is kept as written, and the warning is a hint, not a complete check.
bugpilot verification show # the effective policy and where it comes from (--json: source, file state, lint, problems) bugpilot verification set --from-file policy.md # a policy body (front matter is added) or a whole document; also --stdin bugpilot verification reset # remove verification.md (clear is the same); the switches or the default apply again In the VS Code extension the policy is a row in Advanced Settings › Guidance & Verification: it shows the source in force (BugPilot default, Legacy project settings or Repository verification.md), and Edit opens verification.md in an editor tab — the CLI creates it first, from the policy in force, if it is not there — Reset removes it after asking, and Preview shows the policy read-only. Problems and warnings are shown on the row, and a policy that changed since the context was prepared shows Needs rebuild. The extension's four Verification switches are gone; see extension/README.md.
Branch naming — the name a new branch gets when the branch policy calls for one: feature/{issue}-{slug} by default, or a template such as bugfix/{issue}-{slug}, saved in the repository's project_settings.json. Only {issue} and {slug} are substituted; {issue} is required, so two issues never share a branch, and a template that could make an unsafe ref is refused. It never creates or switches a branch, and a work item keeps the branch it already has.
bugpilot project-settings # current values, or the defaults, and the verification source bugpilot project-settings set --from-file settings.json # {"verification": {...}, "branch_naming": {"template": "bugfix/{issue}-{slug}"}} Mixed versions. 0.1.2 and earlier never read verification.md. A 0.1.2 client can still save the four switches with project-settings set; they are accepted and kept (the 0.1.3 extension shows no switches and writes back the saved values unchanged), but while verification.md exists it decides, and project-settings says so (verification_source: verification-file, plus a warning on set). A 0.1.3 extension that finds verification.md next to a CLI whose bugpilot doctor --json has no verification-text capability reports the CLI as out of date rather than preparing a task without the repository's policy.
AI Behavior — how the agent is expected to make and report changes in this repository: conventions and minimum expectations, not safety rules. task.md states it in one ## AI Behavior section. BugPilot's defaults (small, targeted fixes; follow the surrounding code; no unrelated refactoring, public API renames or behaviour changes outside the issue) always apply, and ai_behavior.md in the repository's settings adds the repository's own beneath them — it never replaces them. The selected Fix Mode decides how one attempt works within these conventions; what to verify stays the Verification Policy's.
bugpilot ai-behavior show # the effective AI Behavior and where it comes from (--json: source, file state, versions, lint, problems) bugpilot ai-behavior set --from-file behavior.md # additions (front matter is added) or a whole document; also --stdin bugpilot ai-behavior reset # remove ai_behavior.md (clear is the same); BugPilot's defaults apply alone In the VS Code extension it is a row in Advanced Settings › AI Behavior & Rules: Edit opens the repository's ai_behavior.md in an editor tab (the CLI creates it first with its three sections, empty), Reset removes it after asking, and Preview shows the AI Behavior in force. The panel reads it to tell when a prepared context needs a rebuild; a 0.1.4 extension that finds ai_behavior.md next to a CLI whose bugpilot doctor --json has no ai-behavior-text capability reports the CLI as out of date. The same section lists the protected rules (read-only), and Advanced Settings › Effective Output — or ⋯ More — shows the Effective AI Task and the Effective Context from task-preview and context-preview.
A Fix Mode decides how the agent approaches a bug — how far to investigate, how to implement, how to verify, what to report. It never decides what the agent may do.
BugPilot never creates or switches branches itself; task.md tells the agent which branch to work on, by the policy you choose with --branch-policy:
Preparing a work item again — a rebuild, a resume, a retry — never calls for a new branch. Under every policy main and master are never edited, committed to or pushed.
bugpilot bug JR-12345 # prepare from Jira (keeps existing artifacts, launches nothing) bugpilot bug JR-12345 --fresh # delete the work item's files first, then prepare bugpilot bug JR-12345 --fix-mode conservative --branch-policy per-issue bugpilot status JR-12345 # where a work item stands bugpilot check-results JR-12345 # has the agent written fix_report.md? bugpilot summarize-results JR-12345 # the report's status and a validation checklist bugpilot review-package JR-12345 # a review prompt for any reviewer bugpilot record-review JR-12345 --summary "..." bugpilot retry-prompt JR-12345 # a second attempt, from your feedback bugpilot clean JR-12345 # remove the work item's files (memory is kept) Add --json (queries) or --json-lines (bug) for machine-readable output. bugpilot --help and bugpilot --help list every command and option.
When a fix is ready BugPilot can tell people, if you ask: one Jira comment (bugpilot jira-comment --execute, or summarize-results with BUGPILOT_AUTO_JIRA_COMMENT=true), or an email at the commit gate over Microsoft Graph or SMTP. Both are opt-in and preview by default. See docs/notifications.md.
The extension puts the whole workflow in a panel: the issue or a description, the steps and their results, Fix with AI, review and verification, and Advanced Settings for everything above. It uses the same bugpilot CLI. See extension/README.md.
bugpilot-mcp lets an agent drive BugPilot itself by calling tools (docs/mcp_setup.md). A Claude Code skill in skills/bugpilot-investigate/ tells Claude Code when to run the CLI (docs/skill_setup.md).
Contributor setup — editable install, the Python and extension test suites, building the wheel, a standalone executable or the Windows installer — is in docs/development.md. The architecture is described in docs/architecture.md.
External code contributions are not currently accepted. Bug reports and feature requests are welcome through GitHub Issues.
BugPilot is source-available, not open source, under the Business Source License 1.1. The command-line tool, the bugpilot-mcp server, the Claude Code skill, the scripts, the installer tooling and the documentation in this repository are licensed as BugPilot CLI and Tools (LICENSE); the VS Code extension has its own licence file, extension/LICENSE.txt, with the same terms and itself as the Licensed Work.
The licence lets you copy, modify, redistribute and make non-production use of BugPilot. Its Additional Use Grant adds production use for the internal purposes of you or your organization, including commercial software development and use while providing software development services to clients. Offering BugPilot, or a substantially similar product or service based on it, to third parties as a hosted, managed, embedded, redistributed or otherwise competing offering is not part of that grant and needs a separate commercial licence; for one, contact the Licensor through the BugPilot GitHub repository. Each version becomes available under the Apache License 2.0 on its Change Date, or on the fourth anniversary of that version's first public release if that comes first. This is a summary; the licence files are authoritative.
Third-party components keep their own licences: the extension's codicons icon font and its bug icon (the activity bar icon, also drawn on the Marketplace icon) are CC BY 4.0 (extension/THIRD_PARTY_NOTICES.md).
All 2 files in this release have provenance metadata.
ai debugging bug-fixing jira code-context developer-tools claude codex
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
All 2 files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




