         startIndex = history.length - historySize
         history = history.reverse().splice(startIndex, historySize)
 
-        outstream = fs.createWriteStream('.hubot_history')
+        outstream = fs.createWriteStream(historyPath)
         # >= node 0.10
         outstream.on 'finish', () =>
           @shutdown()

         @shutdown()

  loadHistory: (callback) ->
    fs.exists '.hubot_history', (exists) ->
      if exists
        instream = fs.createReadStream('.hubot_history')
        outstream = new stream
        outstream.readable = true
        outstream.writable = true

                parseInt(process.env.HUBOT_SHELL_HISTSIZE)
              else
                1024

historyPath = ".hubot_history"

class Shell extends Adapter
  send: (envelope, strings...) ->
