---
title: "Discussion on \"Fixing Gradle on Claude Code Web with a PreToolUse Hook\" | Hashnode"
description: "Discussion on \"Fixing Gradle on Claude Code Web with a PreToolUse Hook\". Claude Code on the Web runs inside a sandboxed environment that routes all traffic through an HTTP proxy.\nTools like curl pick up the https_proxy environment variable automatically - but Java doesn't. \nThe Gradle wrapper uses java.net.HttpURLConnecti..."
url: "https://hashnode.com/posts/claude-code-hooks-gradle-proxy-fix/699c3b711b3d66c7e6c3932b"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Fixing Gradle on Claude Code Web with a PreToolUse Hook](https://tschuehly.hashnode.dev/claude-code-hooks-gradle-proxy-fix?utm_source=hashnode&utm_medium=feed)

Claude Code on the Web runs inside a sandboxed environment that routes all traffic through an HTTP proxy. Tools like curl pick up the https\_proxy environment variable automatically - but Java doesn't. The Gradle wrapper uses java.net.HttpURLConnecti...

Feb 23 · 3 min read · tschuehly.hashnode.dev  
Updated Feb 25  
Read the article

-   [#claude](https://hashnode.com/tag/claude)
-   [#devtools](https://hashnode.com/tag/devtools)
-   [#gradle](https://hashnode.com/tag/gradle)
-   [#spring-boot](https://hashnode.com/tag/spring-boot)

## Written by

[Thomas Schilling](https://hashnode.com/@tschuehly)

@tschuehly

  
[View profile](https://hashnode.com/@tschuehly)

Youngest Speaker @spring\_io - Spring ViewComponent creator - Bootstrapping PhotoQuest

Thomas Schühly’s server-side rendering journey started as a developer trying to make life easier while developing his first bootstrapped product in his free time. Creating Spring ViewComponent enabled him to be the youngest Speaker at the largest European Spring conference and build awesome software full-time with his open-source library at alanda.io. He regularly talks at Java User Groups about htmx and server-side rendering with Spring while contributing to the open-source community. PhotoQuest

## Responses 1

Markdown supported · ⌘↵ to post

[klement Gunndu](https://hashnode.com/@klementgunnduai)

[Feb 28](https://hashnode.com/posts/claude-code-hooks-gradle-proxy-fix/699c3b711b3d66c7e6c3932b/comment/69a31979ad03d704239a9dff)

This is the kind of practical fix that saves hours of debugging. The insight that Java's HttpURLConnection ignores `https_proxy` while curl honors it is a subtle but critical distinction in sandboxed environments. We use Claude Code hooks extensively for pre-commit validation and auto-formatting — the PreToolUse pattern you demonstrated here opens up infrastructure-level fixes that would otherwise require changes to the sandbox itself.
