{
  "$schema_doc": "https://gtmstacker.com/registry/schema/entry.schema.json",
  "stability": "emerging",
  "generator": "agentic-media-registry",
  "generated_at": "2026-09-25T00:00:00Z",
  "id": "com.gtmstacker.registry/tool/ctxfw",
  "type": "tool",
  "slug": "ctxfw",
  "canonical_url": "https://gtmstacker.com/registry/tool/ctxfw/",
  "title": "Ctxfw",
  "description": "Ctxfw is an Apache-2.0, in-memory Tree-Sitter AST 'context firewall' — an MCP server that prunes what a coding agent sends to the model, trimming the code context down before it costs tokens. It is on PyPI and self-hostable. It is nascent (2 stars). Its headline '-72.4% token mass' figure is a self-reported, unbenchmarked project claim, not a measured result.",
  "category": "ai-infrastructure",
  "tags": [
    "ai-infrastructure",
    "self-hostable",
    "mcp",
    "tree-sitter",
    "token-pruning",
    "cost-control"
  ],
  "status": "active",
  "revision": 1,
  "content_hash": "a1d5d8ce0fbc5c07e065b78b3c3e6dd6307cf8dd7a41bf366271df479da4f477",
  "date_published": "2026-09-25T00:00:00Z",
  "date_modified": "2026-09-25T00:00:00Z",
  "source": {
    "name": "heuristicolab · GitHub",
    "url": "https://github.com/heuristicolab/ctxfw"
  },
  "license": "Apache-2.0",
  "one_liner": "Ctxfw is an in-memory Tree-Sitter AST 'context firewall' MCP server that prunes the code a coding agent sends to the model.",
  "open_source": "yes",
  "self_hostable": "yes",
  "pricing_model": "free",
  "who_its_for": "A team running coding agents at volume that wants to cut token spend by pruning the code context an agent ships to the model — installing an AST-aware MCP server between the agent and the LLM — and is comfortable measuring the actual savings on its own codebase.",
  "aliases": [
    "ctxfw",
    "heuristicolab/ctxfw"
  ],
  "alternatives": [],
  "secondary_categories": [],
  "last_verified": "2026-09-25",
  "evidence": {
    "claim_type": "mixed",
    "source_id": "https://github.com/heuristicolab/ctxfw",
    "note": "Apache-2.0 (OSI-open); 2 stars, created 2026-09-11, last push 2026-09-25; on PyPI; an in-memory Tree-Sitter AST 'context firewall' / pruning MCP server that trims what a coding agent sends to the model; self-hostable (WebFetch 2026-09-25, github.com/heuristicolab/ctxfw). The '-72.4% token mass' figure is a self-reported, unbenchmarked project claim, not a measured result. Nascent at 2 stars."
  },
  "caveats": "The headline '-72.4% token mass' reduction is self-reported and unbenchmarked — treat it as the project's claim, never as a measured result; token savings depend entirely on your codebase and agent. It is nascent at 2 stars and recently created (2026-09-11). Measure the actual reduction and any quality loss from pruning on your own workload before relying on it.",
  "lead": "Ctxfw is an Apache-2.0, in-memory Tree-Sitter AST \"context firewall\" — an MCP server that prunes what a coding agent sends to the model, trimming the code context down before it costs tokens. It is on PyPI and self-hostable. It is nascent (2 stars). Its headline \"-72.4% token mass\" figure is…",
  "chunks": [
    {
      "index": 0,
      "heading_path": [],
      "est_tokens": 91,
      "text": "Ctxfw is an Apache-2.0, in-memory Tree-Sitter AST \"context firewall\" — an MCP server that prunes what a coding agent sends to the model, trimming the code context down before it costs tokens. It is on PyPI and self-hostable. It is nascent (2 stars). Its headline \"-72.4% token mass\" figure is a self-reported, unbenchmarked project claim, not a measured result."
    },
    {
      "index": 1,
      "heading_path": [
        null,
        "Provenance"
      ],
      "est_tokens": 218,
      "text": "— an MCP server that prunes what a coding agent sends to the model, trimming the code context down before it costs tokens. It is on PyPI and self-hostable. It is nascent (2 stars). Its headline \"-72.4% token mass\" figure is a self-reported, unbenchmarked project claim, not a measured result.\n\n- Apache-2.0 (OSI-open); 2 stars, created 2026-09-11, last push 2026-09-25; on PyPI; an in-memory Tree-Sitter AST \"context firewall\" / pruning MCP server that trims what a coding agent sends to the model; self-hostable (WebFetch 2026-09-25).\n- Surfaced via studio discovery in the 2026-09-25 pass.\n- Anti-hype note: the \"-72.4% token mass\" figure is a self-reported, unbenchmarked project claim — tagged as a claim, never stated as measured. Nascent at 2 stars.\n- Curated from the GTM Stacker signal registry (2026-09-25 pass); license/facts independently verified 2026-09-25."
    },
    {
      "index": 2,
      "heading_path": [
        null,
        "Why it matters for a GTM stack"
      ],
      "est_tokens": 280,
      "text": "- Surfaced via studio discovery in the 2026-09-25 pass. - Anti-hype note: the \"-72.4% token mass\" figure is a self-reported, unbenchmarked project claim — tagged as a claim, never stated as measured. Nascent at 2 stars. - Curated from the GTM Stacker signal registry (2026-09-25 pass); license/facts independently verified 2026-09-25.\n\nThe cost of running coding agents at volume is dominated by how much context each call ships to the model. Ctxfw sits in that path as an MCP server that parses code with Tree-Sitter and prunes the AST before it is sent — a \"context firewall\" whose whole job is to reduce what the model has to read. For a team building agent-driven tooling where LLM spend is a line item, that cost-control layer is the interesting angle: you own it, run it in-memory, and pip-install it from PyPI. The honest read: the project's \"-72.4% token mass\" number is self-reported and unbenchmarked, so do not price a business case on it — and at 2 stars it is early. Adopt it as a candidate cost-control layer, but measure the real reduction, and any answer-quality loss from pruning, on your own codebase."
    }
  ],
  "alternates": {
    "markdown": "https://gtmstacker.com/registry/tool/ctxfw/index.md",
    "html": "https://gtmstacker.com/registry/tool/ctxfw/",
    "json": "https://gtmstacker.com/registry/tool/ctxfw/index.json",
    "server_json": "https://gtmstacker.com/registry/tool/ctxfw/server.json"
  },
  "jsonld": {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "WebSite",
        "@id": "https://gtmstacker.com/#website",
        "url": "https://gtmstacker.com/",
        "name": "GTM Stacker Agent Registry",
        "description": "A daily-updated, agent-native registry of open-source tool discoveries, tool updates, and curated news for the go-to-market / RevOps engineering niche. Machine-readable first: agents can discover, parse, page, and delta-sync it without scraping HTML.",
        "inLanguage": "en",
        "publisher": {
          "@id": "https://gtmstacker.com/#organization"
        }
      },
      {
        "@type": "Organization",
        "@id": "https://gtmstacker.com/#organization",
        "name": "GTM Stacker",
        "url": "https://gtmstacker.com",
        "description": "The growth-systems practice of Theo Popov: AI-native enrichment, outbound, content engines and internal tooling for startups and venture programs. Its agent-native media property, the GTM Stacker Agent Registry, maintains a daily-updated catalog of open-source go-to-market and RevOps tools that both people and AI engines can discover, compare, and cite.",
        "foundingDate": "2024-08",
        "knowsAbout": [
          "go-to-market engineering",
          "RevOps",
          "sales automation",
          "marketing operations",
          "open-source software",
          "AI agents"
        ],
        "founder": {
          "@type": "Person",
          "@id": "https://gtmstacker.com/#founder",
          "name": "Theo Popov",
          "jobTitle": "Growth Operations & GTM Systems",
          "url": "https://gtmstacker.com/about/",
          "sameAs": [
            "https://www.linkedin.com/in/theo-popov",
            "https://x.com/Theo_Popov",
            "https://github.com/theopopov"
          ],
          "worksFor": {
            "@id": "https://gtmstacker.com/#organization"
          }
        },
        "sameAs": [
          "https://www.linkedin.com/company/gtmstacker",
          "https://www.youtube.com/@gtmstacker",
          "https://www.instagram.com/gtmstacker/",
          "https://www.tiktok.com/@gtmstacker"
        ],
        "mainEntityOfPage": "https://gtmstacker.com/registry/about/"
      },
      {
        "@type": "SoftwareApplication",
        "@id": "https://gtmstacker.com/registry/tool/ctxfw/#software",
        "name": "Ctxfw",
        "identifier": "heuristicolab/ctxfw",
        "description": "Ctxfw is an Apache-2.0, in-memory Tree-Sitter AST 'context firewall' — an MCP server that prunes what a coding agent sends to the model, trimming the code context down before it costs tokens. It is on PyPI and self-hostable. It is nascent (2 stars). Its headline '-72.4% token mass' figure is a self-reported, unbenchmarked project claim, not a measured result.",
        "applicationCategory": "DeveloperApplication",
        "url": "https://gtmstacker.com/registry/tool/ctxfw/",
        "datePublished": "2026-09-25T00:00:00Z",
        "dateModified": "2026-09-25T00:00:00Z",
        "isPartOf": {
          "@id": "https://gtmstacker.com/#website"
        },
        "license": "https://spdx.org/licenses/Apache-2.0.html",
        "codeRepository": "https://github.com/heuristicolab/ctxfw",
        "keywords": "ai-infrastructure, self-hostable, mcp, tree-sitter, token-pruning, cost-control",
        "author": {
          "@type": "Organization",
          "name": "heuristicolab",
          "url": "https://github.com/heuristicolab",
          "sameAs": [
            "https://github.com/heuristicolab/ctxfw"
          ]
        },
        "offers": {
          "@type": "Offer",
          "price": 0,
          "priceCurrency": "USD"
        }
      },
      {
        "@type": "BreadcrumbList",
        "@id": "https://gtmstacker.com/registry/tool/ctxfw/#breadcrumb",
        "itemListElement": [
          {
            "@type": "ListItem",
            "position": 1,
            "name": "GTM Stacker Registry",
            "item": "https://gtmstacker.com/registry/"
          },
          {
            "@type": "ListItem",
            "position": 2,
            "name": "AI Infrastructure",
            "item": "https://gtmstacker.com/registry/category/ai-infrastructure/"
          },
          {
            "@type": "ListItem",
            "position": 3,
            "name": "Ctxfw",
            "item": "https://gtmstacker.com/registry/tool/ctxfw/"
          }
        ]
      }
    ]
  },
  "tool": {
    "name": "heuristicolab/ctxfw",
    "repository": {
      "url": "https://github.com/heuristicolab/ctxfw",
      "source": "github"
    }
  }
}
