Claude Code is All You Need

或许你只用Claude Code来写代码,而Anthropic内部正把Claude Code用成了全能的「瑞士军刀」。

Anthropic的技术人员Thariq (@trq212)最近分享了一个有趣的发现:公司里很多人根本不把Claude Code当编程工具用,而是当成了万能助手。

并称:

Claude Code is All You Need

他自己也「叛变」了:

现在我几乎所有工作都用Claude Code来帮忙完成。

一切皆文件

Claude Code的核心理念很简单:Everything is a File(一切皆文件)。

它能像你一样使用电脑,只要你把文件命名得当,Claude Code就能像你一样搜索和管理它们。

这让你可以为记忆、待办事项、日志、截图等各种内容创建自定义设置。

技术宅的文件系统

Thariq在Mac OSX上运行Claude Code,直接放在home目录(~)下。

他创建了一个claude.md[1]文件,告诉Claude如何访问重要目录:

文件夹结构包括:

  • ~/Desktop:截图和视频参考
  • ~/memes:表情包收藏(用于头脑风暴)
  • ~/Repos:主要编程项目
  • ~/memories:重要信息记忆(markdown格式)
  • ~/journal:个人日志(markdown格式)
  • ~/ideas:创意和想法
  • ~/todos:待办事项
  • ~/projects:活跃项目

日志和待办事项的智能管理

Thariq创建了几个自定义命令:

/journal命令会为当天创建新的日志条目。

/todos命令让他能创建新待办事项或标记已完成。待办事项按主题组织在文件中,比如「claudecode.todos.md」。

最妙的是,Claude在添加待办事项时会自动搜索代码、项目等内容来获取更多上下文,这简直太贴心了。

本地HTML工具玩法

Thariq偶尔会创建一些简单的HTML文件作为本地工具。

比如这个定制的表情包生成器,直接使用他meme文件夹里的素材:

我觉得还有更多有趣的定制软件等着被开发。

打通Apple生态

Claude可以通过文件系统访问你的Apple Notes和iMessage。

Thariq分享了他用于访问Notes的脚本:

https://gist.github.com/ThariqS/4c473551d9557544698f011e89a086d7

#!/usr/bin/env node

const { exec } = require('child_process');
const { promisify } = require('util');
const execAsync = promisify(exec);

class NotesManager {
async executeAppleScript(script) {
    try {
      const { stdout, stderr } = await execAsync(`osascript -e '${script}'`);
      if (stderr) console.error('AppleScript error:', stderr);
      return stdout.trim();
    } catch (error) {
      console.error('Error executing AppleScript:', error.message);
      returnnull;
    }
  }

async searchNotes(query) {
    const script = `
      tell application "Notes"
        set searchResults to {}
        repeat with n in notes
          if (name of n contains "${query}") or (body of n contains "${query}") then
            set end of searchResults to {name: name of n, body: body of n, id: id of n}
          end if
        end repeat
        return searchResults
      end tell
    `
;
    
    const result = awaitthis.executeAppleScript(script);
    if (result) {
      console.log('Search Results:');
      console.log(result);
    }
    return result;
  }

async createNote(title, body = '') {
    const script = `
      tell application "Notes"
        make new note with properties {name:"${title}", body:"${body}"}
        return "Note created: ${title}"
      end tell
    `
;
    
    const result = awaitthis.executeAppleScript(script);
    console.log(result);
    return result;
  }

// ... 更多方法
}

asyncfunction main({
const args = process.argv.slice(2);
const command = args[0];
const notesManager = new NotesManager();

switch (command) {
    case'search':
      if (args[1]) {
        await notesManager.searchNotes(args[1]);
      } else {
        console.log('Usage: notes-cli search <query>');
      }
      break;

    case'create':
      if (args[1]) {
        const title = args[1];
        const body = args.slice(2).join(' ');
        await notesManager.createNote(title, body);
      } else {
        console.log('Usage: notes-cli create <title> [body]');
      }
      break;
    // ... 更多命令
  }
}

这个脚本支持搜索、创建、编辑、列出和获取笔记内容等功能。

MCP:连接一切的桥梁

对于本地无法访问的内容,MCP(Model Context Protocol)来帮忙。

Notion、Google Docs、Linear、Github、Slack等都有对应的MCP,让Claude Code能获取尽可能多的上下文来协助工作。

比如,从Slack获取当天的所有待办事项。

“把这套系统偷走吧”

Thariq慷慨地分享了他的配置文件:

claude.md配置

https://gist.github.com/ThariqS/2c35650d1cb81e87392e9f0fee5d5a10

# Claude Configuration

## About <<You>>
Note to Claude: if the user does not fill this out, interview them to do so and then remove this line.

## Directory Structure
**~/Desktop**: Screenshots and videos for reference
**~/memes**: Meme collection for brainstorming
**~/Repos**: Main coding projects
**~/Documents**: Personal videos + Documents
**~/Downloads**: Recent downloads

## Working Directories
**Scripts**`~/code/claude-scripts` - Custom scripts and automation
**Memory**`~/memories` - Important information to remember (markdown)
**Journal**`~/journal` - Personal journal entries (markdown)
**Ideas**`~/ideas` - Creative ideas and thoughts (markdown)
**To dos**`~/todos` - Things to do, reminders, etc (markdown)
**Projects**`~/projects` - Active projects I'm working on (markdown)

## Instructions & Projects
You should search memories to see if there's an relevant information for my query, especially if you feel like you're missing context.
Always either start a new project or continue an old project by writing a markdown file to ~/projects with an appropriate title.
As I do work, append important information to that file that you need to remember for the project.

## Tools & Scripts
**Apple Notes CLI**`./code/claude-scripts/notes-cli.js`
  - Search notes: `node notes-cli.js search "query"`
  - Create notes: `node notes-cli.js create "title" "content"`
  - Edit notes: `node notes-cli.js edit "title" "new content"`
  - List notes: `node notes-cli.js list`
  - Get note: `node notes-cli.js get "title"`

**iMessage**: I don't use iMessage at work, but you probably should y'all.

## Usage Notes
You are a general purpose assistant, not limited to coding
Can write code to help with various tasks

/journal命令

https://gist.github.com/ThariqS/ae5ddce4e81cb92a781dc4597768adad

---
description: Create or update daily journal entries
---


# Journal Entry Manager

This command helps you create or update daily journal entries. Each entry is stored as a markdown file in ~/journal with the naming convention: YYYY-MM-DD.md

## Usage:
`/journal` - Create/update today's journal entry
`/journal some thoughts` - Add content to today's journal
`/journal 2024-03-15 specific date entry` - Create/update entry for a specific date

/todo命令

https://gist.github.com/ThariqS/25d515eca8bea795b743149b91aa5d16

---
name: todo
description: Manage TODO list in .todo.md files with consistent formatting and daily memory search
---


# TODO List Manager

## Current Action: $ARGUMENTS

I'll help you manage your TODO list stored in TODO.MD. This command will:
Search your memories and other information for relevant context
Update TODO.MD with consistent formatting
Support nested items with indentation
Keep track of your daily tasks

## Task Steps:

1. 
First, I'll search your memories and relevant information for context about your todos
2. Either create a new `<topic>.todo.md` or update an existing one based on the topic
3. Update the file based on your request:
   - Add new todos
   - Mark items as complete
   - Organize with sub-bullets
   - Add context from memories if relevant

## Available Actions:
Add a new todo: `/todo add [task description]`
Mark complete: `/todo complete [task description]`
View all todos: `/todo list`
Add sub-task: `/todo add-sub [parent task] > [sub-task]`
Search related memories: `/todo context [topic]`

社区热议

Henry Sowell (@veteranbv) 分享了他的使用体验:

我太喜欢这个了。现在我在编程之外的很多任务中都在使用它。我用它管理会议记录,为我的Obsidian笔记添加标签。我用它从会议记录和其他日志中提取待办事项,并通过MCP同步到我的todoist应用。创建自定义命令简直太棒了。

pj4533 (@pj4533)补充了一个小技巧:

另一个好建议是制作一个小的TTS脚本放在claude.md里,用它来说出将要做什么以及总结做了什么。我使用新的OpenAI模型,让Claude根据需要调整回应的情绪。(我喜欢一点讽刺感!)

Nicolas Koehl (@NicolasKoehl)发现了它在基础设施任务中的妙用:

它在基础设施任务中真的很棒,比如SSH到Linux机器、更新配置文件、重启服务等。我在事故处理时用它快速地向多台服务器应用更改和解决方案,比我手动操作快多了。当然,你必须密切关注它。

Steven Rouk (@stevenrouk):

我在过去几周才开始这样使用Claude Code,但我已经发现自己希望CC成为我与一切交互的统一界面。未来我希望所有的应用和服务要么有CC可以作为MCP使用的API,要么就直接以纯文本形式存在。

Chris Ivester (@chrisivester)也分享了他的工作流:

我一直在用Claude Code、Obsidian和Linear MCP构建类似的组织系统(我想要一个可以通过UI轻松地视觉化优先级工作的空间)。我早上运行/signon,Claude就会从Linear拉取相关任务并构建带有待办事项的每日笔记。

0xfabs.hl (@0xfabs)推荐了一个任务管理工具:

好文章,学到了一两件事。谢谢。你试过Backlog md吗?在创建/检索任务和获取它们的状态时,CC与它配合得非常好。

Fred Pope (@fred_pope)也展示了效果:

效果很好。

montaigne (@montaigne)分享了他的Apple生态集成方案:

很棒!我也刚刚在App Store发布了alto.index应用更新,允许通过mcp与notes/messages/calendar对话,并安装claude桌面扩展。

当被问到是否真的在home目录处理工作项目时,Robert Ritz (@RobertERitz)得到了确认:

你实际上不会在home目录处理项目吧?这只是个人管理的东西?

Claude Code正在从一个编程工具进化成生活助手。

当「一切皆文件」的Unix哲学遇上AI,产生了意想不到的化学反应。

也许未来,我们不再需要在不同的应用之间切换,一个终端、一个AI助手,就能管理生活的方方面面。

如jonmc12 (@jonmc12)所说:

听起来当Claude Code能自动化Anthropic大部分工作时,我们就知道它是AGI了。

什么?

你用的是Windows?

如果你是程序员且没用过Mac,相信我赶快换Mac 你会回来感谢我的。




[1]

claude.md: http://claude.md

[2]

Claude Code 官方文档: http://claude.md/

[3]

Apple Notes CLI 脚本: https://gist.github.com/ThariqS/4c473551d9557544698f011e89a086d7

[4]

claude.md 配置文件: https://gist.github.com/ThariqS/2c35650d1cb81e87392e9f0fee5d5a10

[5]

/journal 命令配置: https://gist.github.com/ThariqS/ae5ddce4e81cb92a781dc4597768adad

[6]

/todo 命令配置: https://gist.github.com/ThariqS/25d515eca8bea795b743149b91aa5d16

[7]

Backlog.md 任务管理工具: https://github.com/MrLesk/Backlog.md

[8]

Alto Index(Apple 生态集成): https://altoindex.com/dxt


(文:AGI Hunt)

发表评论