Advanced dexterous prosthetics technology has been under rapid development as a potential solution to upper limb amputation. An important problem in the neural prosthetics design is to develop control policies for prosthesis movements. This requires an estimation of cognitive states. Previous works mostly used premotor and primary motor neurons to estimate cognitive states. Here we demonstrate that the recorded neural activity from the somatosensory cortex can be used to estimate cognitive states in complex behavioral tasks. We measure the latencies between the predicted cognitive state transitions and true transitions. The maximum prediction latency for grasping a sphere, pulling a mallet, pushing a button and pulling a cylinder are 42±21 ms, 91.6±10.7 ms, 177.1±94.6 ms, 22.5±74.5 ms, respectively. These latency estimates indicate that good timing of the cognitive states with small latencies can be obtained from the somatosensory neural data to plan movements of prosthetic limbs.