# How the `GO_MODERN_GUIDELINES_DEV` Environment Variable Enables Local Development

> Understand how the GO_MODERN_GUIDELINES_DEV environment variable simplifies local development by switching to a local binary instead of a published release. Boost your workflow today.

- Repository: [JetBrains/go-modern-guidelines](https://github.com/jetbrains/go-modern-guidelines)
- Tags: how-to-guide
- Published: 2026-08-30

---

**The `GO_MODERN_GUIDELINES_DEV` environment variable acts as a toggle that redirects the go-modern-guidelines skill to execute a locally-built development binary instead of the published release.**

The `GO_MODERN_GUIDELINES_DEV` environment variable provides a safe mechanism for testing changes to the **JetBrains/go-modern-guidelines** CLI without affecting production workflows. When this variable is exported in your shell, the skill's wrapper script bypasses the standard binary installation and executes a development version stored in the local cache. This allows developers to iterate rapidly on the CLI codebase while keeping the production skill unchanged for other users.

## How the Wrapper Script Detects Dev Mode

In [`plugin/skills/use-modern-go/scripts/run-tool.sh`](https://github.com/JetBrains/go-modern-guidelines/blob/main/plugin/skills/use-modern-go/scripts/run-tool.sh), the wrapper implements an early-exit path that checks for the presence of the `GO_MODERN_GUIDELINES_DEV` variable. If the variable is set, the script constructs a path to the development binary at `${cache_root}/dev/${binary_name}` and verifies it exists and is executable.

When the dev binary is found, the wrapper immediately executes it using `exec`, passing through all arguments. If the variable is set but the binary is missing, the script aborts with an explicit error message directing you to run `make dev-install`. When the variable is unset, the script proceeds with its normal flow to install or reuse the released CLI version from the module repository.

```bash

# Excerpt from plugin/skills/use-modern-go/scripts/run-tool.sh

if [ -n "${GO_MODERN_GUIDELINES_DEV:-}" ]; then
    dev_binary="${cache_root}/dev/${binary_name}"
    if [ ! -x "${dev_binary}" ]; then
        echo "go-modern-guidelines: GO_MODERN_GUIDLINES_DEV is set but no dev build found; run make dev-install" >&2
        exit 1
    fi
    exec "${dev_binary}" "$@"
fi

```

## Building and Running the Development Version

### Compile the Dev Binary

Run the make target to build and install the development version into your local cache:

```bash
make dev-install

```

This places the compiled binary under `$HOME/.cache/go-modern-guidelines/dev/`, where the wrapper script expects to find it according to the source logic.

### Activate Dev Mode

Export the environment variable in the same shell session where you launch your agent:

```bash
export GO_MODERN_GUIDELINES_DEV=1

```

### Launch the Agent

Start your preferred agent (Claude Code, Cursor, Codex, etc.):

```bash
claude

# or cursor-agent, junie, etc.

```

The skill now runs your local build. The wrapper prints the path to the dev binary in the console output for verification.

## Workflow for Iterative Development

1. **Modify code** in the CLI source files.
2. **Rebuild** with `make dev-install` to update the cached binary.
3. **Test immediately** – the next skill invocation automatically picks up the new build without restarting the agent.
4. **Repeat** until satisfied.

This cycle provides a fast feedback loop for testing CLI changes within the actual agent environment.

## Returning to Production Mode

To resume using the published binary, either unset the variable or clean the development build entirely:

```bash

# Option 1: Unset for current session

unset GO_MODERN_GUIDELINES_DEV

# Option 2: Remove dev binary completely

make dev-uninstall

```

Once deactivated, the wrapper script reverts to downloading and executing the released version from the JetBrains repository.

## Summary

- The `GO_MODERN_GUIDELINES_DEV` variable redirects skill execution to a locally-built binary when set.
- The wrapper script [`run-tool.sh`](https://github.com/JetBrains/go-modern-guidelines/blob/main/run-tool.sh) checks this variable and executes `${cache_root}/dev/${binary_name}` if present.
- Use `make dev-install` to build the dev binary and place it in `$HOME/.cache/go-modern-guidelines/dev/`.
- Export the variable in your shell before launching agents like Claude Code or Cursor to enable dev mode.
- Unset the variable or run `make dev-uninstall` to return to the production release.

## Frequently Asked Questions

### What happens if `GO_MODERN_GUIDELINES_DEV` is set but I haven't built the dev binary?

The wrapper script aborts execution and prints an error message to stderr instructing you to run `make dev-install`. According to the logic in [`run-tool.sh`](https://github.com/JetBrains/go-modern-guidelines/blob/main/run-tool.sh), the script verifies the binary exists with `test -x` before attempting execution, preventing runtime errors from missing executables.

### Can I use this variable with any IDE agent?

Yes. The environment variable is consumed by the wrapper script [`run-tool.sh`](https://github.com/JetBrains/go-modern-guidelines/blob/main/run-tool.sh), which executes before the CLI runs regardless of which agent invokes it—Claude Code, Cursor, Codex, or others. As long as the variable is exported in the shell environment where the agent starts, the development binary will be used.

### Where is the development binary stored?

The `make dev-install` target compiles the binary and places it in your user cache directory under `$HOME/.cache/go-modern-guidelines/dev/`. The wrapper script specifically looks for the binary at this location when `GO_MODERN_GUIDELINES_DEV` is enabled.

### Does setting this variable affect other users or projects?

No. The variable only affects the current shell session where it is exported. Other users, different shell sessions, or CI environments without this variable set will continue using the published release binary from the JetBrains repository.