I’m using direnv together with flake.nix to provide project-local dependencies automatically when entering a directory.
This setup works as expected in:
- terminal-based agents
- Cursor
- Zed
But when I run t3code, the agent behaves as if those dependencies are not available in the project environment.
For example, tools/binaries made available through direnv are visible in my shell, but the T3 Code agent reports that they are missing:
Expected behavior
- T3 Code should use the environment for the target project/worktree directory
- if a project relies on
direnv + flake.nix, the agent should see the same dependencies that are available in a normal shell inside that directory
Actual behavior
- T3 Code appears to inherit only the parent process environment
- workspace-local environment activation does not seem to happen for the agent session
Notes
- My guess is that this may also affect other environment managers with similar behavior, such as asdf,
mise, nix develop, etc.
- I suspect the issue is that changing
cwd alone is not enough; tools like direnv require explicit environment activation for that directory
Example project
Here is one of my projects that uses this setup: https://github.com/sgiath/nostr
I’m using direnv together with
flake.nixto provide project-local dependencies automatically when entering a directory.This setup works as expected in:
But when I run
t3code, the agent behaves as if those dependencies are not available in the project environment.For example, tools/binaries made available through
direnvare visible in my shell, but the T3 Code agent reports that they are missing:Expected behavior
direnv+flake.nix, the agent should see the same dependencies that are available in a normal shell inside that directoryActual behavior
Notes
mise,nix develop, etc.cwdalone is not enough; tools likedirenvrequire explicit environment activation for that directoryExample project
Here is one of my projects that uses this setup: https://github.com/sgiath/nostr