Skip to content
EhsanAzish80Public

About

X-ray machine for any repository

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Devscope

Give coding agents local Git-history context.

A local CLI and GitHub Action that help you focus a code review, understand an unfamiliar repository, and share readable reports with your team.

CI PyPI License: MIT

The result, honestly

We tried to beat “review the biggest file first” with Git history across 44 repositories. We could not. In the preregistered final test, Devscope v2 differed from size-only file-level Recall@3 by +0.003 on held-out repositories, with a 95% confidence interval of -0.037 to +0.051. Co-change history also did not predict fewer later fixes when the usual partner was included.

Devscope therefore makes no predictive risk claim. Devscope is a free, open-source way to give coding agents inspectable facts: traced fix history, recent owners, files that often changed together and import blast radius. Read the result or inspect the methodology and raw paired data.

pipx install devscope==0.4.1
devscope demo

The demo needs no repository or Git. Its sample paths, history and coverage are clearly labelled synthetic. Python 3.11+ is required; Git is needed for real PR reviews. Already installed? Run pipx upgrade devscope.

Choose your starting point

I want to… Start here What you get
Understand a repository Explore a repository Modules, entry-point candidates, test locations and declared commands
Focus a code review Review a PR Changed files with configured findings and optional coverage evidence
Give an AI coding agent local history Connect an MCP client Five read-only tools for changes, co-change facts, fix history, owners and blast radius
Share results with reviewers Add to GitHub Actions An updated PR comment and downloadable HTML/JSON/Markdown reports

Explore a repository

Run from its root:

devscope onboard .

Prefer a broader inventory? devscope scan . shows size, languages and repository health signals. Onboarding displays declared commands as data; it never runs them.

Review a PR

Fetch the target branch, then review your committed changes:

git fetch origin main
devscope review . --base origin/main

Replace origin/main with your PR's target branch. Full Git history is required; for a shallow clone, fetch it with git fetch --unshallow. Uncommitted changes are excluded from PR reviews.

Export an offline report, or try the sample first:

devscope review . --base origin/main --format html --output review.html
devscope demo --format html --output demo.html

Open the HTML file in your browser. It includes search, evidence and complete report data, with no external scripts or fonts.

Download the standalone sample HTML · View its structured data

Connect an MCP client

Install a project-local MCP entry for Claude Code, Cursor or Codex:

devscope mcp install --client claude-code --path .
# or: cursor, codex
# without a persistent install: add --command uvx

The installer preserves existing configuration and refuses to replace an existing devscope entry. The server exposes five read-only tools: review_changes, cochange, fix_history, owners and blast_radius. It reads local Git history without running repository code or using the network. A cold history index builds in the background; retry the tool when it returns index_building. Co-change output is historical context, not a warning or prediction. Codex reads .codex/config.toml only after the project is trusted.

For a lightweight pre-commit or agent hook, check all working-tree files without blocking by default:

devscope check . --working-tree --format claude-stop

The hook is opt-in, advisory and fail-open. Its neutral message says that two files often changed together and asks the agent to check whether that history is relevant.

Add to GitHub Actions

Save this as .github/workflows/devscope.yml. This starts with advisory review; new-warning gates are opt-in.

name: Devscope review
on: pull_request
permissions:
  contents: read
  pull-requests: write
jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.sha }}
          fetch-depth: 0
      - uses: EhsanAzish80/devscope-action@v1.4.0
        with:
          review: 'true'
          devscope-version: '0.4.1'

The Action updates one bot comment and uploads HTML, JSON and Markdown artifacts. Fork PRs with read-only tokens still receive the job summary and artifacts; their comment is skipped. For summary-only reporting, use the read-only CLI workflow.

Actual Devscope bot comment from the Action's integration PR

View the actual PR comment · Full Action inputs and examples

What the evidence means

  • Size, churn and co-change suggest where to look; they do not predict defects.
  • Coverage comes from supplied LCOV/Cobertura reports for the asserted PR head. Unmapped lines stay unknown. Test-file counts are not coverage.
  • New-warning gates distinguish existing, accepted and new findings. Target-branch configuration and baselines prevent a PR from weakening its own gate.
  • Local CLI reports do not upload source code or execute repository commands. The GitHub Action publishes report metadata to your GitHub job and optional comment.

Go further

Configuration and monorepos · Baselines and gates · Coverage import · All commands · Changelog

Without pipx, use a virtual environment: python3 -m venv .venv, activate it, then python -m pip install devscope==0.4.1. On macOS/Linux activation is source .venv/bin/activate; on Windows PowerShell use .venv\Scripts\Activate.ps1.

For development: uv sync --all-extras, uv run pytest, uv run ruff check src/devscope tests and uv run mypy src/devscope. See CONTRIBUTING.md.

MIT licensed. See LICENSE.

About

X-ray machine for any repository

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages