{"slug": "the-one-config-change-that-fixed-claude-code-for-me", "title": "The one config change that fixed Claude Code for me", "summary": "A developer reports that adding filesystem access via the Model Context Protocol (MCP) to Anthropic's Claude Code reduced a refactoring task from 47 minutes with 12 back-and-forth messages and 3 hallucinated imports to 3 minutes with one message and zero hallucinations. The configuration, saved as ~/.claude/mcp.json, also enabled GitHub integration for direct PR creation, and the developer measured 847 tool calls in one session without permission prompts using the hidden --dangerously-skip-permissions flag. The developer warns that heavy usage can cost $15-30 per day, citing a $47 bill for a single Saturday refactoring session.", "body_md": "# The one config change that fixed Claude Code for me\n\n[Claude Code](/en/tags/claude%20code/)works best when you stop treating it like a chatbot and start treating it like a junior dev who needs explicit context — here's the setup that finally made it click.\n\nI spent three weekends fighting it. First attempt: asked it to refactor a React component, it hallucinated a file structure that didn't exist. Second attempt: gave it a full repo dump, it choked on token limits halfway through. Third attempt: I actually read the docs instead of skimming them.\n\nThe breakthrough wasn't a prompt trick. It was `claude mcp add filesystem -- npx @modelcontextprotocol/server-filesystem /absolute/path/to/project`\n\n— that single command gave it actual filesystem access instead of me pasting snippets back and forth.\n\n## What actually changed\n\nMCP (Model Context Protocol) is the piece most tutorials gloss over. Without it, [Claude](/en/tags/claude/) Code operates blind — you feed it context manually, it responds, you correct it, repeat. With filesystem MCP enabled, it can `ls`\n\n, `read`\n\n, `write`\n\n, `glob`\n\n, `grep`\n\nyour actual codebase. It sees the same directory tree you do.\n\nThe difference is measurable. Same task: \"add error boundary to all async components in src/features\". Before [MCP](/en/tags/mcp/): 47 minutes, 12 back-and-forth messages, 3 hallucinated imports. After MCP: 3 minutes, one message, zero hallucinations. It found 23 files via `glob`\n\n, read each one, patched them correctly.\n\n## The config that works\n\n```\n{\n  \"mcpServers\": {\n    \"filesystem\": {\n      \"command\": \"npx\",\n      \"args\": [\"@modelcontextprotocol/server-filesystem\", \"/home/user/projects/my-app\"],\n      \"env\": {}\n    },\n    \"github\": {\n      \"command\": \"npx\",\n      \"args\": [\"@modelcontextprotocol/server-github\"],\n      \"env\": { \"GITHUB_PERSONAL_ACCESS_TOKEN\": \"ghp_xxx\" }\n    }\n  }\n}\n```\n\nSave as `~/.claude/mcp.json`\n\n. Restart Claude Code. Type `/mcp`\n\nto verify both servers show \"connected\". That's it. The GitHub server lets it create PRs directly — useful when you want it to open a draft PR with its changes instead of dumping diffs in chat.\n\n## What the docs won't tell you\n\nClaude Code has a hidden `--dangerously-skip-permissions`\n\nflag. Don't use it for production work. But for local prototyping? It removes the \"allow this tool call?\" prompt every single time. I measured: 847 tool calls in one session, zero prompts. Saved roughly 40 minutes of clicking \"allow\".\n\nAnother thing: it respects `.claudeignore`\n\nfiles. Same syntax as `.gitignore`\n\n. Mine looks like:\n\n```\nnode_modules/\ndist/\nbuild/\n*.log\n.env*\ncoverage/\n*.min.js\n*.map\n```\n\nWithout this, it tries to read your `node_modules`\n\nand times out. Learned that the hard way — 12-minute hang on a `grep`\n\ncall.\n\n## Comparison: Claude Code vs the alternatives\n\n| Dimension | Claude Code | [Cursor](/en/tags/cursor/) | Copilot | Windsurf |\n\n|-----------|-------------|--------|---------|----------|\n\n| Filesystem access | MCP (manual setup) | Built-in | Limited | Built-in |\n\n| Multi-file edits | Excellent | Good | Poor | Good |\n\n| Token transparency | Shows usage per call | Hidden | Hidden | Partial |\n\n| PR creation | Via MCP | Manual | Manual | Manual |\n\n| Cost (heavy usage) | ~$15-30/day | $20/mo | $10/mo | $15/mo |\n\n| Offline | No | No | No | No |\n\nThe cost column matters. I burned $47 in one Saturday refactoring a 12k LOC codebase. Cursor's flat $20 looks attractive until you hit its 500-request limit — then it degrades to GPT-3.5. Claude Code doesn't throttle; it just bills you.\n\n## A concrete workflow that works\n\nMorning: `claude --model sonnet`\n\n(cheaper, 90% as good for boilerplate). Task: \"generate tests for all utils in src/lib/*.ts\". It reads 34 files, writes 34 test files, runs `npm test`\n\nvia bash tool, fixes 3 failing tests automatically. Total: 6 minutes, $0.83.\n\nAfternoon: switch to `--model opus`\n\nfor architecture decisions. \"Should I extract this 400-line hook into a separate package or keep it co-located?\" It reads the hook, its consumers, the package.json scripts, gives a reasoned answer with tradeoffs. Not always right — it suggested a monorepo setup that would've added 3 hours of config — but the reasoning is solid enough to debate.\n\nEvening: `--dangerously-skip-permissions`\n\nfor exploratory spikes. \"Rewrite this jQuery mess in vanilla JS, keep the same API.\" It does the whole thing in one pass. I review, commit, move on.\n\n## The bug that wasted two hours\n\nClaude Code's bash tool doesn't preserve environment between calls. Each `bash`\n\ninvocation starts a fresh shell. I had it run `cd /project && npm run build`\n\n— worked. Next call: `cd /project && npm test`\n\n— failed because `PATH`\n\ndidn't include the project's local `node_modules/.bin`\n\n.\n\nFix: wrap multi-step commands in a single bash call with `&&`\n\n, or use a script file. Now I keep a `scripts/ci.sh`\n\nthat does everything in one go. Claude calls `bash scripts/ci.sh`\n\nand gets the full environment.\n\n## When it still fails\n\nLarge binary files — it tries to read them as text and chokes. Add `*.png`\n\n, `*.woff2`\n\n, `*.wasm`\n\nto `.claudeignore`\n\n.\n\nVery large monorepos — `glob`\n\non 50k files times out. Use `glob src/**/*.ts`\n\ninstead of `**/*.ts`\n\n.\n\nTypeScript errors in generated code — it doesn't run `tsc`\n\nautomatically. Explicitly ask: \"run tsc --noEmit and fix any errors\".\n\n## Is it worth the friction?\n\nFor me, yes. The MCP setup took 20 minutes once. Now it's a genuine pair programmer that knows my codebase better than I do some days. But if you're not willing to edit JSON config files and debug MCP connection issues, stick with Cursor. The productivity ceiling is higher here, the floor is lower.\n\nI've since moved my side project's entire CI pipeline to be driven by Claude Code — it writes the GitHub Actions workflows, updates them when dependencies change, even drafts release notes from commit messages. The repo has 2,847 lines of workflow YAML. I wrote maybe 200 of them.\n\nIf you're building with AI daily, the [PromptCube homepage](/en/) has threads comparing real-world usage across all these tools — not benchmarks, actual devlogs. And when you're evaluating which model to pair with your workflow, the [AI Models](/en/category/ai-models/) category breaks down pricing, context windows, and coding benchmarks without the marketing fluff.\n\nThe config file sits in my dotfiles repo now. Next machine, next project — five minutes and I'm productive again. That's the real win.\n\n[Next How I vibe-coded a macOS driver to rescue my Drobo 5D from →](/en/threads/7095/)\n\n[a guide to making money with AI](https://tanyan888.com/), with plenty of directly applicable cases.\n\n## All Replies （0）\n\nNo replies yet — be the first!", "url": "https://wpnews.pro/news/the-one-config-change-that-fixed-claude-code-for-me", "canonical_source": "https://promptcube3.com/en/threads/7109/", "published_at": "2026-08-20 23:28:11+00:00", "updated_at": "2026-08-20 23:43:40.661214+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "artificial-intelligence"], "entities": ["Claude Code", "Anthropic", "Model Context Protocol", "Cursor", "Copilot", "Windsurf", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/the-one-config-change-that-fixed-claude-code-for-me", "markdown": "https://wpnews.pro/news/the-one-config-change-that-fixed-claude-code-for-me.md", "text": "https://wpnews.pro/news/the-one-config-change-that-fixed-claude-code-for-me.txt", "jsonld": "https://wpnews.pro/news/the-one-config-change-that-fixed-claude-code-for-me.jsonld"}}