graphify icon indicating copy to clipboard operation
graphify copied to clipboard

README troubleshooting recommends .claudeignore, which Claude Code does not support

Open chaosanderos opened this issue 4 months ago • 5 comments

The v8 README's Troubleshooting section ('Claude Code prompt cache invalidated after every graphify extract') tells users to add graph.json and graphify-out/ to a .claudeignore file.

Claude Code has no .claudeignore support. Evidence:

  • The official docs (code.claude.com/docs, settings page, 'Exclude sensitive files') document permissions.deny Read rules as the mechanism, replacing the deprecated ignorePatterns. No page mentions .claudeignore.
  • anthropics/claude-code#579 (the original .claudeignore feature request) was closed with 'You can do this now with deny permission rules!' — no .claudeignore file was ever shipped.
  • A long tail of user bug reports confirms the file silently does nothing: anthropics/claude-code#36163, #16704, #46699, #56997 ('.claudeignore is silently ignored'), #65812.

So the README's remedy is a no-op: users create the file, nothing changes, and the prompt-cache symptom persists. Suggest either removing the entry or replacing it with the supported equivalent, e.g.:

// .claude/settings.json
{ "permissions": { "deny": ["Read(./graphify-out/**)", "Read(./graph.json)"] } }

(with the caveat that deny rules gate access, which also breaks 'graphify-out/wiki as navigation' workflows — the two goals conflict, which is worth a sentence in the docs).

Found while acting on the same install that produced #1840. Local setup: graphifyy 0.9.13, Claude Code on Linux.

chaosanderos avatar Jul 13 '26 09:07 chaosanderos

Opened a fix for this: #1877 — swapped the .claudeignore recommendation for the supported permissions.deny Read rules and added a note about the access/cache trade-off.

Yashasm18 avatar Jul 14 '26 04:07 Yashasm18

Hii, came here to work on the issue but already 3 PR's are open , went through each one and here are my insights about each pr: #1936 — the cleanest. Smallest diff, compact JSON, clear caveat. Nothing to fix. #1877 — same fix, but writes the JSON across multiple lines, which is nicer to paste into a real settings.json. #1845 — the most detailed note (it even calls out GRAPH_REPORT.md and scoping to specific files), but its diff also drops the trailing newline and edits the footer around line 849, which isn't related and should be reverted first.

My vote is #1936, or #1877 if you'd rather ship the multi-line JSON — and close the other two.

HerenderKumar avatar Jul 21 '26 05:07 HerenderKumar

The filename half of this is right, but I think all three PRs (#1845, #1877, #1936) preserve a premise that's also wrong, and it's worth settling before one of them merges.

Each keeps this sentence intact:

every write invalidates Claude Code's prompt cache, forcing a full re-upload at cache-write rates on the next turn

That isn't how the cache works. Prompt caching is a prefix match over the rendered prompt — tools → system → messages. Files on disk are not part of that prefix unless something reads them into the conversation, and Claude Code doesn't index or upload the repo, so there is no "full re-upload" to trigger. Writing graph.json invalidates nothing. What actually invalidates a prefix is a change inside it: editing the system prompt (including CLAUDE.md), adding/removing/reordering tools, switching models, or nondeterminism early in the prefix (a timestamp, unsorted JSON). Appending to the conversation — which is all a file-change notification does — extends the prefix rather than invalidating it, costing a small cache write on the new tail.

Two details in the original report (#1387) point the same way. $3.75/M is specifically Sonnet's 5-minute cache-write rate (1.25 × $3/M base), presented as the universal figure — on Opus it's higher, and the 1-hour TTL is 2× rather than 1.25×. And the audit was described as reading local session logs for "cache misses and token waste," but those JSONL files record cache_creation_input_tokens and cache_read_input_tokens per request — the numbers that would actually demonstrate thrash. The report gives a count of file writes instead.

That matters here because the deny-rule fix has a real cost the current entry doesn't. All three PRs add a note along the lines of "if you rely on reading graphify-out/, skip this and accept the cache cost instead" — which asks users to give up GRAPH_REPORT.md and wiki/ in exchange for avoiding something that isn't happening. Swapping in a filename that works makes the entry more harmful than the no-op it replaces: today it does nothing, afterwards it blocks the documented navigation workflow.

Suggest deleting the Troubleshooting entry outright rather than translating it. Keeping graphify-out/ gitignored is still worth recommending for repo size and merge noise, and ## Team setup already covers that.

If a Claude Code entry is wanted in its place, there is a real one nearby: graph.json runs to megabytes on a normal repo (2.4 MB on mine), so an agent that reads it whole burns a large share of its context for little usable signal. Pointing at graphify query / explain / path, with GRAPH_REPORT.md for broad orientation, addresses that — and it's a size problem, not a cache problem, so it needs no settings changes.

Happy to open a PR for the deletion if that's the direction you'd prefer.

mmakam2 avatar Aug 04 '26 03:08 mmakam2

@mmakam2 is right and I'd defer to that reading. I checked the filename claim carefully but took the cache mechanism from #1387 at face value without verifying it, which I should have done before filing — prefix caching over the rendered request doesn't touch files on disk, so the entry is describing a symptom whose stated cause doesn't hold.

That makes the deny-rule translation actively worse than the no-op: it would block the GRAPH_REPORT.md / wiki/ navigation the docs recommend, in exchange for preventing something that isn't happening. +1 to deleting the Troubleshooting entry outright, and to the graph.json size point as the real Claude Code concern worth documenting in its place.

Apologies to @Yashasm18, @prvthmpcypher, @kimdzhekhon and @HerenderKumar for the churn on a bad premise. @mmakam2, please do open the deletion PR.

Disclosure, since it's relevant to how this happened: this issue was filed by a Claude Code agent running on my machine, without my review before it posted. The citations were real; the premise it inherited wasn't checked. That's on me for the setup, and I've tightened it.

For what it's worth, Claude checked — the README has no @-imports of generated files into CLAUDE.md either, which is the one path that would actually invalidate the prefix on re-extract. So there's no salvageable version of this entry.

chaosanderos avatar Aug 04 '26 12:08 chaosanderos

Agreed, no salvageable version of the entry once you trace the cache mechanism properly. Good catch running it back down to the actual trigger instead of leaving the deny-rule "fix" in place, that would've been a worse trade (breaking working nav for a symptom that isn't real). On the graph.json size point: that seems like the actual thing worth its own issue. Worth scoping separately from this one, since it's a genuinely different problem (payload/perf, not caching or file-ignore behavior) and would probably need its own repro data (size thresholds, extract times, etc.) rather than getting folded into a deletion PR. Happy to help dig into that if it turns into its own issue.

poorvith-mp avatar Aug 04 '26 13:08 poorvith-mp