Brad Zhang / public archive

Brad Zhang

AI product notes, agent workflow writing, and open-source dossiers for founders and early technical teams.

Back to X dispatches

Article / March 23, 2026

English indexed dispatch

Why do many claude code query tasks require the use of file search commands? Is there n...

Why do many claude code query tasks require the use of file search commands? Is there no other better way? I asked CC this question, and it gave me a very detailed answer, and t...

Why do many claude code query tasks require the use of file search commands? Is there no other better way? I asked CC this question, and it gave me a very detailed answer, and then gave me a feasible solution. You can also try it: This is a core pain point of Claude Code's current architecture. Why use file search? Claude Code is essentially a stateless agent - it knows nothing about the environment in each conversation and can only "see" the world through tool calls: The user says "update skill Local index file (most practical) Create a skills-manifest.json, which is automatically maintained when installing/updating skills, so that only one file (~2KB) needs to be read when searching, instead of Glob + Read 49 directories.

2. MCP Server provides structured query and packages skill management into MCP tools: mcp://skill-manager/list → Return all skills mcp://skill-manager/get/name → Return single skill information mcp://skill-manager/update/name → Perform update Claude can directly adjust one tool to complete the task without multiple rounds of file searches.

3. SessionStart Hook preloading automatically generates the environment summary injection context when the session starts: # SessionStart hook python3 > /tmp/claude-env-summary.json In this way, Claude knows "which skills are installed, in which directory, and what version" from the beginning.

4. Your skills-updater is already doing this. The skills-updater skill in your repository is actually the prototype of option 1 - it has the check_updates.py script to scan and manage skills. It can be further optimized to automatically maintain the manifest. --- Practical suggestions The simplest and most effective solution is the combination of solution 1 + solution 3:

1. Write a ~/.claude/skills-manifest.json, which will be automatically updated when installing/uninstalling the skill

2. Generate it in the SessionStart hook, so that Claude will have a global view every time the conversation starts

3. Read one file when searching, saving 5-10 tool calls

Open original on X