stacklit

作者 glincker已验证

One command gives AI agents instant codebase context. ~250 tokens replaces 50,000+ tokens of exploration. Auto-configures Claude Code, Cursor, Aider.

102
Stars
8
Forks
Go
语言
2026/8/24
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/glincker/stacklit

快速入门

使用 stacklit 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

Stacklit

108,000 lines of code. 4,000 tokens of index.

One command makes any repo AI-agent-ready. No server, no setup.

CI Release npm License

Install and run

npx stacklit init

That is it. Downloads the binary, scans your codebase, generates the index, opens the visual map. One command.

Other install options:

npm install -g stacklit              # install globally, then run: stacklit init
go install github.com/glincker/stacklit/cmd/stacklit@latest

Or grab a binary from GitHub Releases (macOS, Linux, Windows).

CI / GitHub Action

Use glincker/stacklit-action to keep the index fresh automatically. Auto-commit on push, or gate PRs with check mode:

- uses: actions/checkout@v4
- uses: glincker/stacklit-action@v1        # auto-commit (default)
# or: with: { mode: check }               # fail PR if index is stale

Add permissions: contents: write to the job when using auto-commit mode.

Stacklit demo

What happens when you run it

$ stacklit init
[stacklit] found 342 files
[stacklit] parsed 342 files (0 errors)
[stacklit] done in 89ms -- wrote stacklit.json, DEPENDENCIES.md, stacklit.html

Opening visual map...

Three files appear in your project:

FileWhat it isCommit it?
stacklit.jsonCodebase index for AI agentsYes
DEPENDENCIES.mdMermaid dependency diagramYes (renders on GitHub)
stacklit.htmlInteractive visual map (4 views)No (gitignored, regenerates)
git add stacklit.json DEPENDENCIES.md
git commit -m "add stacklit codebase index"

Done. Every AI agent that opens this repo can now read stacklit.json instead of scanning files.

Why

AI coding agents burn most of their context window figuring out where things live. Reading one large file to find a function signature costs thousands of tokens. Five agents on the same repo each rebuild the same mental model from scratch.

Without stacklit: Agent reads 8-12 files. ~400,000 tokens. 45 seconds before writing a line.

With stacklit: Agent reads stacklit.json. ~4,000 tokens. Knows the structure instantly.

Token efficiency (measured on real projects)

ProjectLanguageLines of codeIndex tokens
Express.jsJavaScript21,3463,765
FastAPIPython108,0754,142
GinGo23,8293,361
AxumRust43,99714,371

See examples/ for full outputs.

What is in stacklit.json

{
  "modules": {
    "src/auth": {
      "purpose": "Authentication and session management",
      "files": 8, "lines": 1200,
      "exports": ["AuthProvider", "useSession()", "loginAction()"],
      "depends_on": ["src/db", "src/config"],
      "activity": "high"
    }
  },
  "hints": {
    "add_feature": "Create handler in src/api/, add route in src/index.ts",
    "test_command": "npm test"
  }
}

Modules, dependencies, exports with signatures, type definitions, git activity heatmap, framework detection, and hints for where to add features and how to run tests.

Set up your AI tools

One command (recommended)

stacklit setup

Auto-detects Claude Code, Cursor, and Aider. For each:

  • Injects a compact ~250-token codebase map into the tool's config file
  • Configures MCP server integration
  • Installs a git hook to keep the map fresh on every commit

Or configure a specific tool:

stacklit setup claude   # updates CLAUDE.md + .mcp.json
stacklit setup cursor   # updates .cursorrules + .cursor/mcp.json
stacklit setup aider    # updates .aider.conf.yml

Compact navigation map

stacklit derive         # print to stdout

Generates a ~250-token navigation map that replaces 3,000-8,000 tokens of agent exploration:

myapp | go | 14 modules | 8,420 lines
entry: cmd/api/main.go | test: go test ./...

modules:
  cmd/api/          entrypoint, routes, middleware
  internal/auth/    jwt, session | depends: store, config
  internal/store/   postgres | depended-by: auth, handler

Manual setup

Configure manually instead

Claude Code - add to CLAUDE.md:

Read stacklit.json before exploring files. Use modules to locate code, hints for conventions.

Claude Desktop / Cursor (MCP) - add to MCP config:

{
  "mcpServers": {
    "stacklit": {
      "command": "stacklit",
      "args": ["serve"]
    }
  }
}

MCP server exposes 7 tools: get_overview, get_module, find_module, list_modules, get_dependencies, get_hot_files, get_hints.

Any other agent - stacklit.json is a plain JSON file. Any tool that reads files can use it.

Keep it updated

stacklit init --hook

Installs a git hook that regenerates the index on every commit. Uses Merkle hashing to skip regeneration when only docs or configs changed.

Other ways to keep it fresh:

stacklit generate          # manual regeneration
stacklit generate --quiet  # silent (for scripts/CI)
stacklit diff              # check if the index is stale
GitHub Action for auto-updates
name: Update stacklit index
on:
  push:
    branches: [main]
    paths-ignore: ['stacklit.json', 'DEPENDENCIES.md', '**.md']

jobs:
  stacklit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-go@v5
        with:
          go-version: '1.25'
      - run: go install github.com/glincker/stacklit/cmd/stacklit@latest
      - run: stacklit generate --quiet
      - uses: stefanzweifel/git-auto-commit-action@v5
        with:
          commit_message: "chore: update stacklit index"
          file_pattern: "stacklit.json DEPENDENCIES.md"

Visual map

Stacklit visual map

stacklit view opens the interactive HTML. Four views:

  • Graph -- Force-directed dependency map. Click a node to see exports, types, files.
  • Tree -- Collapsible directory hierarchy with file and line counts.
  • Table -- Sortable module table with search filter.
  • Flow -- Top-down dependency flow from entrypoints to leaves.

11 languages via tree-sitter

LanguageExtracts
Goimports, exports with signatures, struct fields, interface methods
TypeScript/JSimports (ESM, CJS, dynamic), classes, interfaces, type aliases
Pythonimports, classes with methods, type hints, decorators
Rustuse/mod/crate, pub items with generics, trait methods
Javaimports, public classes, method signatures with types
C#using directives, public types, method signatures
Rubyrequire, classes, modules, methods
PHPnamespace use, classes, traits, public methods
Kotlinimports, classes, objects, functions
Swiftimports, structs, classes, protocols
C/C++includes, functions, structs, typedefs

Any other language gets basic support (line count + language detection).

All CLI commands

stacklit init                    # scan, generate, open HTML
stacklit init --hook             # also install git post-commit hook
stacklit init --multi repos.txt  # polyrepo: scan multiple repos
stacklit generate                # regenerate from current source
stacklit view                    # regenerate HTML, open in browser
stacklit diff                    # check if index is stale
stacklit serve                   # start MCP server
stacklit derive                  # print compact nav map (~250 tokens)
stacklit derive --inject claude  # inject map into CLAUDE.md
stacklit export                  # print readable markdown overview
stacklit export -o stacklit.md   # write markdown overview to a file
stacklit setup                   # auto-configure all detected AI tools
stacklit setup claude            # configure Claude Code + MCP
stacklit setup cursor            # configure Cursor + MCP
Configuration (.stacklitrc.json)
{
  "ignore": ["vendor/", "generated/"],
  "max_depth": 3,
  "output": {
    "json": "stacklit.json",
    "mermaid": "DEPENDENCIES.md",
    "html": "stacklit.html"
  }
}

How it compares

ToolApproachTokensCommittableVisual map
StacklitStructured index~250YesYes
RepomixFull dump50k-500kNoNo
code2promptFull dump50k-500kNoNo
Aider repo-mapTree-sitter + PageRank~1kNoNo

Full comparison with 7 tools →

Monorepo support

Auto-detects: pnpm, npm, yarn workspaces, Go workspaces, Turborepo, Nx, Lerna, Cargo workspaces, and convention directories (apps/, packages/, services/).

How does Stacklit compare to Repomix?

Repomix concatenates all files into one prompt (50k-500k tokens). Stacklit parses code structure and generates a ~250-token navigation map. Use Repomix for small repos and one-shot chats. Use Stacklit for daily AI-assisted development on larger codebases. See the full comparison.

FAQ

Does Stacklit read my code? Yes, locally. It parses source files with tree-sitter to extract structure (imports, exports, types). No code is sent anywhere unless you use the optional --summary flag (which calls the Claude API).

What if my language isn't supported? Stacklit falls back to basic support (line count + language detection) for any language not in the tree-sitter list. The module map, dependency graph, and git activity still work.

Does the git hook slow down commits? No. Stacklit uses Merkle hashing to skip regeneration when only docs or configs changed. On a 10k-line repo, regeneration takes ~50ms.

Can I use Stacklit with GitHub Copilot? Yes. Run stacklit derive --inject claude and rename the output to .github/copilot-instructions.md, or just commit stacklit.json and reference it in your Copilot instructions.

Documentation

  • USAGE.md -- full usage guide, command reference, MCP tools, configuration
  • COMPARISON.md -- head-to-head comparison with Repomix, code2prompt, Codebase-Memory
  • SKILL.md -- instructions for AI agents on how to use stacklit.json
  • examples/ -- real stacklit.json outputs from Express.js, FastAPI, Gin, Axum
  • Discussions -- guides, Q&A, feature requests

Contributing

make build   # build binary
make test    # run all tests

Contributions welcome. See open issues or start a discussion.

License

MIT

常见问题

What is stacklit?

stacklit is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by glincker. One command gives AI agents instant codebase context. ~250 tokens replaces 50,000+ tokens of exploration. Auto-configures Claude Code, Cursor, Aider. It has 102 GitHub stars.

Is stacklit safe to use?

Yes. stacklit passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install stacklit?

Clone the repository with "git clone https://github.com/glincker/stacklit" and add it to your Claude Code skills directory (see the Installation section above). stacklit ships a SKILL.md manifest, so compatible agents can discover and load it automatically.

What programming language is stacklit written in?

stacklit is primarily written in Go. It is open-source under glincker on GitHub, so you can review or fork the full source.

Are there alternatives to stacklit?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh stacklit against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情