diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
 # Revision history for futhark-server
 
+## 1.2.4.0 -- 2026-02-19
+
+* Report exit code when server terminates with nonzero exit code.
+
+* Support for `index` and `shape` commands.
+
 ## 1.2.3.0 -- 2024-10-25
 
 * Add `abortServer`.
diff --git a/futhark-server.cabal b/futhark-server.cabal
--- a/futhark-server.cabal
+++ b/futhark-server.cabal
@@ -1,6 +1,6 @@
 cabal-version:      2.4
 name:               futhark-server
-version:            1.2.3.0
+version:            1.2.4.0
 synopsis: Client implementation of the Futhark server protocol.
 
 description: Provides an easy way to interact with a running Futhark
diff --git a/src/Futhark/Server.hs b/src/Futhark/Server.hs
--- a/src/Futhark/Server.hs
+++ b/src/Futhark/Server.hs
@@ -52,6 +52,10 @@
     cmdProject,
     cmdFields,
 
+    -- * Arrays
+    cmdShape,
+    cmdIndex,
+
     -- ** Auxiliary
     cmdReport,
     cmdPauseProfiling,
@@ -186,9 +190,13 @@
   code <- P.waitForProcess $ serverProc s
   case code of
     ExitSuccess -> pure ()
-    ExitFailure _ -> do
+    ExitFailure x -> do
       stderr_s <- readFile $ serverErrLog s
-      error stderr_s
+      error $
+        "Server terminated with nonzero exit code "
+          <> show x
+          <> " and stderr:\n"
+          <> stderr_s
 
 -- | Terminate the server process.  You'll still need to call
 -- 'stopServer' unless used inside 'withServer', which does it for
@@ -382,7 +390,7 @@
 
 -- | @tuning_param_class param@
 cmdTuningParamClass :: Server -> Text -> IO (Either CmdFailure Text)
-cmdTuningParamClass s param = fmap head <$> sendCommand s "tuning_param_class" [param]
+cmdTuningParamClass s param = fmap mconcat <$> sendCommand s "tuning_param_class" [param]
 
 -- | @types@
 cmdTypes :: Server -> IO (Either CmdFailure [Text])
@@ -403,6 +411,15 @@
 -- | @project to from field@
 cmdProject :: Server -> Text -> Text -> Text -> IO (Maybe CmdFailure)
 cmdProject s to from field = helpCmd s "project" [to, from, field]
+
+-- | @shape v@
+cmdShape :: Server -> VarName -> IO (Either CmdFailure [Int])
+cmdShape s v = fmap (map (read . T.unpack)) <$> sendCommand s "shape" [v]
+
+-- | @index v0 v1 i0 ... iN-1@
+cmdIndex :: Server -> VarName -> VarName -> [Int] -> IO (Maybe CmdFailure)
+cmdIndex s v0 v1 is =
+  helpCmd s "index" $ [v0, v1] <> map (T.pack . show) is
 
 -- | Turn a 'Maybe'-producing command into a monadic action.
 cmdMaybe :: (MonadError Text m, MonadIO m) => IO (Maybe CmdFailure) -> m ()
