frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Show HN: Tree-hugger-JS: CSS selectors for JavaScript AST analysis and MCP

4•chw9e•5h ago
I built a library that lets you find code patterns using familiar CSS-like selectors, then connected it to Claude via MCP so AI assistants can understand and refactor codebases.

The Approach

// Find code patterns with intuitive selectors:

const asyncFunctions = tree.findAll('function[async]');

const todoComments = tree.findAll('comment[text="TODO"]');

const reactHooks = tree.hooks(); // Built-in React support

// Chain smart transformations:

tree.transform() .rename('oldFunction', 'newFunction') .removeUnusedImports() .toString();

Key Features

  - CSS-like selectors: function[async], class:has(method), call[text*="fetch"]

  - Semantic aliases: function matches declarations, expressions, arrows, and methods

  - Smart transformations: Rename identifiers, remove unused imports, insert code

  - Built-in queries: functions, classes, imports, React hooks, JSX components

  - TypeScript support: Full parameter extraction with types

  - Scope analysis: Track variable bindings and references

-- MCP --

I built an MCP server that exposes these capabilities to AI assistants. You can tell Claude:

  "Find all functions that use console.log and show me their parameters"

And Claude can:

1. Parse your codebase

2. Use find_all_pattern('function:has(call[text="console.log"])')

3. Extract parameter information with types

4. Give you detailed analysis

Technical Details

  - Built on tree-sitter for correctness and performance

  - 13 MCP tools for comprehensive code analysis

  - Supports JavaScript, TypeScript, JSX, TSX

  - Pattern parser converts CSS selectors to AST predicates

  - Stateful MCP server maintains analysis context

Links:

  - Library: https://github.com/qckfx/tree-hugger-js

  - MCP Server: https://github.com/qckfx/tree-hugger-js-mcp

  - NPM: npm install tree-hugger-js

  - Claude Code: claude mcp add tree-hugger-js-mcp npx tree-hugger-js-mcp

Would love feedback from the community, especially on the MCP.

The Cult of Personality and Its Consequences

https://en.wikipedia.org/wiki/On_the_Cult_of_Personality_and_Its_Consequences
1•handfuloflight•5m ago•0 comments

Ask HN: How did you meet your co-founder?

1•kwar13•7m ago•1 comments

Ocarina of Time Randomizer

https://ootrandomizer.com/
1•nickswalker•17m ago•0 comments

Docs = Product = Marketing

https://jasongg.com/posts/20230302-docs-as-marketing/
1•jasong•17m ago•0 comments

Web4 has begun – ARZY-G, the first token born from usefulness

https://github.com/arzyk/ArzyNet
1•arzykul•19m ago•0 comments

Future of Work with AI Agents

https://futureofwork.saltlab.stanford.edu
1•nnx•20m ago•0 comments

Augmented Vertex Block Descent (AVBD)

https://graphics.cs.utah.edu/research/projects/avbd/
1•bobajeff•20m ago•0 comments

Ask HN: How would you design internet 2.0 to make it personal again?

1•frogperson•22m ago•1 comments

I Tried Browsing the Web Without CSS (2019)

https://css-tricks.com/that-time-i-tried-browsing-the-web-without-css/
1•pabs3•25m ago•2 comments

Nano-vLLM: A lightweight vLLM implementation built from scratch

https://github.com/GeeeekExplorer/nano-vllm
1•platers•28m ago•0 comments

Contextual: Scalable RAG Agents

https://contextual.ai/
2•handfuloflight•40m ago•0 comments

Ask HN: It's "software 3.0" time, why is community knowledge hidden in Discord?

3•consumer451•44m ago•5 comments

Rare Earths and China

https://tphuang.substack.com/p/rare-earth-and-china
1•decimalenough•46m ago•1 comments

PG&E power shutoffs start for parts of Northern California, outages expected

https://www.cbsnews.com/sacramento/news/pge-june-2025-public-safety-power-shutoffs-northern-california/
1•Alupis•1h ago•1 comments

Stealth Flying Wing Emerges at Secretive Chinese Base

https://www.twz.com/air/massive-chinese-stealth-flying-wing-emerges-at-secretive-base
5•Alupis•1h ago•0 comments

New SOTA Web Agent beats even Operator with human intervention

https://www.rtrvr.ai/blog/web-bench-results
2•arjunchint•1h ago•0 comments

Spellbook: Legal AI

https://www.spellbook.legal
1•handfuloflight•1h ago•0 comments

Samsung Embeds IronSource Spyware App on Phones Across WANA

https://smex.org/open-letter-to-samsung-end-forced-israeli-app-installations-in-the-wana-region/
69•the-anarchist•1h ago•24 comments

Commentario: Add comments to your web page or blog

https://comentario.app/en/
1•indigodaddy•1h ago•0 comments

Show HN: Money Keeper – A Small Expense Tracker for iPhone, iPad, and Mac

https://apps.apple.com/us/app/money-keeper-expenses-tracker/id6514279917
1•SmallAppProject•1h ago•0 comments

The Clash Between Technology and Ecology

https://www.noemamag.com/the-clash-between-technology-ecology/
1•Brajeshwar•1h ago•0 comments

Wazuh CJIS Ruleset – Modular Compliance Rules for FBI CJIS Security Policy

https://github.com/TristanGNS/wazuh-cjis-rules
2•BestDev•1h ago•1 comments

Bridging the Tech Divide from Vision to Reality

https://www.tigranmuradyants.com/post/bridging-the-tech-divide-from-vision-to-reality
1•mooreds•1h ago•0 comments

debi: reinstall your VPS to minimal Debian

https://github.com/bohanyang/debi
2•indigodaddy•1h ago•0 comments

Why Trading Edge Alone Won't Make You Profitable

https://www.fractiz.com/trading-performance-ladder/
2•fractiz•1h ago•0 comments

Tabs and Makefile (2015)

https://beebo.org/haycorn/2015-04-20_tabs-and-makefiles.html
1•thunderbong•1h ago•0 comments

Jake Dot Museum

https://jake.museum/
1•mooreds•1h ago•0 comments

Avoiding generative models is the rational and responsible thing to do

https://www.baldurbjarnason.com/2025/followup-on-trusting-your-own-judgement/
1•cratermoon•1h ago•0 comments

Semantic-Segment-Anything

https://replicate.com/cjwbw/semantic-segment-anything
1•handfuloflight•1h ago•0 comments

Culturing, a Life's Work in Progress

https://poems.culturing.net/about/
1•prossercj•1h ago•0 comments