{
  "markdown": "<div align=\"center\">\n\n<img src=\"assets/brand/banner.png\" alt=\"codeweb — See what your AI edits affect.\" width=\"100%\">\n\n[![CI](https://github.com/GhostlyGawd/codeweb/actions/workflows/ci.yml/badge.svg)](https://github.com/GhostlyGawd/codeweb/actions/workflows/ci.yml)\n[![npm](https://img.shields.io/npm/v/%40ghostlygawd%2Fcodeweb?style=flat-square&color=c6f24e)](https://www.npmjs.com/package/@ghostlygawd/codeweb)\n[![license: MIT](https://img.shields.io/npm/l/%40ghostlygawd%2Fcodeweb?style=flat-square&color=8a8794)](LICENSE)\n\n**Free & MIT-licensed. Runs entirely on your machine — no account, no server, no telemetry. Reads your code; never executes it.**\n\n**[Website](https://ghostlygawd.github.io/codeweb/)**&nbsp;·&nbsp;[Gate every PR](#gate-every-pull-request)&nbsp;·&nbsp;[See it in action](#see-it-in-action)&nbsp;·&nbsp;[Install](#install)&nbsp;·&nbsp;[Use](#use)&nbsp;·&nbsp;[For agents (MCP: Model Context Protocol)](#use-it-as-an-mcp-tool)&nbsp;·&nbsp;[How it works](#how-it-works)&nbsp;·&nbsp;[Free forever](#free-forever-and-where-the-paid-line-sits)&nbsp;·&nbsp;[Changelog](CHANGELOG.md)\n\n[![Try it with npx](https://img.shields.io/badge/Try_it_with_npx-060608?style=for-the-badge&logo=npm&logoColor=c6f24e)](#try-it-on-your-repo)\n[![Open the live demo](https://img.shields.io/badge/Open_the_live_demo-060608?style=for-the-badge&logoColor=c6f24e)](https://ghostlygawd.github.io/codeweb/demo/)\n[![Install the Claude Code plugin](https://img.shields.io/badge/Install_the_Claude_Code_plugin-060608?style=for-the-badge&logoColor=c6f24e)](#install)\n\n</div>\n\n**See what your AI edits affect.**\n\n```bash\nnpx -y @ghostlygawd/codeweb .\n```\n\n<div align=\"center\">\n<a href=\"https://ghostlygawd.github.io/codeweb/downloads.html\"><img src=\"assets/metrics/npm-downloads.svg\" alt=\"Latest seven-day npm download total with a line chart of completed daily downloads for @ghostlygawd/codeweb, generated from the public npm downloads API\" width=\"100%\"></a>\n<br><sub>The large number is the latest seven completed days; the line shows daily downloads. Package downloads are retrievals, not a count of users. Select the chart for the live data and reporting cutoff.</sub>\n</div>\n\n**Structural checks for AI code changes.** codeweb's gate builds\nthe call graph before and after a change, then fails the pull request on three regressions: a new\ndependency cycle, a new body-confirmed duplication, or a symbol that lost every caller.\n\nNo LLM is in the checks. The gate uses zero model tokens for its static analysis.\nA passing check does not prove the program works. Analysis can miss dynamic relationships;\ninspect unresolved results and run the relevant tests. Pure removals pass the structural rules.\n[Put it on your PRs →](#gate-every-pull-request)\n\nThe gate needs a map to compare, and that map is worth reading on its own.\n\ncodeweb reads your code. It maps each function and the calls between functions. It maps\n3,000 symbols in approximately 3 seconds. Static analysis produces the same map from the\nsame code. No LLM is in the mapping loop.\n\nYour coding agents query the map instead of using grep. In measured tests, agents that used grep\nmissed more than half of a function's real callers\n([see the measurements](https://ghostlygawd.github.io/codeweb/research.html)). An incomplete caller\nlist can cause an agent to break code that it did not inspect.\n\n- **Give agents structural data:** The Model Context Protocol (MCP) server provides 28 tools,\n  including `codeweb_impact`, `codeweb_callers`, and `codeweb_find_similar`.\n- **Keep answers small:** Each query returns a bounded structural answer. Your agents can use\n  their remaining context for implementation work.\n- **Inspect the same data:** The interactive report shows the complete codebase map.\n\nThe map also shows relationships that are not visible in one file. These relationships include\n**duplicated logic, dead code, hotspots, and tangled domains**.\n\n<div align=\"center\">\n<a href=\"https://ghostlygawd.github.io/codeweb/research.html\"><img src=\"assets/brand/proof-strip.svg\" alt=\"Measured codeweb results: agents found 74% of real callers with codeweb and 44% with grep at the same context spend; impact answers had 126 times smaller context size than a simulated graph-assisted grep loop; more than 490,000 deterministic comparisons had zero disagreements\" width=\"100%\"></a>\n<br><sub>Measured against fixed tasks and independent oracles. Select the proof strip for the methodology and receipts.</sub>\n</div>\n\n---\n\n## Try it on your repo\n\n```\ncd your-project\nnpx -y @ghostlygawd/codeweb .\n```\n\nFor a repository with 3,000 symbols, the first map takes approximately 3 seconds. Open\n`.codeweb/report.html` to inspect the map.\n\n<div align=\"center\">\n<img src=\"assets/screens/zod-terminal-run.svg\" alt=\"Condensed real terminal run of codeweb 0.12.0 on Zod commit 912f0f5: 1,388 symbols and 1,616 edges from 409 files, followed by 66 actionable findings\" width=\"840\">\n<br><sub>Real run against <a href=\"https://github.com/colinhacks/zod/tree/912f0f51b0ced654d0069741e7160834dca742ee\">Zod at commit <code>912f0f5</code></a>, captured 2026-07-29. The replay shortens the absolute local path to <code>.codeweb</code>; the displayed values are unchanged.</sub>\n</div>\n\n## Gate every pull request\n\nRun the same verdict locally, or as a GitHub Action on every pull request:\n\n```\nnode scripts/ci-gate.mjs --base origin/main --target src   # exit 1 on a structural regression\n```\n\nThe gate builds the graph from the pull request base and from its head, then diffs them. It posts\na sticky structural review comment either way, so reviewers see the blast radius without\ninstalling anything.\n\n**Pin the Action to a release tag**, not a moving branch: a floating ref can change your gate's\nverdict semantics under you. Pin `codeweb-ref` to the same tag so the engine is fixed too. The\nworkflow YAML, the monorepo matrix form, and every input live in\n[`docs/ci-gate.md`](docs/ci-gate.md).\n\nWant the gate hosted — no workflow YAML, cached base graphs, and history across every repo in the\norg? That is [codeweb Teams](https://ghostlygawd.github.io/codeweb/pricing.html), the paid half of\n[the boundary](#free-forever-and-where-the-paid-line-sits). Running it yourself stays free forever.\n\n## See it in action\n\nEach screenshot below shows a generated report for **axios** (278 symbols, 7 domains).\nThe screenshots are not mockups.\n\ncodeweb found 3 real duplications in axios and rejected 12 false positives. Read\n[the case study](docs/case-study-axios.md), or\n[inspect the live map](https://ghostlygawd.github.io/codeweb/demo/).\n\n### Know what an edit breaks — before you write\n\nSelect a function in the [live map](https://ghostlygawd.github.io/codeweb/). The map highlights\nthe function's **blast radius** and shows the symbols that the change can affect.\n\nYour agents can get the same answer from the `codeweb_impact` MCP tool before they edit the code.\n\n<div align=\"center\">\n<img src=\"assets/screens/axios-blast-radius.png\" alt=\"codeweb blast radius: AxiosError selected in the axios graph — the selected block wears the accent with a viewfinder frame, blast edges lit across three domains, 27 callers listed in the inspector\" width=\"760\">\n<br><sub>Selecting <code>AxiosError</code> in axios lights up its <b>31 callers across the domains that depend on it</b> — try it yourself in the <a href=\"https://ghostlygawd.github.io/codeweb/\">living map</a>.</sub>\n</div>\n\n### Navigate the whole system\n\nThe force-directed map shows every symbol. You can collapse symbols into domains. Search, drag,\nzoom, or select a node to trace its callers and dependencies.\n\n<img src=\"assets/screens/axios-graph.png\" alt=\"codeweb Graph tab on axios: eight domain blocks (helpers, core, adapters, cancel, defaults, platform) sized by symbol count and linked by stippled call edges\" width=\"100%\">\n\n### Findings — stop guessing what to refactor\n\nThe Findings tab ranks **duplication**, highly connected **hotspots**, and likely **dead code**.\nSelect a row to inspect the symbol's callers and dependencies.\n\n<img src=\"assets/screens/axios-findings.png\" alt=\"codeweb Findings tab on axios: ranked duplication, hotspots, and likely-dead code, with a clickable detail panel\" width=\"100%\">\n\n### See duplication density, and where domains tangle\n\n<table>\n<tr>\n<td width=\"50%\" valign=\"top\">\n<img src=\"assets/screens/axios-treemap.png\" alt=\"codeweb Treemap on axios: every file sized by lines of code, duplication density carried by a dark-to-lime lightness ramp\">\n<br><b>Treemap</b> — The size of each block shows the file's lines of code. A brighter block\ncontains more duplicated code. Use the bright blocks to identify possible consolidation targets.\n</td>\n<td width=\"50%\" valign=\"top\">\n<img src=\"assets/screens/axios-matrix.png\" alt=\"codeweb Matrix on axios: a heatmap of call coupling between domains\">\n<br><b>Matrix</b> — The matrix shows coupling between domains. A large off-diagonal cell shows\nstrong coupling. You can merge the domains or add a clear interface between them.\n</td>\n</tr>\n</table>\n\n<div align=\"center\">\n<img src=\"assets/brand/demo.svg\" alt=\"The codeweb pipeline: extract → cluster → overlap → render, looping\" width=\"840\">\n<br><sub>The deterministic pipeline, looping: extract → cluster → overlap → render.</sub>\n</div>\n\n---\n\ncodeweb works at **symbol resolution**. It maps functions, classes, methods, and the call and\nimport edges between them. A file-level scanner can show that two modules are similar. codeweb\ncan show that two functions do the same work, identify their callers, and calculate the effect of\na merge.\n\n## Benchmarks\n\n- **Find callers before an edit:** In the v0.9.0 efficiency pilot, agents found **74%** of a\n  function's real callers with codeweb and **44%** with grep at the same context spend. A missed\n  caller can cause an edit to break working code.\n- **Calculate the effect of a change:** One codeweb call returned one small answer. A simulated\n  graph-assisted grep loop used **126 times the context size** in the recorded comparison.\n  This measures context-size differences, not total agent-session token savings.\n- **Detect duplicate code:** codeweb found **every planted duplicate with zero false alarms**,\n  including renamed copies. Text search found 0% of the renamed copies.\n- **Check deterministic results:** Tests compared codeweb with the TypeScript compiler and other\n  independent implementations more than **490,000 times, with zero disagreements**.\n- **Map and query quickly:** The first map takes approximately **3 seconds** for a repository with\n  3,000 symbols. Queries take approximately **0.1 seconds**. A repository with twice as many\n  symbols takes approximately 1.3 times as long to map.\n- **Understand the limits:** A new map after a very large edit can take more time. Agents also\n  completed simple tasks successfully without codeweb.\n\nMethodology, raw data, and per-claim receipts:\n[the evidence ledger](https://ghostlygawd.github.io/codeweb/research.html). Benchmark your own\nrepo: `npm run bench -- <path>/.codeweb/graph.json`. CI re-runs the performance budgets on\nevery PR; breaking a published number fails the build.\n\ncodeweb also keeps a local activity tally. Run `npm run stats` to see it:\n\n```\ncodeweb this month: 41 pre-edit card(s) · 5 card-named caller(s) followed · 2 regression(s) flagged · 120 queries served\n```\n\nTo evaluate a dependency, point codeweb at a repository that you do not own:\n`/codeweb https://github.com/owner/repo`. codeweb makes a read-only clone, maps the clone, and\nadds an adoption review. codeweb does not execute the target code.\n\n## Install\n\n**Free & MIT-licensed. Runs entirely on your machine — no account, no server, no telemetry. Reads\nyour code; never executes it.**\n\n- codeweb requires **Node.js ≥ 22**.\n- codeweb has zero required dependencies. CI verifies operation with an empty `node_modules`\n  directory.\n- The optional `web-tree-sitter` wasm grammar improves extraction. codeweb does not require it.\n- CI publishes releases with **npm provenance**. Run `npm audit signatures` to verify a release.\n\n**Using Claude Code?** Install the plugin to add the `/codeweb` command, automatic pre-edit\nimpact cards, and all 28 tools:\n```\n/plugin marketplace add GhostlyGawd/codeweb\n/plugin install codeweb\n```\nRestart Claude Code to register the `/codeweb` command, agents, and skill.\n\n**Choose your MCP client:** [The setup page](https://ghostlygawd.github.io/codeweb/start.html#other-clients)\nprovides one recipe for Claude Code, Cursor, Windsurf, Gemini CLI, or Codex. Print a recipe\nand check local setup from your project:\n\n```bash\nnpx -y @ghostlygawd/codeweb setup --client cursor\nnpx -y @ghostlygawd/codeweb doctor\n```\n\nSetup prints configuration without replacing files. Doctor checks the local server and graph;\na successful local check does not prove an editor connection. Restart your client, ask your\nagents to run `codeweb_callers`, and check a returned source location.\n\n**Map a repository without an AI agent:** Run one command from your project directory:\n```\ncd your-project\nnpx -y @ghostlygawd/codeweb .    # ~3 s for 3,000 symbols — then open .codeweb/report.html\n```\n\nFor a temporary evaluation, use the `npx` command. It creates the map without a permanent\ninstallation.\n\n**Run the engine from a clone:**\n```\ngit clone https://github.com/GhostlyGawd/codeweb.git\nnode codeweb/scripts/run.mjs /path/to/your/project\n```\n\n[`docs/cli.md`](docs/cli.md) lists each executable, flag, and exit code.\n\n**VS Code:** [`editor/vscode-codeweb`](editor/vscode-codeweb/) shows an\n**`N callers · blast M`** lens above each mapped symbol. Select the lens to open the report.\n\n## What you can do\n\nEach link lands on full docs, flags, and examples in **[the reference](docs/reference.md)**.\n\n- **Know before you edit:** Find callers, calculate the effect of a change, and check for an\n  existing implementation.\n  → [Query the graph](docs/reference.md#query-the-graph-for-agents--humans) ·\n  [context & pre-flight](docs/reference.md#agent-tools--context--pre-flight-context-pack-simulate-edit)\n- **Gate every edit:** Get a structural regression result for an edit, pull request, or\n  architecture rule.\n  → [The `diff` verdict](docs/reference.md#guard-agent-edits-diff) ·\n  [the PR gate](docs/reference.md#gate-every-pr-github-action) ·\n  [the capability suite](docs/reference.md#agent-capability-suite-write--review--optimize)\n- **Clean up, ranked:** Rank consolidation and dead-code work by evidence.\n  → [`optimize`](docs/reference.md#advise-consolidations-optimizemjs) ·\n  [`hotspots`](docs/reference.md#find-the-hotspots--where-to-refactor-first-hotspotsmjs) ·\n  [`campaign`](docs/reference.md#plan-a-whole-optimization-campaign-campaignmjs) ·\n  [`trend`](docs/reference.md#track-duplication-over-time-trendmjs)\n\n## Use\n\n```\n/codeweb                                  # map the current project\n/codeweb src/payments --depth symbol      # deep-dive one subsystem\n/codeweb https://github.com/owner/repo    # external review before adopting\n/codeweb owner/repo --open                # clone, map, and open the report\n```\n\nAvailable flags include `--depth module|symbol|auto`, `--engine hybrid|read|tools`,\n`--focus <glob>`, `--mode internal|external`, and `--open`. See `commands/codeweb.md` for details.\n\ncodeweb writes all outputs to `<target>/.codeweb/`. Agents and other tools can read `graph.json`.\nYou can open `report.html`. codeweb also creates Markdown versions.\n[See the description of each output file.](docs/reference.md#outputs-under-targetcodeweb)\n\n## Use it as an MCP tool\n\n`scripts/mcp-server.mjs` is a zero-dependency Model Context Protocol (MCP) stdio server. It gives\neach MCP client access to all **28 tools**. The tools help the client orient, read the structure,\ncheck before writing, gate an edit, and plan cleanup.\n\n**The plugin registers the server automatically.** To register the standalone server, run:\n\n```\nclaude mcp add codeweb -- npx -y -p @ghostlygawd/codeweb codeweb-mcp\n```\n\nThe loop an agent runs: `codeweb_brief` once per session (or `codeweb_find` when no symbol name\nis known) → `codeweb_explain` before touching a symbol → `codeweb_context`, `codeweb_impact`, or\n`codeweb_dependents` before the edit → `codeweb_refresh` with `snapshot:true`, then `codeweb_diff`\nafter it. Clients that hide the server's built-in instructions can paste\n[the rules snippet](https://ghostlygawd.github.io/codeweb/start.html#rules-snippet) instead.\n\nThe server includes these agent-specific features:\n\n- **Optional `graph` argument:** The server finds the nearest map when you omit `graph`. If no map\n  exists, the error directs the agent to `codeweb_map`.\n- **Budgeted responses:** Responses include the highest-ranked items and the true totals. A context\n  response that was approximately 300 KB is now approximately 10 KB.\n- **Staleness information:** A stale result identifies its state and directs the agent to\n  `codeweb_refresh` — on the orient tools and on every spawned advisor answer.\n\n[All 28 tools, grouped and explained →](docs/reference.md#the-mcp-server-tool-by-tool)\n\n## How it works\n\nFor JavaScript, TypeScript, Python, Rust, Go, Java, C#, Ruby, PHP, Kotlin, Swift, C, and C++,\ncodeweb uses a **deterministic Node pipeline** by default. One command creates the map. No LLM is\nin the pipeline, and the same input produces the same bytes.\n\nThe map pipeline has the four stages in the following diagram. `scripts/run.mjs` also creates\n`optimize.md` after overlap analysis and before report rendering.\n\n<div align=\"center\">\n<img src=\"assets/brand/pipeline.svg\" alt=\"codeweb's four deterministic stages: extract, cluster, overlap, render\" width=\"100%\">\n</div>\n\n1. **Extract** (`extract-symbols.mjs`) parses each source file into atomic nodes such as functions,\n   classes, and methods. It also records call and import edges. If a bare call can refer to more\n   than one definition, codeweb omits the edge instead of guessing. Per-file caching makes\n   extraction incremental and byte-identical to a full rebuild. An imported `.json` file enters\n   the map as a file-level node without being parsed. An unreferenced `.json` file stays out of the\n   map, which prevents lock-file noise.\n2. **Cluster** (`cluster3.mjs`) removes genuine utility hubs and groups the remaining nodes into\n   directory-anchored semantic domains.\n3. **Overlap** (`overlap.mjs`) detects duplicated logic and parallel implementations. It compares\n   each candidate with the actual function bodies by using token-shingle similarity. This check\n   prevents name coincidences from becoming findings. A structural pass over\n   identifier-normalized *skeletons* also finds renamed Type-2 clones\n   (`find-similar --structural`).\n4. **Render** (`build-report.mjs`) converts `graph.json` into the self-contained `report.html` and\n   `report.md` files.\n\nFor a language that the extractor cannot parse, codeweb **uses the agent path**.\n`codeweb-dissector` agents extract nodes and edges for each subsystem. `codeweb-domain-mapper`\nthen assigns domains and overlaps.\n\nBoth paths produce the same `graph.json` schema. In **external** mode, each path also adds an\nadoption verdict.\n\n**Versus a language server (LSP):** an LSP answers one hop on demand — definitions, direct\nreferences — inside an editor session. codeweb builds one deterministic whole-graph artifact:\ntransitive impact, duplication with body evidence, dead code, and domain coupling.\n\nAgents query that artifact over MCP, and CI diffs it to gate a PR. The two compose — codeweb\nreplaces the grep loop, not your language server.\n\nCurious how the repo is laid out? [The component map lives in the\nreference.](docs/reference.md#components)\n\n## Roadmap\n\n- **Support more first-class languages:** codeweb currently supports thirteen native languages:\n  JavaScript, TypeScript, Python, **Rust**, **Go**, **Java**, **C#**, **Ruby**, **PHP**, **Kotlin**,\n  **Swift**, **C**, and **C++**. Other languages use the agent fallback. Dynamic-dispatch AST tiers\n  cover JS/TS, Java, C#, Python, Go, Rust, **Ruby**, **PHP**, **C**, and **C++**. Kotlin and Swift\n  dispatch requires a trusted wasm grammar at the pinned ABI. See `scripts/grammars/PROVENANCE.md`.\n\n_Recent releases added the agent-intelligence suite (**hotspots**, **campaign**,\n**reading-order**, Type-2 clone detection, and suppression memory), a\n**[live interactive demo](https://ghostlygawd.github.io/codeweb/demo/)**, Go and Rust on the fast\npath, duplication trend data, and the one-command CI regression gate with a GitHub Action.\ncodeweb currently provides 28 tools._\n\n## Versioning & releases\n\ncodeweb follows [Semantic Versioning](https://semver.org/). It records changes in\n[`CHANGELOG.md`](CHANGELOG.md), which uses the\n[Keep a Changelog](https://keepachangelog.com/) format. Each capability, benchmark, and fix ships\nin a **tagged GitHub release**.\n\n`package.json` is the source of truth for the version.\n`scripts/mcp-server.mjs` is the source of truth for the MCP tool count. The release tools derive\nand verify the other values:\n\n```bash\nnpm run version-sync        # propagate version + tool count -> plugin.json, SKILL.md, README badge\nnpm run check-consistency   # fail if any public-facing surface has drifted\nnpm run build:site          # regenerate the docs/ website (zero-dependency, deterministic)\nnpm run release -- --minor  # roll the changelog, bump, sync, rebuild; prints the git/tag steps\n```\n\n`check-consistency` runs in CI. It gates version strings on every surface, every prose mention of\nthe tool and language counts, the CHANGELOG entry for the current version, and every evidence\nfile the ledger cites.\n\n## About\n\nBuilt by [GhostlyGawd](https://github.com/GhostlyGawd). AI agents helped write much of the code.\nThe commit co-author trailers identify those contributions. Open an issue for questions or\nproblems. Use [`SECURITY.md`](SECURITY.md) to report a security issue.\n\n**Stay current:** codeweb does not contact an update service. To receive release notifications,\nselect **Watch → Custom → Releases** on GitHub.\n\n## Free forever, and where the paid line sits\n\nThe rule, ratified in [`CHARTER.md`](CHARTER.md): **anything that runs on one laptop against one\nrepo is free forever; money buys hosting, multi-repo aggregation, and human attention.**\n\nEverything in this repository is that free half — the map, the MCP tools, the hooks, the report,\nthe CLI, the self-hosted gate Action, and every language codeweb learns. MIT, no accounts, no\ntelemetry, no license keys. Nothing here moves behind a payment later.\n\nThe paid half is a separate hosted service, **codeweb Teams**: the gate run for you, and history\nheld across every repo in an org. Billing lives only in that service, so a payment problem\ndegrades the hosted tier and **never breaks** your local tooling or your CI.\n\nRead the full contract on\n[the boundary page](https://ghostlygawd.github.io/codeweb/boundary.html), and the planned Teams\nprice on [the pricing page](https://ghostlygawd.github.io/codeweb/pricing.html).\n\n## Support the project\n\n[Sponsoring](https://github.com/sponsors/GhostlyGawd) supports the project. Sponsorship also\nprovides advertising. Top sponsors can put their logo at the top of this README, and each sponsor\ncan join the supporters list. See the\n[support page](https://ghostlygawd.github.io/codeweb/support.html) for details.\n\nRunning codeweb at an organization and need help? Send email through the GitHub profile.\n\n## Handoffs\n\nYou can send codeweb outputs to `refactor-cleaner`, `codebase-onboarding`, or `code-tour` if you\nhave those tools. codeweb does not require them.\n\nFor a useful next step, apply the highest-ranked **ready** merge from `optimize.md`. Then run\ncodeweb again and compare the findings count.\n",
  "bytes": 23690,
  "sha": "9624d49acde056e55b0210664abfae3ce32d9dff6c595084380a080701c8a7ce",
  "repo_slug": "ghostlygawd/codeweb",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_ghostlygawd_codeweb_5af02143/readme"
}