AI 编程 4.0 · 优秀 2026-03-23 · X

Claude Code .claude/ 文件夹完全指南

Claude Code .claude/ 文件夹的完整解剖指南:项目级 vs 全局级两个目录、CLAUDE.md(200 行以内,只写项目特有内容)、rules/(路径范围规则模块化)、commands/(自定义斜杠命令,支持嵌入 shell 命令和参数)、skills/(自动触发工作流,与 commands 区别是自动识别触发)、agents/(独立上下文窗口的子 agent,可限制工具和指定模型)、settings.json(allow/deny 权限控制)。推荐:95% 的项目只需要 CLAUDE.md + settings.json + 1-2 个 commands。

打开原文回到归档

Claude Code .claude/ 文件夹完全指南

摘要

Claude Code .claude/ 文件夹的完整解剖指南:项目级 vs 全局级两个目录、CLAUDE.md(200 行以内,只写项目特有内容)、rules/(路径范围规则模块化)、commands/(自定义斜杠命令,支持嵌入 shell 命令和参数)、skills/(自动触发工作流,与 commands 区别是自动识别触发)、agents/(独立上下文窗口的子 agent,可限制工具和指定模型)、settings.json(allow/deny 权限控制)。推荐:95% 的项目只需要 CLAUDE.md + settings.json + 1-2 个 commands。

正文

twitter/thread ┌─────────────────────┬─────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬───────┬──────────┬──────────────────────────────────────────────────────────┐ │ Id │ Author │ Text │ Likes │ Retweets │ Url │ ├─────────────────────┼─────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────┼──────────┼──────────────────────────────────────────────────────────┤ │ 2035341800739877091 │ akshay_pachaar │ https://t.co/SSSIK3BX4z │ 11240 │ 1429 │ https://x.com/akshay_pachaar/status/2035341800739877091 │ ├─────────────────────┼─────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────┼──────────┼──────────────────────────────────────────────────────────┤ │ 2041938642932003093 │ Hari0m_Patidar │ I already knew about the .claude folder and the CLAUDE.md file (and a few other bits of Claude Code setup), but I had no idea how deep it actually goes the rules/, hooks, skills, agents, and the whole settings.json system completely changed how I look at it. │ 1 │ 0 │ https://x.com/Hari0m_Patidar/status/2041938642932003093 │ │ │ │ Your breakdown just leveled up my entire workflow. Thank you for sharing this much detail this is exactly the kind of practical guide I needed as a student grinding AI agents daily. │ │ │ │ │ │ │ Keep sharing that type of knowledge 👏 │ │ │ │ ├─────────────────────┼─────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────┼──────────┼──────────────────────────────────────────────────────────┤ │ 2040764287610970157 │ AnkurPandey │ @akshay_pachaar Brilliant. But needs a bit more update │ 0 │ 0 │ https://x.com/AnkurPandey/status/2040764287610970157 │ │ │ │ - commands │ │ │ │ │ │ │ - plugins │ │ │ │ │ │ │ │ │ │ │ │ │ │ See https://t.co/np7iSVfTdg │ │ │ │ ├─────────────────────┼─────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────┼──────────┼──────────────────────────────────────────────────────────┤ │ 2041210473291645276 │ akshay_pachaar │ @AnkurPandey Commands are deprecated. │ 1 │ 0 │ https://x.com/akshay_pachaar/status/2041210473291645276 │ │ │ │ │ │ │ │ │ │ │ Plugins - yes. │ │ │ │ ├─────────────────────┼─────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────┼──────────┼──────────────────────────────────────────────────────────┤ │ 2040380058846777544 │ CaVivekkhatri │ @akshay_pachaar Think of it like this: │ 0 │ 0 │ https://x.com/CaVivekkhatri/status/2040380058846777544 │ │ │ │ Your boring long reads → turned into something that actually feels like a podcast │ │ │ │ │ │ │ with tone, emotion, and storytelling │ │ │ │ │ │ │ │ │ │ │ │ │ │ Please Vote: │ │ │ │ │ │ │ │ │ │ │ │ │ │ https://t.co/9h4DAzi1E2 │ │ │ │ ├─────────────────────┼─────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────┼──────────┼──────────────────────────────────────────────────────────┤ │ 2040373106116894731 │ rajput_hac4er │ @akshay_pachaar really great one │ 0 │ 0 │ https://x.com/rajput_hac4er/status/2040373106116894731 │ ├─────────────────────┼─────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────┼──────────┼──────────────────────────────────────────────────────────┤ │ 2040275556034584813 │ maikunari │ @akshay_pachaar This is truly helpful, great to get to know the configs at a deeper level like this. │ 0 │ 0 │ https://x.com/maikunari/status/2040275556034584813 │ ├─────────────────────┼─────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────┼──────────┼──────────────────────────────────────────────────────────┤ │ 2040246687210291455 │ samhou1988 │ @akshay_pachaar @grok summary it │ 0 │ 0 │ https://x.com/samhou1988/status/2040246687210291455 │ ├─────────────────────┼─────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────┼──────────┼──────────────────────────────────────────────────────────┤ │ 2040157784243572877 │ Ikoo_Ben │ @akshay_pachaar how can i get this as a pdf please │ 0 │ 0 │ https://x.com/Ikoo_Ben/status/2040157784243572877 │ ├─────────────────────┼─────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────┼──────────┼──────────────────────────────────────────────────────────┤ │ 2039462042248073485 │ Kvng_Dhorllar │ @akshay_pachaar Thank you so much for this article, it was so much helpful. │ 0 │ 0 │ https://x.com/Kvng_Dhorllar/status/2039462042248073485 │ ├─────────────────────┼─────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────┼──────────┼──────────────────────────────────────────────────────────┤ │ 2039188515620266270 │ Mountainv2010 │ @akshay_pachaar Thanks so much for this informative, comprehensive article explaining the crucial .claude folder—it's extremely helpful. │ 0 │ 0 │ https://x.com/Mountainv2010/status/2039188515620266270 │ ├─────────────────────┼─────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────...

*(Content truncated to 15000 characters)*