diff --git a/codex.cabal b/codex.cabal
--- a/codex.cabal
+++ b/codex.cabal
@@ -1,5 +1,5 @@
 name:                codex
-version:             0.4.0.10
+version:             0.5.0.0
 synopsis:            A ctags file generator for cabal project dependencies.
 description:
   This tool download and cache the source code of packages in your local hackage,
@@ -61,6 +61,7 @@
     Main.Config.Codex0
     Main.Config.Codex1
     Main.Config.Codex2
+    Main.Config.Codex3
     Paths_codex
   build-depends:
       base
@@ -77,7 +78,7 @@
     , transformers
     , wreq
     , yaml                
-    , codex               == 0.4.0.10
+    , codex               == 0.5.0.0
 
 source-repository head
   type:     git
diff --git a/codex/Main.hs b/codex/Main.hs
--- a/codex/Main.hs
+++ b/codex/Main.hs
@@ -98,6 +98,7 @@
         where
           ignore msg = do
             putStrLn $ concat ["codex: *warning* unable to fetch an archive for ", display i]
+            putStrLn msg
             return ()
 
 help :: IO ()
@@ -142,10 +143,12 @@
                         (ec, _, _) <- readCreateProcessWithExitCode (shell "which stack") ""
                         case ec of
                           ExitSuccess -> do
-                            globalPath <- readStackPath "global-stack-root"
-                            binPath <- readStackPath "bin-path"
-                            setEnv "PATH" binPath
-                            return (Stack, cx' { hackagePath = globalPath </> "indices" </> "Hackage" })
+                            let opts = stackOpts cx'
+                            globalPath <- readStackPath opts "stack-root"
+                            binPath <- readStackPath opts "bin-path"
+                            path <- getEnv "PATH"
+                            setEnv "PATH" $ concat [path, ":", binPath]
+                            return (Stack opts, cx' { hackagePath = globalPath </> "indices" </> "Hackage" })
                           _           ->
                             return (Cabal, cx')
                       else return (Cabal, cx')
diff --git a/codex/Main/Config.hs b/codex/Main/Config.hs
--- a/codex/Main/Config.hs
+++ b/codex/Main/Config.hs
@@ -9,6 +9,7 @@
 import qualified Main.Config.Codex0 as C0
 import qualified Main.Config.Codex1 as C1
 import qualified Main.Config.Codex2 as C2
+import qualified Main.Config.Codex3 as C3
 import qualified Distribution.Hackage.DB as DB
 
 data ConfigState = Ready | TaggerNotFound
@@ -31,7 +32,7 @@
 loadConfig = decodeConfig >>= maybe defaultConfig return where
   defaultConfig = do
     hp <- DB.hackagePath
-    let cx = Codex True (dropFileName hp) (taggerCmd Hasktags) True True defaultTagsFileName
+    let cx = Codex True (dropFileName hp) defaultStackOpts (taggerCmd Hasktags) True True defaultTagsFileName
     encodeConfig cx
     return cx
 
@@ -46,14 +47,18 @@
   cfg   <- config path
   case cfg of
     Nothing   -> do
-      cfg2 <- config2 path
-      case cfg2 of
+      cfg3 <- config3 path
+      case cfg3 of
         Nothing -> do
-          cfg1 <- config1 path
-          case cfg1 of
-            Nothing -> config0 path
-            cfg1'   -> return cfg1'
-        cfg2' -> return cfg2'
+          cfg2 <- config2 path
+          case cfg2 of
+            Nothing -> do
+              cfg1 <- config1 path
+              case cfg1 of
+                Nothing -> config0 path
+                cfg1'   -> return cfg1'
+            cfg2' -> return cfg2'
+        cfg3' -> return cfg3'
     cfg'      -> return cfg'
   where
     warn :: IO () -> IO ()
@@ -65,6 +70,7 @@
     config0 = reencodeConfigOf C0.migrate C0.migrateWarn
     config1 = reencodeConfigOf C1.migrate C1.migrateWarn
     config2 = reencodeConfigOf C2.migrate C2.migrateWarn
+    config3 = reencodeConfigOf C3.migrate C3.migrateWarn
 
     reencodeConfigOf migrate migrateWarn path = do
       rawCfg <- configOf path
diff --git a/codex/Main/Config/Codex0.hs b/codex/Main/Config/Codex0.hs
--- a/codex/Main/Config/Codex0.hs
+++ b/codex/Main/Config/Codex0.hs
@@ -16,4 +16,4 @@
 migrateWarn = return ()
 
 migrate :: Codex -> New.Codex
-migrate cx = New.Codex True (hackagePath cx) (tagsCmd cx) True True New.defaultTagsFileName
+migrate cx = New.Codex True (hackagePath cx) New.defaultStackOpts (tagsCmd cx) True True New.defaultTagsFileName
diff --git a/codex/Main/Config/Codex1.hs b/codex/Main/Config/Codex1.hs
--- a/codex/Main/Config/Codex1.hs
+++ b/codex/Main/Config/Codex1.hs
@@ -18,4 +18,11 @@
   putStrLn "\tif that is not the behavior you want, please edit `~/.codex`."
 
 migrate :: Codex -> New.Codex
-migrate cx = New.Codex True (hackagePath cx) (tagsCmd cx) (tagsFileHeader cx) (tagsFileSorted cx) New.defaultTagsFileName
+migrate cx = New.Codex
+  True
+  (hackagePath cx)
+  New.defaultStackOpts
+  (tagsCmd cx)
+  (tagsFileHeader cx)
+  (tagsFileSorted cx)
+  New.defaultTagsFileName
diff --git a/codex/Main/Config/Codex2.hs b/codex/Main/Config/Codex2.hs
--- a/codex/Main/Config/Codex2.hs
+++ b/codex/Main/Config/Codex2.hs
@@ -17,4 +17,11 @@
 
 migrate :: Codex -> New.Codex
 migrate cx =
-  New.Codex True (hackagePath cx) (tagsCmd cx) (tagsFileHeader cx) (tagsFileSorted cx) New.defaultTagsFileName
+  New.Codex
+    True
+    (hackagePath cx)
+    New.defaultStackOpts
+    (tagsCmd cx)
+    (tagsFileHeader cx)
+    (tagsFileSorted cx)
+    New.defaultTagsFileName
diff --git a/codex/Main/Config/Codex3.hs b/codex/Main/Config/Codex3.hs
new file mode 100644
--- /dev/null
+++ b/codex/Main/Config/Codex3.hs
@@ -0,0 +1,34 @@
+{-# LANGUAGE DeriveGeneric #-}
+module Main.Config.Codex3 where
+
+import Data.Yaml
+import GHC.Generics
+
+import qualified Codex as New
+
+data Codex = Codex
+  { currentProjectIncluded :: Bool
+  , hackagePath :: FilePath
+  , tagsCmd :: String
+  , tagsFileHeader :: Bool
+  , tagsFileSorted :: Bool
+  , tagsFileName :: FilePath }
+    deriving Generic
+
+instance ToJSON Codex
+instance FromJSON Codex
+
+migrateWarn :: IO ()
+migrateWarn = return ()
+
+migrate :: Codex -> New.Codex
+migrate cx =
+  New.Codex
+    True
+    (hackagePath cx)
+    (New.defaultStackOpts)
+    (tagsCmd cx)
+    (tagsFileHeader cx)
+    (tagsFileSorted cx)
+    (tagsFileName cx)
+
diff --git a/src/Codex.hs b/src/Codex.hs
--- a/src/Codex.hs
+++ b/src/Codex.hs
@@ -1,5 +1,5 @@
 {-# LANGUAGE CPP #-}
-module Codex (Codex(..), defaultTagsFileName, Verbosity, module Codex) where
+module Codex (Codex(..), defaultStackOpts, defaultTagsFileName, Verbosity, module Codex) where
 
 #if !MIN_VERSION_base(4,8,0)
 import Control.Applicative ((<$>))
diff --git a/src/Codex/Internal.hs b/src/Codex/Internal.hs
--- a/src/Codex/Internal.hs
+++ b/src/Codex/Internal.hs
@@ -18,14 +18,18 @@
 
 import qualified Data.List as L
 
+defaultStackOpts :: FilePath
+defaultStackOpts = ""
+
 defaultTagsFileName :: FilePath
 defaultTagsFileName = "codex.tags"
 
-data Builder = Cabal | Stack
+data Builder = Cabal | Stack String
 
 data Codex = Codex
   { currentProjectIncluded :: Bool
   , hackagePath :: FilePath
+  , stackOpts :: String
   , tagsCmd :: String
   , tagsFileHeader :: Bool
   , tagsFileSorted :: Bool
@@ -37,8 +41,8 @@
 instance FromJSON Codex
 
 hackagePathOf :: Builder -> Codex -> FilePath
-hackagePathOf Cabal cx = hackagePath cx
-hackagePathOf Stack cx = hackagePath cx </> "packages"
+hackagePathOf Cabal     cx = hackagePath cx
+hackagePathOf (Stack _) cx = hackagePath cx </> "packages"
 
 packagePath :: FilePath -> PackageIdentifier -> FilePath
 packagePath root i = root </> relativePath i where
@@ -70,12 +74,16 @@
  where
   trim = reverse . dropWhile isSpace . reverse . dropWhile isSpace
 
-readStackPath :: String -> IO String
-readStackPath id' = init <$> readCreateProcess (shell ("stack path --" ++ id')) ""
+readStackPath :: String -> String -> IO String
+readStackPath opts id' = do
+  let cmd = concat ["stack ", opts, " path --", id']
+  s <- readCreateProcess (shell cmd) ""
+  return $ init s
 
-stackListDependencies :: IO [PackageIdentifier]
-stackListDependencies = do
-    s <- readCreateProcess (shell ("stack list-dependencies")) ""
+stackListDependencies :: String -> IO [PackageIdentifier]
+stackListDependencies opts = do
+    let cmd = concat ["stack ", opts,  " list-dependencies"]
+    s <- readCreateProcess (shell cmd) ""
     return $ mapMaybe parsePackageIdentifier $ lines s
   where
     parsePackageIdentifier line =
diff --git a/src/Codex/Project.hs b/src/Codex/Project.hs
--- a/src/Codex/Project.hs
+++ b/src/Codex/Project.hs
@@ -85,8 +85,8 @@
           xs = fmap sourcePackageId $ ys
       return xs where
         withCabal = getPersistBuildConfig $ root </> "dist"
-    Stack -> let self = package (packageDescription pd)
-             in  filter (/=self) <$> stackListDependencies
+    Stack cmd -> let self = package (packageDescription pd)
+             in  filter (/=self) <$> stackListDependencies cmd
 
 resolveHackageDependencies :: Hackage -> GenericPackageDescription -> [GenericPackageDescription]
 resolveHackageDependencies db pd = maybeToList . resolveDependency db =<< allDependencies pd where
@@ -100,7 +100,7 @@
   xs <- either fallback return =<< resolveInstalledDependencies bldr root pd
   return xs where
     fallback e = do
-      putStrLn $ concat ["cabal: ", show e]
+      putStrLn $ concat ["codex: ", show e]
       putStrLn "codex: *warning* falling back on dependency resolution using hackage"
       resolveWithHackage
     resolveWithHackage = do
